forked from conda-forge/deepmd-kit-feedstock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apply deepmodeling/deepmd-kit#3025 to fix plugin loading issues
- Loading branch information
Showing
3 changed files
with
76 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
From 8ccec49ac29b484ea25ab7159baed7d9a3d9dfdb Mon Sep 17 00:00:00 2001 | ||
From: Jinzhe Zeng <[email protected]> | ||
Date: Sat, 2 Dec 2023 18:20:53 -0500 | ||
Subject: [PATCH 1/2] set rpath for symlink and macos | ||
|
||
Signed-off-by: Jinzhe Zeng <[email protected]> | ||
--- | ||
source/lmp/plugin/CMakeLists.txt | 7 +++++-- | ||
1 file changed, 5 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/source/lmp/plugin/CMakeLists.txt b/source/lmp/plugin/CMakeLists.txt | ||
index bfc225341..e6dc0fc99 100644 | ||
--- a/source/lmp/plugin/CMakeLists.txt | ||
+++ b/source/lmp/plugin/CMakeLists.txt | ||
@@ -96,10 +96,13 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION) | ||
endif() | ||
if(CMAKE_SYSTEM_NAME STREQUAL Darwin) | ||
set_target_properties(${libname} PROPERTIES LINK_FLAGS | ||
- "-Wl,-undefined,dynamic_lookup") | ||
+ "-Wl,-undefined,dynamic_lookup" | ||
+ INSTALL_RPATH | ||
+ "@loader_path:${TensorFlow_LIBRARY_PATH}:@loader_path/.." | ||
+ ) | ||
else() | ||
set_target_properties( | ||
- ${libname} PROPERTIES INSTALL_RPATH "$ORIGIN;${TensorFlow_LIBRARY_PATH}" | ||
+ ${libname} PROPERTIES INSTALL_RPATH "$ORIGIN;${TensorFlow_LIBRARY_PATH};$ORIGIN/.." | ||
LINK_FLAGS "-rdynamic") | ||
endif() | ||
target_compile_definitions( | ||
|
||
From d0281e58a11eae6d55f5024ddfe4acd2083fff55 Mon Sep 17 00:00:00 2001 | ||
From: "pre-commit-ci[bot]" | ||
<66853113+pre-commit-ci[bot]@users.noreply.github.com> | ||
Date: Sat, 2 Dec 2023 23:23:44 +0000 | ||
Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks | ||
|
||
for more information, see https://pre-commit.ci | ||
--- | ||
source/lmp/plugin/CMakeLists.txt | 15 ++++++++------- | ||
1 file changed, 8 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/source/lmp/plugin/CMakeLists.txt b/source/lmp/plugin/CMakeLists.txt | ||
index e6dc0fc99..41aa41f7f 100644 | ||
--- a/source/lmp/plugin/CMakeLists.txt | ||
+++ b/source/lmp/plugin/CMakeLists.txt | ||
@@ -95,15 +95,16 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION) | ||
${libname} PRIVATE ${LAMMPS_SOURCE_ROOT}/src/EXTRA-FIX) # for ttm | ||
endif() | ||
if(CMAKE_SYSTEM_NAME STREQUAL Darwin) | ||
- set_target_properties(${libname} PROPERTIES LINK_FLAGS | ||
- "-Wl,-undefined,dynamic_lookup" | ||
- INSTALL_RPATH | ||
- "@loader_path:${TensorFlow_LIBRARY_PATH}:@loader_path/.." | ||
- ) | ||
+ set_target_properties( | ||
+ ${libname} | ||
+ PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup" | ||
+ INSTALL_RPATH | ||
+ "@loader_path:${TensorFlow_LIBRARY_PATH}:@loader_path/..") | ||
else() | ||
set_target_properties( | ||
- ${libname} PROPERTIES INSTALL_RPATH "$ORIGIN;${TensorFlow_LIBRARY_PATH};$ORIGIN/.." | ||
- LINK_FLAGS "-rdynamic") | ||
+ ${libname} | ||
+ PROPERTIES INSTALL_RPATH "$ORIGIN;${TensorFlow_LIBRARY_PATH};$ORIGIN/.." | ||
+ LINK_FLAGS "-rdynamic") | ||
endif() | ||
target_compile_definitions( | ||
${libname} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters