unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 5a3fd658d08b759b27ddeb7cf8ffe45833bc0ad4 1401 bytes (raw)
name: packages/patches/onnx-shared-libraries.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
These linker options for the 'onnx_cpp2py_export.cpython-310-*-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 b666eec4..1525b219 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -585,16 +585,15 @@ 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)
     # Prevent "undefined symbol: _ZNSt10filesystem7__cxx114path14_M_split_cmptsEv" 
     # (std::filesystem::__cxx11::path::_M_split_cmpts()) on gcc 8
     if (CMAKE_CXX_STANDARD EQUAL 17 AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
       target_link_libraries(onnx_cpp2py_export PRIVATE "-lstdc++fs")
     endif()
     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)

debug log:

solving 5a3fd658d08b759b27ddeb7cf8ffe45833bc0ad4 ...
found 5a3fd658d08b759b27ddeb7cf8ffe45833bc0ad4 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).