forked from lijiext/lammps
Merge remote-tracking branch 'github/junghans-CMake-typo' into correct-kokkos-docs
This commit is contained in:
commit
b83840c2f8
|
@ -74,7 +74,7 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
|||
option(ENABLE_COVERAGE "Enable collecting code coverage data" OFF)
|
||||
mark_as_advanced(ENABLE_COVERAGE)
|
||||
if(ENABLE_COVERAGE)
|
||||
set (CMAK_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -2,20 +2,22 @@ include(CMakeFindDependencyMacro)
|
|||
if(@BUILD_MPI@)
|
||||
find_dependency(MPI REQUIRED CXX)
|
||||
endif()
|
||||
if(@PKG_KSPACE@ AND @FFT@ STREQUAL "FFTW3")
|
||||
if(@FFTW@ STREQUAL "FFTW3" AND NOT TARGET FFTW3::FFTW3)
|
||||
add_library(FFTW3::FFTW3 UNKNOWN IMPORTED)
|
||||
set_target_properties(FFTW3::FFTW3 PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "@FFTW3_LIBRARY@"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3_INCLUDE_DIRS@")
|
||||
endif()
|
||||
if(@FFTW@ STREQUAL "FFTW3F" AND NOT TARGET FFTW3F::FFTW3F)
|
||||
add_library(FFTW3F::FFTW3F UNKNOWN IMPORTED)
|
||||
set_target_properties(FFTW3F::FFTW3F PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "@FFTW3F_LIBRARY@"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3F_INCLUDE_DIRS@")
|
||||
if(@PKG_KSPACE@)
|
||||
if(@FFT@ STREQUAL "FFTW3")
|
||||
if(@FFTW@ STREQUAL "FFTW3" AND NOT TARGET FFTW3::FFTW3)
|
||||
add_library(FFTW3::FFTW3 UNKNOWN IMPORTED)
|
||||
set_target_properties(FFTW3::FFTW3 PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "@FFTW3_LIBRARY@"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3_INCLUDE_DIRS@")
|
||||
endif()
|
||||
if(@FFTW@ STREQUAL "FFTW3F" AND NOT TARGET FFTW3F::FFTW3F)
|
||||
add_library(FFTW3F::FFTW3F UNKNOWN IMPORTED)
|
||||
set_target_properties(FFTW3F::FFTW3F PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "@FFTW3F_LIBRARY@"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3F_INCLUDE_DIRS@")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(NOT @BUILD_SHARED_LIBS@)
|
||||
|
@ -36,20 +38,22 @@ if(NOT @BUILD_SHARED_LIBS@)
|
|||
if(@PKG_USER-SMD@ AND NOT @DOWNLOAD_EIGEN3@)
|
||||
find_dependency(Eigen3 NO_MODULE REQUIRED)
|
||||
endif()
|
||||
if(@PKG_KSPACE@ AND @FFT@ STREQUAL "FFTW3" AND @FFT_FFTW_THREADS@)
|
||||
if(@FFTW@ STREQUAL "FFTW3" AND NOT TARGET FFTW3::FFTW3_OMP)
|
||||
add_library(FFTW3::FFTW3_OMP UNKNOWN IMPORTED)
|
||||
set_target_properties(FFTW3::FFTW3_OMP PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "@FFTW3_OMP_LIBRARY@"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3_OMP_INCLUDE_DIRS@")
|
||||
endif()
|
||||
if(@FFTW@ STREQUAL "FFTW3F" AND NOT TARGET FFTW3F::FFTW3F_OMP)
|
||||
add_library(FFTW3F::FFTW3F_OMP UNKNOWN IMPORTED)
|
||||
set_target_properties(FFTW3F::FFTW3F_OMP PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "@FFTW3F_OMP_LIBRARY@"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3F_OMP_INCLUDE_DIRS@")
|
||||
if(@PKG_KSPACE@)
|
||||
if(@FFT@ STREQUAL "FFTW3" AND @FFT_FFTW_THREADS@)
|
||||
if(@FFTW@ STREQUAL "FFTW3" AND NOT TARGET FFTW3::FFTW3_OMP)
|
||||
add_library(FFTW3::FFTW3_OMP UNKNOWN IMPORTED)
|
||||
set_target_properties(FFTW3::FFTW3_OMP PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "@FFTW3_OMP_LIBRARY@"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3_OMP_INCLUDE_DIRS@")
|
||||
endif()
|
||||
if(@FFTW@ STREQUAL "FFTW3F" AND NOT TARGET FFTW3F::FFTW3F_OMP)
|
||||
add_library(FFTW3F::FFTW3F_OMP UNKNOWN IMPORTED)
|
||||
set_target_properties(FFTW3F::FFTW3F_OMP PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "@FFTW3F_OMP_LIBRARY@"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3F_OMP_INCLUDE_DIRS@")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_USER-SCAFACOS@ AND NOT @DOWNLOAD_SCAFACOS@)
|
||||
|
|
|
@ -51,6 +51,9 @@ if(DOWNLOAD_KIM)
|
|||
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include/kim-api")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KIM)
|
||||
add_dependencies(LAMMPS::KIM kim_build)
|
||||
if(BUILD_LIB AND NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION})
|
||||
|
|
|
@ -35,6 +35,9 @@ if(DOWNLOAD_KOKKOS)
|
|||
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS)
|
||||
add_dependencies(LAMMPS::KOKKOS kokkos_build)
|
||||
if(BUILD_LIB AND NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
elseif(EXTERNAL_KOKKOS)
|
||||
find_package(Kokkos 3)
|
||||
if(NOT Kokkos_FOUND)
|
||||
|
|
|
@ -27,6 +27,9 @@ if(DOWNLOAD_LATTE)
|
|||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::LATTE)
|
||||
add_dependencies(LAMMPS::LATTE latte_build)
|
||||
if(BUILD_LIB AND NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(LATTE)
|
||||
if(NOT LATTE_FOUND)
|
||||
|
|
|
@ -35,6 +35,9 @@ if(DOWNLOAD_MSCG)
|
|||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::MSCG)
|
||||
add_dependencies(LAMMPS::MSCG mscg_build)
|
||||
if(BUILD_LIB AND NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(MSCG)
|
||||
if(NOT MSCG_FOUND)
|
||||
|
|
|
@ -70,6 +70,9 @@ if(DOWNLOAD_PLUMED)
|
|||
ExternalProject_get_property(plumed_build INSTALL_DIR)
|
||||
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
||||
add_dependencies(LAMMPS::PLUMED plumed_build)
|
||||
if(BUILD_LIB AND NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
if(PLUMED_MODE STREQUAL "STATIC")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_WRAPPER_CXX=1")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed.a INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")
|
||||
|
|
|
@ -52,6 +52,9 @@ if(DOWNLOAD_SCAFACOS)
|
|||
INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libfcs.a;${INSTALL_DIR}/lib/libfcs_direct.a;${INSTALL_DIR}/lib/libfcs_ewald.a;${INSTALL_DIR}/lib/libfcs_fmm.a;${INSTALL_DIR}/lib/libfcs_p2nfft.a;${INSTALL_DIR}/lib/libfcs_p3m.a;GSL::gsl;${INSTALL_DIR}/lib/libfcs_near.a;${INSTALL_DIR}/lib/libfcs_gridsort.a;${INSTALL_DIR}/lib/libfcs_resort.a;${INSTALL_DIR}/lib/libfcs_redist.a;${INSTALL_DIR}/lib/libfcs_common.a;${INSTALL_DIR}/lib/libfcs_pnfft.a;${INSTALL_DIR}/lib/libfcs_pfft.a;${INSTALL_DIR}/lib/libfcs_fftw3_mpi.a;${INSTALL_DIR}/lib/libfcs_fftw3.a;MPI::MPI_Fortran;MPI::MPI_C")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::SCAFACOS)
|
||||
add_dependencies(LAMMPS::SCAFACOS scafacos_build)
|
||||
if(BUILD_LIB AND NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SCAFACOS REQUIRED IMPORTED_TARGET scafacos)
|
||||
|
|
|
@ -18,6 +18,9 @@ if(DOWNLOAD_EIGEN3)
|
|||
set_target_properties(LAMMPS::EIGEN3 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::EIGEN3)
|
||||
add_dependencies(LAMMPS::EIGEN3 Eigen3_build)
|
||||
if(BUILD_LIB AND NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(Eigen3 NO_MODULE)
|
||||
mark_as_advanced(Eigen3_DIR)
|
||||
|
|
|
@ -35,6 +35,9 @@ if(DOWNLOAD_VORO)
|
|||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::VORO)
|
||||
add_dependencies(LAMMPS::VORO voro_build)
|
||||
if(BUILD_LIB AND NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(VORO)
|
||||
if(NOT VORO_FOUND)
|
||||
|
|
|
@ -28,7 +28,7 @@ if(ENABLE_TESTING AND BUILD_EXE)
|
|||
"https://github.com/lammps/lammps-testing in LAMMPS_TESTING_SOURCE_DIR")
|
||||
endif()
|
||||
|
||||
add_test(ShowHelp ${CMAKE_BINARY_DIR}/${LAMMPS_BINARY} -help)
|
||||
add_test(NAME ShowHelp COMMAND $<TARGET_FILE:lmp> -help)
|
||||
|
||||
if(EXISTS ${LAMMPS_TESTING_SOURCE_DIR})
|
||||
message(STATUS "Running test discovery...")
|
||||
|
@ -42,8 +42,7 @@ if(ENABLE_TESTING AND BUILD_EXE)
|
|||
string(REPLACE "-" "_" TEST_NAME ${TEST_NAME})
|
||||
string(REPLACE "+" "_" TEST_NAME ${TEST_NAME})
|
||||
set(TEST_NAME "test_core_${TEST_NAME}_serial")
|
||||
add_test(${TEST_NAME} ${CMAKE_BINARY_DIR}/${LAMMPS_BINARY} -in ${SCRIPT_NAME})
|
||||
set_tests_properties(${TEST_NAME} PROPERTIES WORKING_DIRECTORY ${PARENT_DIR})
|
||||
add_test(NAME ${TEST_NAME} COMMAND $<TARGET_FILE:lmp> -in ${SCRIPT_NAME} WORKING_DIRECTORY ${PARENT_DIR})
|
||||
endforeach()
|
||||
list(LENGTH TEST_SCRIPTS NUM_TESTS)
|
||||
|
||||
|
|
Loading…
Reference in New Issue