use CMakeLists.txt file that ships with PACE library

this sets the necessary define so that the compilation hack is no longer needed
This commit is contained in:
Axel Kohlmeyer
2022-09-25 17:55:11 -04:00
parent cb92a1553c
commit d34d5139cb
2 changed files with 3 additions and 19 deletions

View File

@ -15,23 +15,9 @@ execute_process(
)
get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace)
# enforce building libyaml-cpp as static library and turn off optional features
set(YAML_BUILD_SHARED_LIBS OFF)
set(YAML_CPP_BUILD_CONTRIB OFF)
set(YAML_CPP_BUILD_TOOLS OFF)
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
set(PACE_INCLUDE_DIRS "${lib-pace}/ML-PACE/ace" "${lib-pace}/ML-PACE/ace-evaluator" "${lib-pace}/wigner-cpp/include/wigner")
file(GLOB PACE_SOURCES ${lib-pace}/ML-PACE/ace/*.cpp ${lib-pace}/ML-PACE/ace-evaluator/*.cpp)
list(FILTER PACE_SOURCES EXCLUDE REGEX pair_pace.cpp)
add_library(pace STATIC ${PACE_SOURCES} ${lib-pace}/cnpy/cnpy.cpp)
add_subdirectory(${lib-pace} build-pace)
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
target_include_directories(pace PUBLIC ${PACE_INCLUDE_DIRS} ${YAML_CPP_INCLUDE_DIR} ${lib-pace}/cnpy)
target_link_libraries(pace PRIVATE yaml-cpp-pace)
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
target_link_libraries(lammps PRIVATE pace)
endif()

View File

@ -212,10 +212,8 @@ void PairPACEExtrapolation::compute(int eflag, int vflag)
}
// 'compute_atom' will update the `ace->e_atom` and `ace->neighbours_forces(jj, alpha)` arrays and max_gamma_grade
if (flag_compute_extrapolation_grade) {
//FIXME: need an updated PACE library URL since this currently fails compiling
// extrapolation_grade_gamma[i] = aceimpl->ace->max_gamma_grade;
}
if (flag_compute_extrapolation_grade)
extrapolation_grade_gamma[i] = aceimpl->ace->max_gamma_grade;
Array2D<DOUBLE_TYPE> &neighbours_forces =
(flag_compute_extrapolation_grade ? aceimpl->ace->neighbours_forces