summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/onnx-shared-libraries.patch
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2021-07-30 17:19:34 +0200
committerLudovic Courtès <ludo@gnu.org>2021-07-31 01:03:24 +0200
commitfa2d94b5e362c684da812d494463d965e601c18d (patch)
treec1d65cd1497bf947a3d83a064539266e62d06723 /gnu/packages/patches/onnx-shared-libraries.patch
parent2b55f914c3198f9b07399d10502fbdb22b7d6e47 (diff)
downloadguix-patches-fa2d94b5e362c684da812d494463d965e601c18d.tar
guix-patches-fa2d94b5e362c684da812d494463d965e601c18d.tar.gz
gnu: python-onnx: Rename to "onnx".
* gnu/packages/machine-learning.scm (python-onnx): Rename to... (onnx): ... this, and change 'name' field accordingly. (python-onnx): New variable. * gnu/packages/patches/python-onnx-shared-libraries.patch: Rename to... * gnu/packages/patches/onnx-shared-libraries.patch: ... this. * gnu/packages/patches/python-onnx-use-system-googletest.patch: Rename to... * gnu/packages/patches/onnx-use-system-googletest.patch: ... this. * gnu/local.mk (dist_patch_DATA): Adjust accordingly.
Diffstat (limited to 'gnu/packages/patches/onnx-shared-libraries.patch')
-rw-r--r--gnu/packages/patches/onnx-shared-libraries.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/gnu/packages/patches/onnx-shared-libraries.patch b/gnu/packages/patches/onnx-shared-libraries.patch
new file mode 100644
index 0000000000..00583b35da
--- /dev/null
+++ b/gnu/packages/patches/onnx-shared-libraries.patch
@@ -0,0 +1,24 @@
+These linker options for the 'onnx_cpp2py_export.cpython-38-*-gnu.so'
+(or similar) extension are meant to be used when building 'libonn.a',
+a static archive. This patch adapts the link flags to linking with
+'libonnx.so'.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cede3073..52f846ed 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -475,11 +475,10 @@ if(BUILD_ONNX_PYTHON)
+ PRIVATE $<TARGET_OBJECTS:onnx>)
+ else()
+ # Assume everything else is like gcc
+- target_link_libraries(onnx_cpp2py_export
+- PRIVATE "-Wl,--whole-archive" $<TARGET_FILE:onnx>
+- "-Wl,--no-whole-archive")
++ target_link_libraries(onnx_cpp2py_export PRIVATE onnx)
+ set_target_properties(onnx_cpp2py_export
+- PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL")
++ PROPERTIES LINK_FLAGS
++ "-Wl,-rpath=${CMAKE_INSTALL_PREFIX}/lib")
+ endif()
+
+ target_link_libraries(onnx_cpp2py_export PRIVATE onnx)