Merge remote-tracking branch 'github/junghans-CMake-typo' into correct-kokkos-docs

This commit is contained in:
Axel Kohlmeyer 2020-04-10 22:29:19 -04:00
commit b83840c2f8
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
11 changed files with 59 additions and 32 deletions

View File

@ -74,7 +74,7 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
option(ENABLE_COVERAGE "Enable collecting code coverage data" OFF) option(ENABLE_COVERAGE "Enable collecting code coverage data" OFF)
mark_as_advanced(ENABLE_COVERAGE) mark_as_advanced(ENABLE_COVERAGE)
if(ENABLE_COVERAGE) if(ENABLE_COVERAGE)
set (CMAK_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
endif() endif()
endif() endif()

View File

@ -2,20 +2,22 @@ include(CMakeFindDependencyMacro)
if(@BUILD_MPI@) if(@BUILD_MPI@)
find_dependency(MPI REQUIRED CXX) find_dependency(MPI REQUIRED CXX)
endif() endif()
if(@PKG_KSPACE@ AND @FFT@ STREQUAL "FFTW3") if(@PKG_KSPACE@)
if(@FFTW@ STREQUAL "FFTW3" AND NOT TARGET FFTW3::FFTW3) if(@FFT@ STREQUAL "FFTW3")
add_library(FFTW3::FFTW3 UNKNOWN IMPORTED) if(@FFTW@ STREQUAL "FFTW3" AND NOT TARGET FFTW3::FFTW3)
set_target_properties(FFTW3::FFTW3 PROPERTIES add_library(FFTW3::FFTW3 UNKNOWN IMPORTED)
IMPORTED_LINK_INTERFACE_LANGUAGES "C" set_target_properties(FFTW3::FFTW3 PROPERTIES
IMPORTED_LOCATION "@FFTW3_LIBRARY@" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3_INCLUDE_DIRS@") IMPORTED_LOCATION "@FFTW3_LIBRARY@"
endif() INTERFACE_INCLUDE_DIRECTORIES "@FFTW3_INCLUDE_DIRS@")
if(@FFTW@ STREQUAL "FFTW3F" AND NOT TARGET FFTW3F::FFTW3F) endif()
add_library(FFTW3F::FFTW3F UNKNOWN IMPORTED) if(@FFTW@ STREQUAL "FFTW3F" AND NOT TARGET FFTW3F::FFTW3F)
set_target_properties(FFTW3F::FFTW3F PROPERTIES add_library(FFTW3F::FFTW3F UNKNOWN IMPORTED)
IMPORTED_LINK_INTERFACE_LANGUAGES "C" set_target_properties(FFTW3F::FFTW3F PROPERTIES
IMPORTED_LOCATION "@FFTW3F_LIBRARY@" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3F_INCLUDE_DIRS@") IMPORTED_LOCATION "@FFTW3F_LIBRARY@"
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3F_INCLUDE_DIRS@")
endif()
endif() endif()
endif() endif()
if(NOT @BUILD_SHARED_LIBS@) if(NOT @BUILD_SHARED_LIBS@)
@ -36,20 +38,22 @@ if(NOT @BUILD_SHARED_LIBS@)
if(@PKG_USER-SMD@ AND NOT @DOWNLOAD_EIGEN3@) if(@PKG_USER-SMD@ AND NOT @DOWNLOAD_EIGEN3@)
find_dependency(Eigen3 NO_MODULE REQUIRED) find_dependency(Eigen3 NO_MODULE REQUIRED)
endif() endif()
if(@PKG_KSPACE@ AND @FFT@ STREQUAL "FFTW3" AND @FFT_FFTW_THREADS@) if(@PKG_KSPACE@)
if(@FFTW@ STREQUAL "FFTW3" AND NOT TARGET FFTW3::FFTW3_OMP) if(@FFT@ STREQUAL "FFTW3" AND @FFT_FFTW_THREADS@)
add_library(FFTW3::FFTW3_OMP UNKNOWN IMPORTED) if(@FFTW@ STREQUAL "FFTW3" AND NOT TARGET FFTW3::FFTW3_OMP)
set_target_properties(FFTW3::FFTW3_OMP PROPERTIES add_library(FFTW3::FFTW3_OMP UNKNOWN IMPORTED)
IMPORTED_LINK_INTERFACE_LANGUAGES "C" set_target_properties(FFTW3::FFTW3_OMP PROPERTIES
IMPORTED_LOCATION "@FFTW3_OMP_LIBRARY@" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3_OMP_INCLUDE_DIRS@") IMPORTED_LOCATION "@FFTW3_OMP_LIBRARY@"
endif() INTERFACE_INCLUDE_DIRECTORIES "@FFTW3_OMP_INCLUDE_DIRS@")
if(@FFTW@ STREQUAL "FFTW3F" AND NOT TARGET FFTW3F::FFTW3F_OMP) endif()
add_library(FFTW3F::FFTW3F_OMP UNKNOWN IMPORTED) if(@FFTW@ STREQUAL "FFTW3F" AND NOT TARGET FFTW3F::FFTW3F_OMP)
set_target_properties(FFTW3F::FFTW3F_OMP PROPERTIES add_library(FFTW3F::FFTW3F_OMP UNKNOWN IMPORTED)
IMPORTED_LINK_INTERFACE_LANGUAGES "C" set_target_properties(FFTW3F::FFTW3F_OMP PROPERTIES
IMPORTED_LOCATION "@FFTW3F_OMP_LIBRARY@" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3F_OMP_INCLUDE_DIRS@") IMPORTED_LOCATION "@FFTW3F_OMP_LIBRARY@"
INTERFACE_INCLUDE_DIRECTORIES "@FFTW3F_OMP_INCLUDE_DIRS@")
endif()
endif() endif()
endif() endif()
if(@PKG_USER-SCAFACOS@ AND NOT @DOWNLOAD_SCAFACOS@) if(@PKG_USER-SCAFACOS@ AND NOT @DOWNLOAD_SCAFACOS@)

View File

@ -51,6 +51,9 @@ if(DOWNLOAD_KIM)
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include/kim-api") INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include/kim-api")
target_link_libraries(lammps PRIVATE LAMMPS::KIM) target_link_libraries(lammps PRIVATE LAMMPS::KIM)
add_dependencies(LAMMPS::KIM kim_build) 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() else()
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION}) pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION})

View File

@ -35,6 +35,9 @@ if(DOWNLOAD_KOKKOS)
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}) INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS) target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS)
add_dependencies(LAMMPS::KOKKOS kokkos_build) 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) elseif(EXTERNAL_KOKKOS)
find_package(Kokkos 3) find_package(Kokkos 3)
if(NOT Kokkos_FOUND) if(NOT Kokkos_FOUND)

View File

@ -27,6 +27,9 @@ if(DOWNLOAD_LATTE)
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}") INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
target_link_libraries(lammps PRIVATE LAMMPS::LATTE) target_link_libraries(lammps PRIVATE LAMMPS::LATTE)
add_dependencies(LAMMPS::LATTE latte_build) 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() else()
find_package(LATTE) find_package(LATTE)
if(NOT LATTE_FOUND) if(NOT LATTE_FOUND)

View File

@ -35,6 +35,9 @@ if(DOWNLOAD_MSCG)
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}") INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
target_link_libraries(lammps PRIVATE LAMMPS::MSCG) target_link_libraries(lammps PRIVATE LAMMPS::MSCG)
add_dependencies(LAMMPS::MSCG mscg_build) 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() else()
find_package(MSCG) find_package(MSCG)
if(NOT MSCG_FOUND) if(NOT MSCG_FOUND)

View File

@ -70,6 +70,9 @@ if(DOWNLOAD_PLUMED)
ExternalProject_get_property(plumed_build INSTALL_DIR) ExternalProject_get_property(plumed_build INSTALL_DIR)
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED) add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
add_dependencies(LAMMPS::PLUMED plumed_build) 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") if(PLUMED_MODE STREQUAL "STATIC")
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_WRAPPER_CXX=1") 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}") set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed.a INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")

View File

@ -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") 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) target_link_libraries(lammps PRIVATE LAMMPS::SCAFACOS)
add_dependencies(LAMMPS::SCAFACOS scafacos_build) 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() else()
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
pkg_check_modules(SCAFACOS REQUIRED IMPORTED_TARGET scafacos) pkg_check_modules(SCAFACOS REQUIRED IMPORTED_TARGET scafacos)

View File

@ -18,6 +18,9 @@ if(DOWNLOAD_EIGEN3)
set_target_properties(LAMMPS::EIGEN3 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}") set_target_properties(LAMMPS::EIGEN3 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}")
target_link_libraries(lammps PRIVATE LAMMPS::EIGEN3) target_link_libraries(lammps PRIVATE LAMMPS::EIGEN3)
add_dependencies(LAMMPS::EIGEN3 Eigen3_build) 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() else()
find_package(Eigen3 NO_MODULE) find_package(Eigen3 NO_MODULE)
mark_as_advanced(Eigen3_DIR) mark_as_advanced(Eigen3_DIR)

View File

@ -35,6 +35,9 @@ if(DOWNLOAD_VORO)
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src") INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src")
target_link_libraries(lammps PRIVATE LAMMPS::VORO) target_link_libraries(lammps PRIVATE LAMMPS::VORO)
add_dependencies(LAMMPS::VORO voro_build) 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() else()
find_package(VORO) find_package(VORO)
if(NOT VORO_FOUND) if(NOT VORO_FOUND)

View File

@ -28,7 +28,7 @@ if(ENABLE_TESTING AND BUILD_EXE)
"https://github.com/lammps/lammps-testing in LAMMPS_TESTING_SOURCE_DIR") "https://github.com/lammps/lammps-testing in LAMMPS_TESTING_SOURCE_DIR")
endif() 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}) if(EXISTS ${LAMMPS_TESTING_SOURCE_DIR})
message(STATUS "Running test discovery...") 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})
string(REPLACE "+" "_" TEST_NAME ${TEST_NAME}) string(REPLACE "+" "_" TEST_NAME ${TEST_NAME})
set(TEST_NAME "test_core_${TEST_NAME}_serial") set(TEST_NAME "test_core_${TEST_NAME}_serial")
add_test(${TEST_NAME} ${CMAKE_BINARY_DIR}/${LAMMPS_BINARY} -in ${SCRIPT_NAME}) add_test(NAME ${TEST_NAME} COMMAND $<TARGET_FILE:lmp> -in ${SCRIPT_NAME} WORKING_DIRECTORY ${PARENT_DIR})
set_tests_properties(${TEST_NAME} PROPERTIES WORKING_DIRECTORY ${PARENT_DIR})
endforeach() endforeach()
list(LENGTH TEST_SCRIPTS NUM_TESTS) list(LENGTH TEST_SCRIPTS NUM_TESTS)