From 2b55f914c3198f9b07399d10502fbdb22b7d6e47 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 30 Jul 2021 17:04:40 +0200 Subject: gnu: python-onnx: Install libonnx.so and libonnx_proto.so. * gnu/packages/patches/python-onnx-shared-libraries.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/machine-learning.scm (python-onnx)[source]: Use it. [arguments]: New field. --- .../patches/python-onnx-shared-libraries.patch | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 gnu/packages/patches/python-onnx-shared-libraries.patch (limited to 'gnu/packages/patches/python-onnx-shared-libraries.patch') diff --git a/gnu/packages/patches/python-onnx-shared-libraries.patch b/gnu/packages/patches/python-onnx-shared-libraries.patch new file mode 100644 index 0000000000..00583b35da --- /dev/null +++ b/gnu/packages/patches/python-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 $) + else() + # Assume everything else is like gcc +- target_link_libraries(onnx_cpp2py_export +- PRIVATE "-Wl,--whole-archive" $ +- "-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) -- cgit 1.4.1