Building LAMMPS with FFTW
Sachin Shanbhag 488 DSL,
[email protected] sandia.gov
When should you use this tutorial? ●
You use LAMMPS as you MD program
●
You have to consider long range Coulombic interaction
●
You don't know where your fft files are OR
●
You don't have permissions to access them OR
●
You simply want to create a fftw library in your local account
Download LAMMPS ●
Get the program from http://lammps.sandia.gov/download.html
●
Select C++, and hit download now
●
This gets you lammps.tar.gz
●
Untar-zip it using the command in an appropriate directory tar -zxvf lammps.tar.gz
●
mv lammps-xxx to lammps, for simplicity
Download FFTW ●
●
Download the 2.1.x version of fftw from fftw.org Untar/zip the downloaded file (I downloaded v2.1.5) tar -zxvf fftw-2.1.5.tar.gz
●
make a temporary directory called localfft
●
cd fftw-2.1.5/
●
In fftw-2.1.5/ type ./configure --prefix=[ABSPATH]/localfft
Build FFTW ●
Here [ABSPATH]is the absolute path to this directory. –
●
This really depends upon where you want to place the library in your local account
In my case it is, for now (I'll move it later), /panfs/panasas1/users/sachins/Desktop/
●
Type the following commands to build the fftw library make; make install
●
●
This will make three subdirectories in the localfft directory I moved the localfft directory into my lammps/src/ directory
Building the LAMMPS Executable ●
●
●
Detailed instructions available at: http://lammps.sandia.gov/doc/Section_sta rt.html#2_2 Right now, lets do a simple compilation: –
single processor, no MPI
–
with freely available FFTW library
cd lammps/src/STUBS/ –
●
make (builds libmpi.a)
cd lammps/src/MAKE/ –
comment out/delete LINKFORT, FORTLIB, and SYSLIB in
Makefile.g++
Building the Executable ●
●
●
The only part I changed in Makefile.g++ was CC CCFLAGS
= =
DEPFLAGS LINK LINKFLAGS USRLIB ARCHIVE ARFLAGS SIZE
= = = = = = =
g++ -g -DFFT_FFTW -I../STUBS \ -I../localfft/include $(PKGINC) -M g++ -O -L../STUBS -L../localfft/lib $(PKGPATH) -lfftw -lmpi $(PKGLIB) ar -rc size
cd lammps/src/ –
make yes-kspace
–
make g++
You should have an executable called lmp_g++
Testing if it works ●
I used the peptide example in the examples directory –
●
It needs fftw to work
cd lammps/examples/peptide
Testing if it works sachins% cat in.peptide # Solvated 5-mer peptide units atom_style
real full
pair_style 10.0 10.0 bond_style angle_style dihedral_style improper_style kspace_style
lj/charmm/coul/long 8.0
...
harmonic charmm charmm harmonic pppm 0.0001
Run the program sachins% lmp_g++ < in.peptide LAMMPS (7 Jul 2009) Scanning data file ... 3 = max bonds/atom 6 = max angles/atom 14 = max dihedrals/atom 1 = max impropers/atom
PPPM initialization … G vector = 0.268721 grid = 15 15 15 stencil order = 5 RMS precision = 4.86052e-05 brick FFT buffer size/proc = 10648 3375 5808 Setting up run …