瀏覽代碼

Corrections to CMakeLists.txt to find the installed .so (#247)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
dsuponitskiy 6 月之前
父節點
當前提交
5bdfd9300f
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      CMakeLists.txt

+ 9 - 1
CMakeLists.txt

@@ -74,7 +74,15 @@ pybind11_add_module(openfhe
                     )
 # The next line ensures that the installed openfhe module can find its shared library dependencies
 # in the 'lib/' subdirectory relative to itself without requiring LD_LIBRARY_PATH.
-target_link_options(openfhe PRIVATE "-Wl,-rpath=$ORIGIN/lib" "-Wl,--disable-new-dtags")
+### target_link_options(openfhe PRIVATE "-Wl,-rpath=$ORIGIN/lib" "-Wl,--disable-new-dtags")
+target_link_options(openfhe PRIVATE "-Wl,--enable-new-dtags" "-Wl,-rpath,\$ORIGIN/lib")
+
+# Also set target RPATH properties (survive install/copying)
+set_target_properties(openfhe PROPERTIES
+  BUILD_RPATH   "\$ORIGIN/lib"
+  INSTALL_RPATH "\$ORIGIN/lib"
+)
+
 
 ### Python installation 
 # Allow the user to specify the path to Python executable (if not provided, find it)