Added descriptions of static linking of PLUMED to README files

This commit is contained in:
Gareth Tribello
2018-07-11 21:56:08 +01:00
parent 492e945b5a
commit 4734bc09dc
3 changed files with 83 additions and 12 deletions

56
lib/plumed/README Normal file
View File

@ -0,0 +1,56 @@
This directory contains links to the PLUMED library which is required
to use the PLUMED package and its fix plumed command in a
LAMMPS input script. PLUMED should only be downloaded into this directory if
you wish to statically link the library. If you wish to link PLUMED as
a dynamic library (as we recommend) then you can compile and build PLUMED
separately to LAMMPS. To use PLUMED in conjuction with LAMMPS you then simply
need to ensure that the PLUMED library is in your path at runtime.
More info about the PLUMED library can be found at http://www.plumed.org.
You can type "make lib-plumed" from the src directory to see help on
how to download, build and statically link PLUMED via make commands, or you can
do the same thing by typing "python Install.py" from within this
directory. Alternatively you can download and build PLUMED manually by following the instructions
below.
-----------------
Instructions:
1. Download PLUMED either as a 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 unpack it in this /lib/plumed directory.
Similarly if you clone it clone it to the /lib/plumed
directory.
2. Compile PLUMED from within its home directory. In the
simplest cases this be done by issuing the commands
% ./configure
% make
More detailed instructions can be found at
http://plumed.github.io/doc-master/user-doc/html/_installation.html
3. There is no need to install PLUMED if you only wish
to use it from LAMMPS. You should thus only run
make install if you want to use PLUMED as a stand-alone
code or from some other code. To install it you can
run the following commands:
a) install under the default /usr/local
% sudo make install
b) install under a user-writeable location by first
changing the PREFIX variable when running the
configure command file, then
% make install
-----------------
When these steps are complete you can build LAMMPS
with the PLUMED package installed:
% cd lammps/src
% make yes-user-plumed
% make mpi (or whatever target you wish)

View File

@ -14,9 +14,9 @@ if (test $1 = 1) then
# This is for statically linking plumed2
if ( test -e ../../lib/plumed/plumed2*/src/lib/Plumed.inc.static ) then
fname=`ls ../../lib/plumed/plumed2*/src/lib/Plumed.inc.static`
sed -i -e "4 i \
include $fname
" ../Makefile.package.settings
sed -i -e '4 i \
include '$fname'
' ../Makefile.package.settings
dname=`ls ../../lib/plumed/plumed2*/src/wrapper/Plumed.h`
ln -s USER-PLUMED/$dname ../Plumed.h
# This is for linking plumed2 as a runtime library -- this is the default behavior

View File

@ -11,18 +11,33 @@ folder implement an interface between LAMMPS and PLUMED, that are written
and maintained by Gareth Tribello (gareth.tribello@gmail.com).
PLUMED must instead be downloaded and compiled separately to LAMMPS. This building
and compiling of PLUEMD can be done before or after the building of LAMMPS as LAMMPS
calls PLUMED as a dynamic library. If you wish to use PLUMED with LAMMPS, however,
you must run the command:
and compiling of PLUMED can be done before or after the building of LAMMPS as LAMMPS
can call PLUMED as a dynamic library. There is also the possibility to link PLUEMD
statically. In this case a copy of PLUMED must be downloaded into the lib/plumed
directory. This copy of PLUMED will then always be linked into the code at compile
time.
However you decide to link PLUMED (statically or dynamically) you must run the command:
make yes-user-plumed
before compiling LAMMPS. Furthermore, you must ensure that PLUMED is in your
before compiling LAMMPS in order to enable the module. In addition, if you have chosen to
link PLUMED dynamically you must ensure that PLUMED is in your
PATH when running a LAMMPS calculation that takes advantage of PLUMED. If
PLUMED is not in the PATH an error will be returned whenever LAMMPS encounters
the fix plumed command in its input. To be clear, however, LAMMPS will run if
it is compiled with fix-plumed enabled on inputs that do not contain a fix
plumed command when PLUMED is not in the PATH.
PLUMED is linked as a runtime library and if PLUMED is not in the PATH an error will be returned whenever LAMMPS encounters
the fix plumed command in its input. To be clear, however, a LAMMPS executable that was dynamically linked with PLUMED will run
even if PLUMED is not in the path if as long as the input does not contain a fix
plumed command.
If you wish to statically link PLUMED you must download PLUMED to the /lib/plumed directory before compiling LAMMPS. You can
download a tar ball into that directory or you can clone the plumed2 repository from github there. Once you have created a
directory containing a distribution of PLUMED within /lib/plumed you then must build PLUMED within that directory by issuing
the usual commands. It is worth noting that we have provided a script that will download and build PLUMED for you with
a minimal set of options. To run this script you need to issue the following command:
make lib-plumed args="-b"
in the src directory.
More info about the PLUMED library can be found at:
@ -45,7 +60,7 @@ numerous example scripts for PLUMED as well as citations to articles that dcomen
implemented within PLUMED.
There are also example scripts for using this package in the folder
examples/USER/colvars, as well as on the GitHub page for PLUMED.
examples/USER/plumed, as well as on the GitHub page for PLUMED.
Please contact Gareth Tribello (gareth.tribello@gmail.com) for questions
regarding this package.