From e8d891c0ddb78c5be220fb9ccdcdbba1fa24509f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 26 Jul 2019 06:06:03 -0400 Subject: [PATCH 1/6] simplify installation of data folders and make it consistent fixes #1586 --- cmake/CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 0f99cc6274..7cd7b62c91 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -551,11 +551,9 @@ include(Documentation) ############################################################################### # Install potential and force field files in data directory ############################################################################### -set(LAMMPS_INSTALL_POTENTIALS_DIR ${CMAKE_INSTALL_FULL_DATADIR}/lammps/potentials) -install(DIRECTORY ${LAMMPS_POTENTIALS_DIR} DESTINATION ${LAMMPS_INSTALL_POTENTIALS_DIR}) - -set(LAMMPS_INSTALL_FRC_FILES_DIR ${CMAKE_INSTALL_FULL_DATADIR}/lammps/frc_files) -install(DIRECTORY ${LAMMPS_TOOLS_DIR}/msi2lmp/frc_files/ DESTINATION ${LAMMPS_INSTALL_FRC_FILES_DIR}) +set(LAMMPS_INSTALL_DATADIR ${CMAKE_INSTALL_FULL_DATADIR}/lammps) +install(DIRECTORY ${LAMMPS_POTENTIALS_DIR} DESTINATION ${LAMMPS_INSTALL_DATADIR}) +install(DIRECTORY ${LAMMPS_TOOLS_DIR}/msi2lmp/frc_files DESTINATION ${LAMMPS_INSTALL_DATADIR}) configure_file(etc/profile.d/lammps.sh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.sh @ONLY) configure_file(etc/profile.d/lammps.csh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.csh @ONLY) From 0bb9df76c2d132e66e79f482432ac2f33ec9781e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 26 Jul 2019 09:58:18 -0400 Subject: [PATCH 2/6] correct shell profile variables to point to the installation directory --- cmake/etc/profile.d/lammps.csh.in | 4 ++-- cmake/etc/profile.d/lammps.sh.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/etc/profile.d/lammps.csh.in b/cmake/etc/profile.d/lammps.csh.in index 42f222d67c..1c13583914 100644 --- a/cmake/etc/profile.d/lammps.csh.in +++ b/cmake/etc/profile.d/lammps.csh.in @@ -1,4 +1,4 @@ # set environment for LAMMPS and msi2lmp executables # to find potential and force field files -if ( "$?LAMMPS_POTENTIALS" == 0 ) setenv LAMMPS_POTENTIALS @LAMMPS_POTENTIALS_DIR@ -if ( "$?MSI2LMP_LIBRARY" == 0 ) setenv MSI2LMP_LIBRARY @LAMMPS_FRC_FILES_DIR@ +if ( "$?LAMMPS_POTENTIALS" == 0 ) setenv LAMMPS_POTENTIALS @LAMMPS_INSTALL_DATADIR@/potentials +if ( "$?MSI2LMP_LIBRARY" == 0 ) setenv MSI2LMP_LIBRARY @LAMMPS_INSTALL_DATADIR@/frc_files diff --git a/cmake/etc/profile.d/lammps.sh.in b/cmake/etc/profile.d/lammps.sh.in index c1967cb5b2..1542a8982f 100644 --- a/cmake/etc/profile.d/lammps.sh.in +++ b/cmake/etc/profile.d/lammps.sh.in @@ -1,5 +1,5 @@ # set environment for LAMMPS and msi2lmp executables # to find potential and force field files -LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS-@LAMMPS_POTENTIALS_DIR@} -MSI2LMP_LIBRARY=${MSI2LMP_LIBRARY-@LAMMPS_FRC_FILES_DIR@} +LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS-@LAMMPS_INSTALL_DATADIR@/potentials} +MSI2LMP_LIBRARY=${MSI2LMP_LIBRARY-@LAMMPS_INSTALL_DATADIR@/frc_files} export LAMMPS_POTENTIALS MSI2LMP_LIBRARY From 5307558727d3b7ea07a3a664aa9e550713547239 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 29 Jul 2019 13:34:04 -0400 Subject: [PATCH 3/6] need to install some base C++ headers for C++ library use --- cmake/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 7cd7b62c91..eee595df7e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -497,10 +497,44 @@ if(BUILD_LIB) if(LAMMPS_DEPS) add_dependencies(lammps ${LAMMPS_DEPS}) endif() + set(LAMMPS_CXX_HEADERS + angle.h + atom.h + bond.h + citeme.h + comm.h + compute.h + dihedral.h + domain.h + error.h + fix.h + force.h + group.h + improper.h + input.h + kspace.h + lammps.h + lattice.h + lmppython.h + memory.h + modify.h + neighbor.h + neigh_list.h + output.h + pair.h + pointers.h + region.h + timer.h + universe.h + update.h + variable.h) + list(TRANSFORM LAMMPS_CXX_HEADERS PREPEND ${LAMMPS_SOURCE_DIR}/) + set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_LIB_SUFFIX}) set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION}) install(TARGETS lammps LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES ${LAMMPS_SOURCE_DIR}/library.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps) + install(FILES ${LAMMPS_CXX_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps) configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_LIB_SUFFIX}.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_LIB_SUFFIX}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) configure_file(FindLAMMPS.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindLAMMPS${LAMMPS_LIB_SUFFIX}.cmake @ONLY) From 96e0b03ede16ae551fde9fce4c2657e9d972181f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 29 Jul 2019 13:38:38 -0400 Subject: [PATCH 4/6] .frc files only need to be installed if msi2lmp is built --- cmake/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index eee595df7e..eaa699106c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -587,7 +587,9 @@ include(Documentation) ############################################################################### set(LAMMPS_INSTALL_DATADIR ${CMAKE_INSTALL_FULL_DATADIR}/lammps) install(DIRECTORY ${LAMMPS_POTENTIALS_DIR} DESTINATION ${LAMMPS_INSTALL_DATADIR}) -install(DIRECTORY ${LAMMPS_TOOLS_DIR}/msi2lmp/frc_files DESTINATION ${LAMMPS_INSTALL_DATADIR}) +if(BUILD_TOOLS) + install(DIRECTORY ${LAMMPS_TOOLS_DIR}/msi2lmp/frc_files DESTINATION ${LAMMPS_INSTALL_DATADIR}) +endif() configure_file(etc/profile.d/lammps.sh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.sh @ONLY) configure_file(etc/profile.d/lammps.csh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.csh @ONLY) From 6a1b61637bb7eaded180ef01167c7e3295af1ce6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 29 Jul 2019 13:43:06 -0400 Subject: [PATCH 5/6] provide some more details about 'make install' with CMake --- doc/src/Build_cmake.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/src/Build_cmake.txt b/doc/src/Build_cmake.txt index a16ba995a8..8106b008bb 100644 --- a/doc/src/Build_cmake.txt +++ b/doc/src/Build_cmake.txt @@ -52,11 +52,16 @@ LAMMPS or need to re-compile LAMMPS repeatedly, installation of the ccache (= Compiler Cache) software may speed up repeated compilation even more. -After compilation, you can optionally copy the LAMMPS executable and -library into your system folders (by default under $HOME/.local) with: +After compilation, you may optionally install the LAMMPS executable into +your system with: make install # optional, copy LAMMPS executable & library elsewhere :pre +This will install the lammps executable and library (if requested), some +tools (if configured) and additional files like library API headers, manpages, +potential files. The location of the installation tree is set by the CMake +variable "CMAKE_INSTALL_PREFIX" which defaults to $\{HOME\}/.local + :line There are 3 variants of CMake: a command-line version (cmake), a text mode From e0b20c4fd404cff90e2a6335862b1dcca69e22b3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 29 Jul 2019 15:23:23 -0400 Subject: [PATCH 6/6] add false positive --- doc/src/Build_cmake.txt | 7 ++++--- doc/utils/sphinx-config/false_positives.txt | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/src/Build_cmake.txt b/doc/src/Build_cmake.txt index 8106b008bb..6eb23b2bb5 100644 --- a/doc/src/Build_cmake.txt +++ b/doc/src/Build_cmake.txt @@ -58,9 +58,10 @@ your system with: make install # optional, copy LAMMPS executable & library elsewhere :pre This will install the lammps executable and library (if requested), some -tools (if configured) and additional files like library API headers, manpages, -potential files. The location of the installation tree is set by the CMake -variable "CMAKE_INSTALL_PREFIX" which defaults to $\{HOME\}/.local +tools (if configured) and additional files like library API headers, +manpages, potential and force field files. The location of the installation +tree is set by the CMake variable "CMAKE_INSTALL_PREFIX" which defaults +to $\{HOME\}/.local :line diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index da5c869075..e6fdaf826b 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1539,6 +1539,7 @@ Mandelli Manh manifoldforce Manolopoulos +manpages manybody MANYBODY Maras