Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Install external tools from toolchain
run: |
cd toolchain
./install_abacus_toolchain_new.sh --with-dftd4=install --dry-run -j8
./install_abacus_toolchain_new.sh --with-dftd4 --with-nep --dry-run -j8
./scripts/stage4/install_stage4.sh
cd ..

Expand Down Expand Up @@ -131,6 +131,7 @@ jobs:
-DENABLE_FLOAT_FFTW=ON \
-DENABLE_DFTD4=ON \
-DENABLE_PEXSI=ON \
-DENABLE_NEP=ON \
-Werror=dev

- name: Build
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ option(ENABLE_DFTD4 "Enable DFT-D4 dispersion correction" OFF)
option(ENABLE_PLUMED "Enable using the PLUMED enhanced-sampling library" OFF)
option(ENABLE_JSON "Enable JSON output" OFF)
option(ENABLE_CNPY "Enable cnpy usage" OFF)
option(ENABLE_NEP "Enable NEP_CPU" OFF)

option(DEBUG_INFO "Print message to debug" OFF)
option(COMMIT_INFO "Print commit information in log" ON)
Expand Down Expand Up @@ -595,8 +596,8 @@ if(DEFINED DeePMD_DIR)
find_package(DeePMD REQUIRED)
endif()

if(DEFINED NEP_DIR)
find_package(NEP REQUIRED)
if(ENABLE_NEP)
find_package(NEP_CPU CONFIG REQUIRED)
endif()

if(DEFINED TensorFlow_DIR)
Expand Down
6 changes: 2 additions & 4 deletions cmake/CollectBuildInfoVars.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,8 @@ else()
set(ABACUS_DEEPMD_VERSION "no")
endif()

if(DEFINED NEP_DIR AND NEP_VERSION)
set(ABACUS_NEP_VERSION "yes (v${NEP_VERSION})")
elseif(DEFINED NEP_DIR)
set(ABACUS_NEP_VERSION "yes (path: ${NEP_DIR})")
if(ENABLE_NEP)
set(ABACUS_NEP_VERSION "yes")
else()
set(ABACUS_NEP_VERSION "no")
endif()
Expand Down
47 changes: 0 additions & 47 deletions cmake/modules/FindNEP.cmake

This file was deleted.

9 changes: 1 addition & 8 deletions docs/advanced/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,8 @@ cmake -B build -DDeePMD_DIR=/dir_to_deepmd-kit -DTorch_DIR=/dir_to_pytorch
```

## Build with NEP
This interface enables running MD simulations with the NEP model. It requires the [NEP_CPU](https://github.com/brucefan1983/NEP_CPU) library, which can be easily installed using toolchain as shown below:
```bash
./install_abacus_toolchain_new.sh --with-nep=install
```

To build ABACUS:
```bash
cmake -B build -DNEP_DIR=/path/to/nep_cpu
```
This interface enables running MD simulations with the NEP model. It requires the [NEP_CPU](https://github.com/brucefan1983/NEP_CPU) library version 1.5.1 or newer. To build ABACUS with NEP support, pass `-DENABLE_NEP=ON` to CMake.

## Build with LibRI support

Expand Down
13 changes: 4 additions & 9 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ set(_abacus_feature_definitions
$<$<BOOL:${ENABLE_LIBRI}>:TEST_EXX_RADIAL=1>
$<$<BOOL:${ENABLE_LIBXC}>:__LIBXC>
$<$<BOOL:${ENABLE_DFTD4}>:__DFTD4>
$<$<BOOL:${ENABLE_NEP}>:__NEP>
$<$<BOOL:${MATH_INFO}>:GATHER_INFO>)

if(ABACUS_COMMIT_INFO_INCLUDE_DIR)
Expand All @@ -86,9 +87,6 @@ if(DEFINED DeePMD_DIR)
list(APPEND _abacus_feature_definitions __DPMDC)
endif()
endif()
if(DEFINED NEP_DIR AND NEP_FOUND)
list(APPEND _abacus_feature_definitions __NEP)
endif()

target_include_directories(
abacus_compile_requirements
Expand Down Expand Up @@ -296,7 +294,8 @@ set(_abacus_feature_libs
$<$<BOOL:${ENABLE_CNPY}>:ZLIB::ZLIB>
$<$<BOOL:${ENABLE_LIBRI}>:cereal::cereal>
$<$<BOOL:${ENABLE_LIBXC}>:Libxc::xc>
$<$<BOOL:${ENABLE_PLUMED}>:PLUMED::plumed>)
$<$<BOOL:${ENABLE_PLUMED}>:PLUMED::plumed>
$<$<BOOL:${ENABLE_NEP}>:nep::nep_cpu>)
set(_abacus_feature_include_dirs)
set(_abacus_feature_compile_options)

Expand Down Expand Up @@ -341,10 +340,6 @@ if(DEFINED DeePMD_DIR)
list(APPEND _abacus_feature_include_dirs ${DeePMD_DIR}/include)
endif()

if(DEFINED NEP_DIR AND NEP_FOUND)
list(APPEND _abacus_feature_libs NEP::nep)
endif()

if(DEFINED TensorFlow_DIR AND TensorFlow_FOUND)
list(APPEND _abacus_feature_libs TensorFlow::tensorflow_cc)
list(APPEND _abacus_feature_include_dirs ${TensorFlow_DIR}/include)
Expand Down Expand Up @@ -424,7 +419,7 @@ foreach(
dftd4::dftd4
DeePMD::deepmd_c
DeePMD::deepmd_cc
NEP::nep
nep::nep_cpu
TensorFlow::tensorflow_cc
ZLIB::ZLIB
PEXSI::PEXSI
Expand Down
5 changes: 3 additions & 2 deletions source/source_md/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ addtest(
SOURCES test_dp_aparam.cpp ../module_dp/dp_aparam.cpp)

set(_md_nep_test_libs parameter psi device)
if(DEFINED NEP_DIR AND NEP_FOUND)
list(APPEND _md_nep_test_libs NEP::nep)
if(ENABLE_NEP)
list(APPEND _md_nep_test_libs nep::nep_cpu)
configure_file("${ABACUS_TEST_DIR}/PP_ORB/nep_hfo2.txt" nep_hfo2.txt COPYONLY)
endif()

addtest(
Expand Down
6 changes: 1 addition & 5 deletions source/source_md/unittests/test_nep_forcefield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@

TEST(NEPPotential, UnitCellCalculationOrMissingBackend)
{
const std::string source_file = __FILE__;
const std::string marker = "/source/source_md/";
const std::size_t marker_pos = source_file.find(marker);
ASSERT_NE(marker_pos, std::string::npos);
const std::string model_file = source_file.substr(0, marker_pos) + "/tests/PP_ORB/nep_hfo2.txt";
const std::string model_file = "nep_hfo2.txt";

UnitCell cell;
Setcell::setupcell(cell);
Expand Down
2 changes: 1 addition & 1 deletion tests/04_FF/CASES_CPU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
19_LJ_RE_stop
20_LJ_dry_run
#50_DP_Al
#101_NEP_HfO2
101_NEP_HfO2
Comment thread
Growl1234 marked this conversation as resolved.
Resolved
102_SNAP_base
103_SNAP_pbc
104_SNAP_inner
Expand Down
Loading
Loading