From 0588232a34db41298d7832dedc363c5201373859 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Wed, 29 Apr 2020 14:29:18 -0600 Subject: [PATCH 1/4] Fix rare issue in Kokkos neighlist --- src/KOKKOS/npair_kokkos.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/KOKKOS/npair_kokkos.cpp b/src/KOKKOS/npair_kokkos.cpp index 87d0366353..d0329eb24c 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -55,6 +55,7 @@ void NPairKokkos::copy_neighbor_info() newton_pair = force->newton_pair; k_cutneighsq = neighborKK->k_cutneighsq; + k_cutneighsq.modify(); // exclusion info From 18c63ade926854de690fd6718faaef88417c3aa3 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 29 Apr 2020 16:14:52 -0600 Subject: [PATCH 2/4] clarified AMD quote from review paper --- doc/src/hyper.rst | 24 +++++++++++------------- doc/src/prd.rst | 23 ++++++++++------------- doc/src/tad.rst | 29 ++++++++++++++++------------- 3 files changed, 37 insertions(+), 39 deletions(-) diff --git a/doc/src/hyper.rst b/doc/src/hyper.rst index d17af1d407..5b2c931b1f 100644 --- a/doc/src/hyper.rst +++ b/doc/src/hyper.rst @@ -51,19 +51,17 @@ each timestep. In the bond-boost hyperdynamics context, a "bond" is not a covalent bond between a pair of atoms in a molecule. Rather it is simply a pair of nearby atoms as discussed below. -Both global and local HD are described in :ref:`(Voter2013) ` by -Art Voter and collaborators. Similar to parallel replica dynamics -(PRD), global and local HD are methods for performing accelerated -dynamics that are suitable for infrequent-event systems that obey -first-order kinetics. A good overview of accelerated dynamics methods -for such systems in given in :ref:`(Voter2002) ` from the same -group. To quote from the review paper: "The dynamical evolution is -characterized by vibrational excursions within a potential basin, -punctuated by occasional transitions between basins." The transition -probability is characterized by p(t) = k\*exp(-kt) where k is the rate -constant. Running multiple replicas gives an effective enhancement in -the timescale spanned by the multiple simulations, while waiting for -an event to occur. +Both global and local HD are described in :ref:`(Voter2013) +` by Art Voter and collaborators. Similar to parallel +replica dynamics (PRD), global and local HD are methods for performing +accelerated dynamics that are suitable for infrequent-event systems +that obey first-order kinetics. A good overview of accelerated +dynamics methods (AMD) for such systems in given in :ref:`(Voter2002) +` from the same group. To quote from the review paper: +"The dynamical evolution is characterized by vibrational excursions +within a potential basin, punctuated by occasional transitions between +basins. The transition probability is characterized by p(t) = +k\*exp(-kt) where k is the rate constant." Both HD and PRD produce a time-accurate trajectory that effectively extends the timescale over which a system can be simulated, but they diff --git a/doc/src/prd.rst b/doc/src/prd.rst index c3bd1ad1d3..d1acaf645e 100644 --- a/doc/src/prd.rst +++ b/doc/src/prd.rst @@ -52,19 +52,16 @@ replicas of a system. One or more replicas can be used. The total number of steps *N* to run can be interpreted in one of two ways; see discussion of the *time* keyword below. -PRD is described in :ref:`(Voter1998) ` by Art Voter. Similar to -global or local hyperdynamics (HD), PRD is a method for performing -accelerated dynamics that is suitable for infrequent-event systems -that obey first-order kinetics. A good overview of accelerated -dynamics methods for such systems in given in this review paper -:ref:`(Voter2002) ` from Art's group. To quote from the -paper: "The dynamical evolution is characterized by vibrational -excursions within a potential basin, punctuated by occasional -transitions between basins." The transition probability is -characterized by p(t) = k\*exp(-kt) where k is the rate constant. -Running multiple replicas gives an effective enhancement in the -timescale spanned by the multiple simulations, while waiting for an -event to occur. +PRD is described in :ref:`(Voter1998) ` by Art Voter. +Similar to global or local hyperdynamics (HD), PRD is a method for +performing accelerated dynamics that is suitable for infrequent-event +systems that obey first-order kinetics. A good overview of +accelerated dynamics methods (AMD) for such systems in given in this +review paper :ref:`(Voter2002) ` from Art's group. To +quote from the paper: "The dynamical evolution is characterized by +vibrational excursions within a potential basin, punctuated by +occasional transitions between basins. The transition probability is +characterized by p(t) = k\*exp(-kt) where k is the rate constant." Both PRD and HD produce a time-accurate trajectory that effectively extends the timescale over which a system can be simulated, but they diff --git a/doc/src/tad.rst b/doc/src/tad.rst index 7f4845dc3c..c3cd3b825b 100644 --- a/doc/src/tad.rst +++ b/doc/src/tad.rst @@ -58,18 +58,21 @@ Run a temperature accelerated dynamics (TAD) simulation. This method requires two or more partitions to perform NEB transition state searches. -TAD is described in :ref:`this paper ` by Art Voter. It is a method -that uses accelerated dynamics at an elevated temperature to generate -results at a specified lower temperature. A good overview of -accelerated dynamics methods for such systems is given in :ref:`this review paper ` from the same group. In general, these methods assume -that the long-time dynamics is dominated by infrequent events i.e. the -system is confined to low energy basins for long periods, -punctuated by brief, randomly-occurring transitions to adjacent -basins. TAD is suitable for infrequent-event systems, where in +TAD is described in :ref:`this paper ` by Art Voter. It is +a method that uses accelerated dynamics at an elevated temperature to +generate results at a specified lower temperature. A good overview of +accelerated dynamics methods (AMD) for such systems is given in +:ref:`this review paper ` from the same group. To quote +from the review paper: "The dynamical evolution is characterized by +vibrational excursions within a potential basin, punctuated by +occasional transitions between basins. The transition probability is +characterized by p(t) = k\*exp(-kt) where k is the rate constant." + +TAD is a suitable AMD method for infrequent-event systems, where in addition, the transition kinetics are well-approximated by harmonic -transition state theory (hTST). In hTST, the temperature dependence of -transition rates follows the Arrhenius relation. As a consequence a -set of event times generated in a high-temperature simulation can be +transition state theory (hTST). In hTST, the temperature dependence +of transition rates follows the Arrhenius relation. As a consequence +a set of event times generated in a high-temperature simulation can be mapped to a set of much longer estimated times in the low-temperature system. However, because this mapping involves the energy barrier of the transition event, which is different for each event, the first @@ -79,8 +82,8 @@ events from the current basin. After each event, the simulation is reflected backwards into the current basin. This is repeated until the stopping criterion is satisfied, at which point the event with the earliest low-temperature occurrence time is selected. The stopping -criterion is that the confidence measure be greater than -1-\ *delta*\ . The confidence measure is the probability that no earlier +criterion is that the confidence measure be greater than 1-\ *delta*\ +. The confidence measure is the probability that no earlier low-temperature event will occur at some later time in the high-temperature simulation. hTST provides an lower bound for this probability, based on the user-specified minimum pre-exponential From 600d357155823e49e278085ccda0272297722eed Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Wed, 29 Apr 2020 16:26:56 -0600 Subject: [PATCH 3/4] cmake: disable installing of static libs --- cmake/CMakeLists.txt | 3 ++ cmake/LAMMPSConfig.cmake.in | 78 +------------------------------------ 2 files changed, 4 insertions(+), 77 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index d9c82678eb..514bafe164 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -521,6 +521,9 @@ endif() set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE}) set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION}) install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(NOT BUILD_SHARED_LIBS) + install(CODE "MESSAGE(FATAL_ERROR \"Installing of statici liblammps is currently not supported! Build a shared library with BUILD_SHARED_LIBS=ON\")") +endif() target_include_directories(lammps PUBLIC $) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps) foreach(_HEADER ${LAMMPS_CXX_HEADERS}) diff --git a/cmake/LAMMPSConfig.cmake.in b/cmake/LAMMPSConfig.cmake.in index 7cd782b3b8..48c262c664 100644 --- a/cmake/LAMMPSConfig.cmake.in +++ b/cmake/LAMMPSConfig.cmake.in @@ -1,4 +1,4 @@ -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) include(CMakeFindDependencyMacro) if(@BUILD_MPI@) find_dependency(MPI REQUIRED CXX) @@ -8,80 +8,4 @@ if(@PKG_KSPACE@) find_dependency(@FFTW@ REQUIRED MODULE) endif() endif() -if(NOT @BUILD_SHARED_LIBS@) - if(@BUILD_OMP@) - find_dependency(OpenMP REQUIRED) - endif() - if(@WITH_JPEG@) - find_dependency(JPEG REQUIRED) - endif() - if(@WITH_PNG@) - find_dependency(PNG REQUIRED) - find_dependency(ZLIB REQUIRED) - endif() - if(@PKG_KIM@) - find_dependency(PkgConfig REQUIRED) - pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=@KIM-API_MIN_VERSION@) - if(@CURL_FOUND@) - find_dependency(CURL REQUIRED) - endif() - endif() - if(@PKG_USER-SMD@) - find_dependency(Eigen3 NO_MODULE REQUIRED) - endif() - if(@PKG_USER-SCAFACOS@) - find_dependency(PkgConfig REQUIRED) - find_ependency(GSL REQUIRED) - find_dependency(MPI REQUIRED C Fortran) - pkg_check_modules(SCAFACOS REQUIRED IMPORTED_TARGET scafacos) - endif() - if(@PKG_PYTHON@ AND NOT CMAKE_VERSION VERSION_LESS 3.12) - find_package(Python REQUIRED COMPONENTS Development) - endif() - if(@PKG_COMPRESS@) - find_dependency(ZLIB REQUIRED) - endif() - if(@PKG_KOKKOS@) - if(@EXTERNAL_KOKKOS@) - find_dependency(Kokkos 3 REQUIRED) - endif() - endif() - if(@PKG_VORONOI@) - find_dependency(VORO REQUIRED) - endif() - if(@PKG_USER-INTEL@) - if(@INTEL_LRT_MODE@ STREQUAL "THREADS") - find_dependency(Threads REQUIRED) - endif() - if(@TBB_MALLOC_FOUND@) - find_ependency(TBB_MALLOC REQUIRED) - endif() - endif() - if(@PKG_USER-ADIOS@) - find_ependency(ADIOS2 REQUIRED) - endif() - if(@PKG_LATTE@) - find_ependency(LATTE REQUIRED) - endif() - if(@PKG_MESSAGE@) - if(@MESSAGE_ZMQ@) - find_ependency(ZMQ REQUIRED) - endif() - endif() - if(@PKG_MSCG@) - find_ependency(GSL REQUIRED) - find_ependency(MSCG REQUIRED) - endif() - if(@USER-NETCDF@) - if(@NETCDF_FOUND@) - find_ependency(NetCDF REQUIRED) - endif() - if(@PNETCDF_FOUND@) - find_ependency(PNetCDF REQUIRED) - endif() - endif() - if(@PKG_QUIP@) - find_ependency(QUIP REQUIRED) - endif() -endif() include("${CMAKE_CURRENT_LIST_DIR}/LAMMPS_Targets.cmake") From 1adda0320282bc037a96366ee335eef5a4925f72 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Wed, 29 Apr 2020 18:06:33 -0600 Subject: [PATCH 4/4] cmake: only install shared lib and friends --- cmake/CMakeLists.txt | 38 +++++++++------------- cmake/Modules/Packages/GPU.cmake | 3 -- cmake/Modules/Packages/KIM.cmake | 3 -- cmake/Modules/Packages/KOKKOS.cmake | 3 -- cmake/Modules/Packages/LATTE.cmake | 3 -- cmake/Modules/Packages/MESSAGE.cmake | 3 -- cmake/Modules/Packages/MSCG.cmake | 3 -- cmake/Modules/Packages/USER-COLVARS.cmake | 6 ---- cmake/Modules/Packages/USER-MOLFILE.cmake | 3 -- cmake/Modules/Packages/USER-PLUMED.cmake | 3 -- cmake/Modules/Packages/USER-QMMM.cmake | 6 ---- cmake/Modules/Packages/USER-SCAFACOS.cmake | 3 -- cmake/Modules/Packages/USER-SMD.cmake | 3 -- cmake/Modules/Packages/VORONOI.cmake | 3 -- 14 files changed, 15 insertions(+), 68 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 514bafe164..71e3967186 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -160,9 +160,6 @@ else() enable_language(C) file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.c) add_library(mpi_stubs STATIC ${MPI_SOURCES}) - if(NOT BUILD_SHARED_LIBS) - install(TARGETS mpi_stubs EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE}) target_include_directories(mpi_stubs PUBLIC $ $) install(FILES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps/mpi) @@ -249,9 +246,6 @@ if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE) enable_language(Fortran) file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF]) add_library(linalg STATIC ${LAPACK_SOURCES}) - if(NOT BUILD_SHARED_LIBS) - install(TARGETS linalg EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_MACHINE}) set(BLAS_LIBRARIES "$") set(LAPACK_LIBRARIES "$") @@ -411,9 +405,6 @@ foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD) ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp) add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES}) - if(NOT BUILD_SHARED_LIBS) - install(TARGETS ${PKG_LIB} EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() set_target_properties(${PKG_LIB} PROPERTIES OUTPUT_NAME lammps_${PKG_LIB}${LAMMPS_MACHINE}) target_link_libraries(lammps PRIVATE ${PKG_LIB}) if(PKG_LIB STREQUAL awpmd) @@ -520,17 +511,15 @@ endif() set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE}) set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION}) -install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -if(NOT BUILD_SHARED_LIBS) - install(CODE "MESSAGE(FATAL_ERROR \"Installing of statici liblammps is currently not supported! Build a shared library with BUILD_SHARED_LIBS=ON\")") -endif() target_include_directories(lammps PUBLIC $) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps) foreach(_HEADER ${LAMMPS_CXX_HEADERS}) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/${_HEADER}) add_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER}) add_dependencies(lammps ${_HEADER}) - install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps) + if(BUILD_SHARED_LIBS) + install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps) + endif() endforeach() target_include_directories(lammps INTERFACE $) add_library(LAMMPS::lammps ALIAS lammps) @@ -539,15 +528,18 @@ set(LAMMPS_API_DEFINES) foreach(_DEF ${LAMMPS_DEFINES}) set(LAMMPS_API_DEFINES "${LAMMPS_API_DEFINES} -D${_DEF}") endforeach() -configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) -file(GLOB MODULE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Modules/Find*.cmake) -install(FILES ${MODULE_FILES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) -include(CMakePackageConfigHelpers) -configure_file(LAMMPSConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake @ONLY) -write_basic_package_version_file("LAMMPSConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) +if(BUILD_SHARED_LIBS) + install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) + file(GLOB MODULE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Modules/Find*.cmake) + install(FILES ${MODULE_FILES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) + include(CMakePackageConfigHelpers) + configure_file(LAMMPSConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake @ONLY) + write_basic_package_version_file("LAMMPSConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) +endif() install(FILES ${LAMMPS_DOC_DIR}/lammps.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME ${LAMMPS_BINARY}.1) if(BUILD_TOOLS) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 9299914b9b..5033c1f0f1 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -365,9 +365,6 @@ if(NOT BUILD_MPI) else() target_link_libraries(gpu PRIVATE MPI::MPI_CXX) endif() -if(NOT BUILD_SHARED_LIBS) - install(TARGETS gpu EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -endif() target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES}) set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE}) target_sources(lammps PRIVATE ${GPU_SOURCES}) diff --git a/cmake/Modules/Packages/KIM.cmake b/cmake/Modules/Packages/KIM.cmake index 278a6b5afc..d74b82b036 100644 --- a/cmake/Modules/Packages/KIM.cmake +++ b/cmake/Modules/Packages/KIM.cmake @@ -56,9 +56,6 @@ 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(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}) diff --git a/cmake/Modules/Packages/KOKKOS.cmake b/cmake/Modules/Packages/KOKKOS.cmake index eb549519d1..df100f63f8 100644 --- a/cmake/Modules/Packages/KOKKOS.cmake +++ b/cmake/Modules/Packages/KOKKOS.cmake @@ -49,9 +49,6 @@ if(DOWNLOAD_KOKKOS) INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}) target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS) add_dependencies(LAMMPS::KOKKOS kokkos_build) - if(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.1) if(NOT Kokkos_FOUND) diff --git a/cmake/Modules/Packages/LATTE.cmake b/cmake/Modules/Packages/LATTE.cmake index a2a94755ab..ce46569a3f 100644 --- a/cmake/Modules/Packages/LATTE.cmake +++ b/cmake/Modules/Packages/LATTE.cmake @@ -34,9 +34,6 @@ if(DOWNLOAD_LATTE) INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}") target_link_libraries(lammps PRIVATE LAMMPS::LATTE) add_dependencies(LAMMPS::LATTE latte_build) - if(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) diff --git a/cmake/Modules/Packages/MESSAGE.cmake b/cmake/Modules/Packages/MESSAGE.cmake index e1dc4c1072..fb62763828 100644 --- a/cmake/Modules/Packages/MESSAGE.cmake +++ b/cmake/Modules/Packages/MESSAGE.cmake @@ -7,9 +7,6 @@ file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp) add_library(cslib STATIC ${cslib_SOURCES}) -if(NOT BUILD_SHARED_LIBS) - install(TARGETS cslib EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -endif() target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES}) set_target_properties(cslib PROPERTIES OUTPUT_NAME lammps_cslib${LAMMPS_MACHINE}) if(BUILD_MPI) diff --git a/cmake/Modules/Packages/MSCG.cmake b/cmake/Modules/Packages/MSCG.cmake index 668d318d68..55f71588fe 100644 --- a/cmake/Modules/Packages/MSCG.cmake +++ b/cmake/Modules/Packages/MSCG.cmake @@ -35,9 +35,6 @@ if(DOWNLOAD_MSCG) INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}") target_link_libraries(lammps PRIVATE LAMMPS::MSCG) add_dependencies(LAMMPS::MSCG mscg_build) - if(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) diff --git a/cmake/Modules/Packages/USER-COLVARS.cmake b/cmake/Modules/Packages/USER-COLVARS.cmake index 31e64e3790..92595a9c8a 100644 --- a/cmake/Modules/Packages/USER-COLVARS.cmake +++ b/cmake/Modules/Packages/USER-COLVARS.cmake @@ -9,9 +9,6 @@ if(COLVARS_LEPTON) set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton) file(GLOB LEPTON_SOURCES ${LEPTON_DIR}/src/[^.]*.cpp) add_library(lepton STATIC ${LEPTON_SOURCES}) - if(NOT BUILD_SHARED_LIBS) - install(TARGETS lepton EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() # Change the define below to LEPTON_BUILDING_SHARED_LIBRARY when linking Lepton as a DLL with MSVC target_compile_definitions(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY) set_target_properties(lepton PROPERTIES OUTPUT_NAME lammps_lepton${LAMMPS_MACHINE}) @@ -19,9 +16,6 @@ if(COLVARS_LEPTON) endif() add_library(colvars STATIC ${COLVARS_SOURCES}) -if(NOT BUILD_SHARED_LIBS) - install(TARGETS colvars EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -endif() target_compile_definitions(colvars PRIVATE -DLAMMPS_${LAMMPS_SIZES}) set_target_properties(colvars PROPERTIES OUTPUT_NAME lammps_colvars${LAMMPS_MACHINE}) target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars) diff --git a/cmake/Modules/Packages/USER-MOLFILE.cmake b/cmake/Modules/Packages/USER-MOLFILE.cmake index dd6435e56b..1a2df2202b 100644 --- a/cmake/Modules/Packages/USER-MOLFILE.cmake +++ b/cmake/Modules/Packages/USER-MOLFILE.cmake @@ -1,8 +1,5 @@ set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers") add_library(molfile INTERFACE) -if(NOT BUILD_SHARED_LIBS) - install(TARGETS molfile EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -endif() target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS}) # no need to link with -ldl on windows if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") diff --git a/cmake/Modules/Packages/USER-PLUMED.cmake b/cmake/Modules/Packages/USER-PLUMED.cmake index 102ce7a7ad..39148bdf3d 100644 --- a/cmake/Modules/Packages/USER-PLUMED.cmake +++ b/cmake/Modules/Packages/USER-PLUMED.cmake @@ -70,9 +70,6 @@ if(DOWNLOAD_PLUMED) ExternalProject_get_property(plumed_build INSTALL_DIR) add_library(LAMMPS::PLUMED UNKNOWN IMPORTED) add_dependencies(LAMMPS::PLUMED plumed_build) - if(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 IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed.a INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}") elseif(PLUMED_MODE STREQUAL "SHARED") diff --git a/cmake/Modules/Packages/USER-QMMM.cmake b/cmake/Modules/Packages/USER-QMMM.cmake index 76bb76fa5a..c613067349 100644 --- a/cmake/Modules/Packages/USER-QMMM.cmake +++ b/cmake/Modules/Packages/USER-QMMM.cmake @@ -1,12 +1,6 @@ enable_language(C) -if(NOT BUILD_SHARED_LIBS) - message(WARNING "It is recommended to use BUILD_SHARED_LIBS=yes with USER-QMMM") -endif() add_library(qmmm STATIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm/libqmmm.c) -if(NOT BUILD_SHARED_LIBS) - install(TARGETS qmmm EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -endif() set_target_properties(qmmm PROPERTIES OUTPUT_NAME lammps_qmmm${LAMMPS_MACHINE}) target_link_libraries(lammps PRIVATE qmmm) target_include_directories(qmmm PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm) diff --git a/cmake/Modules/Packages/USER-SCAFACOS.cmake b/cmake/Modules/Packages/USER-SCAFACOS.cmake index ee12e754e6..d92a83f7c1 100644 --- a/cmake/Modules/Packages/USER-SCAFACOS.cmake +++ b/cmake/Modules/Packages/USER-SCAFACOS.cmake @@ -52,9 +52,6 @@ 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(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) diff --git a/cmake/Modules/Packages/USER-SMD.cmake b/cmake/Modules/Packages/USER-SMD.cmake index 0a5165471c..6984b24d52 100644 --- a/cmake/Modules/Packages/USER-SMD.cmake +++ b/cmake/Modules/Packages/USER-SMD.cmake @@ -18,9 +18,6 @@ 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(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) diff --git a/cmake/Modules/Packages/VORONOI.cmake b/cmake/Modules/Packages/VORONOI.cmake index 4635466a50..39d494928b 100644 --- a/cmake/Modules/Packages/VORONOI.cmake +++ b/cmake/Modules/Packages/VORONOI.cmake @@ -35,9 +35,6 @@ if(DOWNLOAD_VORO) INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src") target_link_libraries(lammps PRIVATE LAMMPS::VORO) add_dependencies(LAMMPS::VORO voro_build) - if(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)