Skip to content

Commit

Permalink
apply deepmodeling/deepmd-kit#3025 to fix plugin loading issues
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz committed Dec 3, 2023
1 parent 4f62717 commit 2193e5a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
30 changes: 30 additions & 0 deletions recipe/3025.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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(
4 changes: 3 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ package:
source:
- url: https://github.com/deepmodeling/{{ name }}/archive/v{{ version }}.tar.gz
sha256: 25be126de336630493732b09d3b779b89cc916345b22dfb869cc4f3a3ba6dcde
patches:
- 3025.patch
- url: https://github.com/lammps/lammps/archive/{{ lammps_version }}.tar.gz
sha256: 48dc8b0b0583689e80ea2052275acbc3e3fce89707ac557e120db5564257f7df
folder: lammps

build:
number: 3
number: 4
string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
string: cpu_py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
skip: true # [win]
Expand Down

0 comments on commit 2193e5a

Please sign in to comment.