Skip to content

Commit

Permalink
Fix onnx wrapper linking (#106)
Browse files Browse the repository at this point in the history
* Fix link to onnxWrapper.so
* Bump version
  • Loading branch information
AnHeuermann authored Nov 10, 2023
1 parent a7856ca commit e4ec785
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NonLinearSystemNeuralNetworkFMU"
uuid = "cef0780c-fc83-4b94-9c0c-d964a51a3c65"
authors = ["AnHeuermann <[email protected]>"]
version = "0.5.2"
version = "0.5.3"

[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ git submodule update --init

## Requirements

- Julia v1.7.1 or newer.
- OpenModelica version v1.22.0-dev-43-g33a50c3 or newer.
- Julia v1.9 or newer.
- OpenModelica version v1.23.0-dev-83 or newer.
- Path has to contain the OpenModelica bin directory `/path/to/OpenModelica/bin/`.
- For running the tests: Environment variable `OPENMODELICAHOME` set to point to the installation directory of OpenModelica.
- CMake version 3.21 or newer.
Expand Down
12 changes: 9 additions & 3 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.9.1"
julia_version = "1.9.0"
manifest_format = "2.0"
project_hash = "4b146df7f9cdfdebdd392152137bb8eb3d57c630"

Expand Down Expand Up @@ -606,6 +606,12 @@ git-tree-sha1 = "ffa4926cc857bcc5c256825bd7273a6ac989eb34"
uuid = "7cc45869-7501-5eee-bdea-0790c847d4ef"
version = "0.0.80+0"

[[deps.EpollShim_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "8e9441ee83492030ace98f9789a654a6d0b1f643"
uuid = "2702e6a9-849d-5ed8-8c21-79e8b8f9ee43"
version = "0.0.20230411+0"

[[deps.ExceptionUnwrapping]]
deps = ["Test"]
git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96"
Expand Down Expand Up @@ -2322,7 +2328,7 @@ uuid = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f"
version = "0.2.0"

[[deps.Wayland_jll]]
deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"]
deps = ["Artifacts", "EpollShim_jll", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"]
git-tree-sha1 = "ed8d92d9774b077c53e1da50fd81a36af3744c1c"
uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89"
version = "1.21.0+0"
Expand Down Expand Up @@ -2568,7 +2574,7 @@ version = "0.15.1+0"
[[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
version = "5.8.0+0"
version = "5.7.0+0"

[[deps.libfdk_aac_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
Expand Down
4 changes: 2 additions & 2 deletions docs/src/integrateONNX.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ onnxFiles = ["eq_14.onnx"]
buildWithOnnx(fmu,
modelName,
profilingInfo::Array{ProfilingInfo},
onnxFiles::Array{String},
profilingInfo,
onnxFiles,
tempDir = "onnxTempDir")
```

Expand Down
12 changes: 8 additions & 4 deletions src/integrateNN.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,15 @@ function modifyCMakeLists(path_to_cmakelists::String)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
""" *
str[id1+1:end]
str = newStr

newStr = replace(newStr,
"target_link_libraries(\${FMU_NAME} PRIVATE m Threads::Threads)"
=>
"target_link_libraries(\${FMU_NAME} PRIVATE m Threads::Threads onnxWrapper)")
# Link to onnxWrapper
id1 = last(findStrWError("# Add include directories", newStr))
newStr = str[1:id1-1] * EOL *
"""
target_link_libraries(\${FMU_NAME} PRIVATE onnxWrapper)
""" * EOL *
str[id1+1:end]
end

write(path_to_cmakelists, newStr)
Expand Down

0 comments on commit e4ec785

Please sign in to comment.