-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: support LAMMPS in built-in mode; remove kspace requirement (#2891
) Fix #2875. Add documentation and supporting file to install LAMMPS in built-in mode with CMake. Compile required C++ files from the kspace package (pppm.cpp, ffft3d.cpp, ffft3d_wrap.cpp, remap.cpp, remap_wrap.cpp) in the CMake files for both built-in and plugin modes, so there is no need to set PKG_KSAPCE=ON. --------- Signed-off-by: Jinzhe Zeng <[email protected]>
- Loading branch information
Showing
4 changed files
with
80 additions
and
7 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
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
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,31 @@ | ||
# This file should be included in the end of | ||
# ${LAMMPS_SOURCE_DIR}/cmake/CMakeLists.txt | ||
# include(/path/to/deepmd_source/source/lmp/builtin.cmake) | ||
|
||
# assume LAMMPS CMake file has been executed, so these target/variables exist: | ||
# lammps LAMMPS_SOURCE_DIR get_lammps_version | ||
|
||
get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION_NUMBER) | ||
|
||
configure_file("${CMAKE_CURRENT_LIST_DIR}/deepmd_version.h.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/deepmd_version.h" @ONLY) | ||
|
||
file(GLOB DEEPMD_LMP_SRC ${CMAKE_CURRENT_LIST_DIR}/*.cpp) | ||
|
||
find_package(DeePMD REQUIRED) | ||
target_sources( | ||
lammps | ||
PRIVATE ${DEEPMD_LMP_SRC} | ||
${LAMMPS_SOURCE_DIR}/KSPACE/pppm.cpp # for pppm_dplr | ||
${LAMMPS_SOURCE_DIR}/KSPACE/fft3d.cpp | ||
${LAMMPS_SOURCE_DIR}/KSPACE/fft3d_wrap.cpp | ||
${LAMMPS_SOURCE_DIR}/KSPACE/remap.cpp | ||
${LAMMPS_SOURCE_DIR}/KSPACE/remap_wrap.cpp | ||
${LAMMPS_SOURCE_DIR}/EXTRA-FIX/fix_ttm.cpp # for ttm | ||
) | ||
target_link_libraries(lammps PUBLIC DeePMD::deepmd_c) | ||
target_include_directories( | ||
lammps PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR} | ||
${LAMMPS_SOURCE_DIR}/KSPACE ${LAMMPS_SOURCE_DIR}/EXTRA-FIX) | ||
target_compile_definitions( | ||
lammps PRIVATE "LAMMPS_VERSION_NUMBER=${LAMMPS_VERSION_NUMBER}") |
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