Commit e0955f64 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

Merge branch 'master' into sdpd to resolve merge conflicts

# Conflicts:
#	cmake/CMakeLists.txt
#	src/Makefile
parents bbb37113 3681bc85
Loading
Loading
Loading
Loading
+31 −3
Original line number Diff line number Diff line
@@ -171,8 +171,9 @@ set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE GRANULAR
  USER-BOCS USER-CGDNA USER-MESO USER-CGSDK USER-COLVARS USER-DIFFRACTION
  USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB USER-MANIFOLD
  USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF
  USER-PHONON USER-PTM USER-QTB USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD
  USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM)
  USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REAXC USER-SCAFACOS
  USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK
  USER-QUIP USER-QMMM)
set(ACCEL_PACKAGES USER-OMP KOKKOS OPT USER-INTEL GPU)
set(OTHER_PACKAGES CORESHELL QEQ)
foreach(PKG ${DEFAULT_PACKAGES})
@@ -193,6 +194,8 @@ if(PKG_MEAM OR PKG_USER-H5MD OR PKG_USER-QMMM OR PKG_USER-SCAFACOS)
  enable_language(C)
endif()

include_directories(${LAMMPS_SOURCE_DIR})

# do MPI detection after language activation, if MPI for these language is required
find_package(MPI QUIET)
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
@@ -526,6 +529,32 @@ if(PKG_USER-SCAFACOS)
  include_directories(${SCAFACOS_INCLUDE_DIRS})
endif()

if(PKG_USER-PLUMED)
  find_package(GSL REQUIRED)
  option(DOWNLOAD_PLUMED "Download Plumed (instead of using the system's one)" OFF)
  if(DOWNLOAD_PLUMED)
    include(ExternalProject)
    ExternalProject_Add(plumed_build
      URL https://github.com/plumed/plumed2/releases/download/v2.4.3/plumed-src-2.4.3.tgz 
      URL_MD5 b1be7c48971627febc11c61b70767fc5
      BUILD_IN_SOURCE 1
      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> 
                                               $<$<BOOL:${BUILD_SHARED_LIBS}>:--with-pic>                                                  )
    ExternalProject_get_property(plumed_build INSTALL_DIR)
    set(PLUMED_INSTALL_DIR ${INSTALL_DIR})
    list(APPEND LAMMPS_DEPS plumed_build)
    list(APPEND LAMMPS_LINK_LIBS ${PLUMED_INSTALL_DIR}/lib/plumed/obj/kernel.o
      ${PLUMED_INSTALL_DIR}/lib/plumed/obj/PlumedStatic.o ${GSL_LIBRARIES} ${CMAKE_DL_LIBS})
    set(PLUMED_INCLUDE_DIRS "${PLUMED_INSTALL_DIR}/include")
  else()
    find_package(PkgConfig REQUIRED)
    pkg_check_modules(PLUMED plumed REQUIRED)
    include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.static)
    list(APPEND LAMMPS_LINK_LIBS ${PLUMED_LOAD})
  endif()
  include_directories(${PLUMED_INCLUDE_DIRS})
endif()

if(PKG_USER-MOLFILE)
  add_library(molfile INTERFACE)
  target_include_directories(molfile INTERFACE ${LAMMPS_LIB_SOURCE_DIR}/molfile)
@@ -1180,7 +1209,6 @@ set(LAMMPS_STYLE_HEADERS_DIR ${CMAKE_CURRENT_BINARY_DIR}/styles)

GenerateStyleHeaders(${LAMMPS_STYLE_HEADERS_DIR})

include_directories(${LAMMPS_SOURCE_DIR})
include_directories(${LAMMPS_STYLE_HEADERS_DIR})

######################################
+22 −2
Original line number Diff line number Diff line
# pkg-config file for lammps
# https://people.freedesktop.org/~dbn/pkg-config-guide.html
# Usage: cc `pkg-config --cflags --libs liblammps` -o myapp myapp.c
# after you added @CMAKE_INSTALL_FULL_LIBDIR@/pkg-config to PKG_CONFIG_PATH,

# Add the directory where lammps.pc got installed to your PKG_CONFIG_PATH
# e.g. export PKG_CONFIG_PATH=@CMAKE_INSTALL_FULL_LIBDIR@/pkgconfig

# Use this on commandline with:
# c++ `pkg-config --cflags --libs lammps` -o myapp myapp.cpp

# Use this in a Makefile:
# myapp: myapp.cpp
# 	$(CC) `pkg-config --cflags --libs lammps` -o $@ $<

# Use this in autotools:
# configure.ac:
# PKG_CHECK_MODULES([LAMMPS], [lammps])
# Makefile.am:
# myapp_CFLAGS = $(LAMMPS_CFLAGS)
# myapp_LDADD = $(LAMMPS_LIBS)

# Use this in CMake:
# CMakeLists.txt:
# find_package(PkgConfig)
# pkg_check_modules(LAMMPS IMPORTED_TARGET lammps)
# target_link_libraries(<lib> PkgConfig::LAMMPS)

prefix=@CMAKE_INSTALL_PREFIX@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+57 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ This is the list of packages that may require additional steps.
"USER-ATC"_#user-atc,
"USER-AWPMD"_#user-awpmd,
"USER-COLVARS"_#user-colvars,
"USER-PLUMED" _#user-plumed,
"USER-H5MD"_#user-h5md,
"USER-INTEL"_#user-intel,
"USER-MOLFILE"_#user-molfile,
@@ -712,6 +713,62 @@ a corresponding Makefile.lammps.machine file.

:line

USER-PLUMED package :h4,link(user-plumed)

[CMake build]:

[Traditional make]:

Before building LAMMPS with this package, you must first build 
PLUMED.  We recommending building PLUMED separately to LAMMPS using 
the instructions that can be found at http://plumed.github.io/doc-master/user-doc/html/_installation.html.
Before compiling LAMMPS you can then install the fix plumed command
and compile LAMMPS in the usual manner:

make yes-user-plumed 
make machine :pre

Once this compilation completes you should be able to run LAMMPS in the usual
way.  When running LAMMPS with an input script that contains a fix
plumed command LAMMPS will try to call the PLUMED runtime library.  PLUMED
must therefore be available in your path if LAMMPS is compiled in this way.

On some machines it is not possible to call runtime libraries in the way described
above.  When compiling on these machines it is thus better to statically link
PLUMED when compiling LAMMPS.  To do this you must either download a PLUMED
tarball from http://www.plumed.org/get-it or clone it using
git clone https://github.com/plumed/plumed2.git.  If you download the tarball
unpack it in the /lib/plumed directory.  Similarly if you clone 
it clone it to the /lib/plumed directory as if there is a version of PLUMED within
this directory LAMMPS will always try to statically link the version of PLUMED
that this directory contains instead of dynamically linking the library.

Once you have downloaded PLUMED into /lib/plumed you must again build the code
here by following the instructions that can be found at
http://plumed.github.io/doc-master/user-doc/html/_installation.html.

You can statically link PLUMED manually and if you want to access the full
range of PLUMED functionalities this is what you should do.  If you only want the
basic range of functionalities, however, (i.e. no user contributed modules) then
you can download and compile PLUMED in one step from the lammps/src dir, using a
command like like those below:

make lib-plumed                       # print help message
make lib-plumed  args="-b"            # download and build the latest stable version of PLUMED

These commands will simply invoke the lib/plumed/Install.py script with
args specified.  Furthermore, once the script has completed you should
have a compiled version of PLUMED.  With this built you can install/un-install
PLUMED and build LAMMPS in the usual manner:

make yes-user-plumed
make machine :pre

make no-user-plumed
make machine :pre

:line

USER-H5MD package :h4,link(user-h5md)

To build with this package you must have the HDF5 software package
+31.9 KiB (607 KiB)

File changed.

No diff preview for this file type.

+28 −0
Original line number Diff line number Diff line
@@ -1201,6 +1201,34 @@ examples/USER/colvars :ul

:line

USER-PLUMED package :link(USER-PLUMED),h4

[Contents:]

The fix plumed command allows you to use the plugin for molecular
dynamics PLUMED to analyse and bias your LAMMPS trajectory on the fly.
In practise PLUMED is called from within the lammps input script by using
the "fix plumed _fix_plumed.html command.

[Authors:] The PLUMED library is written and maintained by
Massimilliano Bonomi, Giovanni Bussi, Carlo Camiloni and
Gareth Tribello. 

[Install:]

This package has "specific installation
instructions"_Build_extras.html#gpu on the "Build
extras"_Build_extras.html doc page.

[Supporting info:]

src/USER-PLUMED/README
lib/plumed/README
"fix plumed "_fix_plumed.html
examples/USER/plumed :ul

:line

USER-DIFFRACTION package :link(PKG-USER-DIFFRACTION),h4

[Contents:]
Loading