Skip to content

Commit abf3477

Browse files
authored
Fix LAMMPS plugin symlink path on macOS platform (deepmodeling#3473)
This pull request fixes the broken symlink for `dpplugin.so` on macOS. It should point to `libdeepmd_lmp.so` but point to `libdeepmd_lmp.dylib` instead. ### Details The `libdeepmd_lmp` is a shared module. https://github.com/deepmodeling/deepmd-kit/blob/b875ea8f6661b6e1567537ead7e2b4a8b14ea113/source/lmp/plugin/CMakeLists.txt#L72 The build target name on macOS is `libdeepmd_lmp.so`. Because on macOS, the `CMAKE_SHARED_MODULE_SUFFIX` (`.so`) is different from `CMAKE_SHARED_LIBRARY_SUFFIX` (`.dynlib`). As a result, in previous versions, on macOS the symbolic link `dpplugin.so` was pointed to `libdeepmd_lmp.dylib`, which does not exist. One can check the conda-forge builds to confirm (e.g., [osx-arm64/deepmd-kit-2.2.9-cpu_py311hf5376d5_mpi_openmpi_0.conda](https://anaconda.org/conda-forge/deepmd-kit/2.2.9/download/osx-arm64/deepmd-kit-2.2.9-cpu_py311hf5376d5_mpi_openmpi_0.conda)).
1 parent 4b3a77b commit abf3477

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/lmp/plugin/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION)
126126
install(
127127
CODE "execute_process( \
128128
COMMAND ${CMAKE_COMMAND} -E create_symlink \
129-
../${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_SHARED_LIBRARY_SUFFIX} \
129+
../${CMAKE_SHARED_MODULE_PREFIX}${libname}${CMAKE_SHARED_MODULE_SUFFIX} \
130130
${CMAKE_INSTALL_PREFIX}/lib/${libname}/${PLUGINNAME} \
131131
)")
132132
endif()

0 commit comments

Comments
 (0)