Compiling LAMMPS: Difference between revisions

From HPC Wiki
Jump to:navigation Jump to:search
(Created page with " {{Cmd|source /home/bgo/shared/bin/selector-compiler -gq|source /home/bgo/shared/bin/selector-mpi -ofq|export CFLAGS{{=}}"-O3 -pipe --param l1-cache-size{{=}}32 --param l1-cac...")
 
No edit summary
Line 1: Line 1:
= Flory.usm.edu =
Compiling LAMMPS on flory.usm.edu cluster
== Initial setup ==


{{Cmd|source /home/bgo/shared/bin/selector-compiler -gq|source /home/bgo/shared/bin/selector-mpi -ofq|export CFLAGS{{=}}"-O3 -pipe --param l1-cache-size{{=}}32 --param l1-cache-line-size{{=}}64 --param l2-cache-size{{=}}15360 -march{{=}}core2 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mbmi -mavx -mtune{{=}}generic"|export CXXFLAGS{{=}}"${CFLAGS}"|export FCFLAGS{{=}}"${CFLAGS}"|export FFLAGS{{=}}"${CFLAGS}"}}
{{Cmd|source /home/bgo/shared/bin/selector-compiler -gq|source /home/bgo/shared/bin/selector-mpi -ofq|export CFLAGS{{=}}"-O3 -pipe --param l1-cache-size{{=}}32 --param l1-cache-line-size{{=}}64 --param l2-cache-size{{=}}15360 -march{{=}}core2 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mbmi -mavx -mtune{{=}}generic"|export CXXFLAGS{{=}}"${CFLAGS}"|export FCFLAGS{{=}}"${CFLAGS}"|export FFLAGS{{=}}"${CFLAGS}"}}
== Configure LAMMPS for compilation ==


The new Make.py of LAMMPS requires python2.7, so I installed it in my home directory.
The new Make.py of LAMMPS requires python2.7, so I installed it in my home directory.
Line 10: Line 17:


The CCFLAGS parameters, which could not be specified on the command line, can be manually added to MAKE/MINE/Makefile.auto file.
The CCFLAGS parameters, which could not be specified on the command line, can be manually added to MAKE/MINE/Makefile.auto file.
== Compiling LAMMPS ==
=== LAMMPS Libraries ===


{{Cmd|~/packages/bin/python2.7 ./Make.py -j 8 -colvars make{{=}}g++ -a lib-colvars|~/packages/bin/python2.7 ./Make.py -j 8 -meam make{{=}}gfortran -a lib-meam|~/packages/bin/python2.7 ./Make.py -j 8 -poems make{{=}}g++ -a lib-poems|~/packages/bin/python2.7 ./Make.py -j 8 -qmmm make{{=}}gfortran -a lib-qmmm|~/packages/bin/python2.7 ./Make.py -j 8 -reax make{{=}}gfortran -a lib-reax }}
{{Cmd|~/packages/bin/python2.7 ./Make.py -j 8 -colvars make{{=}}g++ -a lib-colvars|~/packages/bin/python2.7 ./Make.py -j 8 -meam make{{=}}gfortran -a lib-meam|~/packages/bin/python2.7 ./Make.py -j 8 -poems make{{=}}g++ -a lib-poems|~/packages/bin/python2.7 ./Make.py -j 8 -qmmm make{{=}}gfortran -a lib-qmmm|~/packages/bin/python2.7 ./Make.py -j 8 -reax make{{=}}gfortran -a lib-reax }}
=== Standalone binary ===


{{Cmd|make -j7 auto|cp src/lmp_auto /home/bgo/shared/gnu-openmpi/bin/lmp}}
{{Cmd|make -j7 auto|cp src/lmp_auto /home/bgo/shared/gnu-openmpi/bin/lmp}}
=== Shared library ===


Compile shared library using Makefile
Compile shared library using Makefile
Line 19: Line 34:
Each user that wants to use LAMMPS as a library should use their own lammps src. They can compile their own programs like mpic++ -I/home/bgo/lammps/src -c simple.cpp
Each user that wants to use LAMMPS as a library should use their own lammps src. They can compile their own programs like mpic++ -I/home/bgo/lammps/src -c simple.cpp


Add -L/home/bgo/packages/lib to FFT_PATH in MAKE/MINE/Makefile.auto so the libpython2.7.so can be found when linking. Any of the _PATH variables will work, I just choose FFT_PATH because that was closed to where my cursor was at the time!
Add -L/home/bgo/packages/lib to FFT_PATH in MAKE/MINE/Makefile.auto so the libpython2.7.so can be found when linking. Any of the _PATH variables will work, I just choose FFT_PATH because that was closest to where my cursor was at the time!


{{Cmd|make clean-all|make -j7 mode{{=}}shlib auto
{{Cmd|make clean-all|make -j7 mode{{=}}shlib auto
}}
}}

Revision as of 16:03, 2 January 2017

Flory.usm.edu

Compiling LAMMPS on flory.usm.edu cluster

Initial setup

user $source /home/bgo/shared/bin/selector-compiler -gq
user $source /home/bgo/shared/bin/selector-mpi -ofq
user $export CFLAGS="-O3 -pipe --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=15360 -march=core2 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mbmi -mavx -mtune=generic"
user $export CXXFLAGS="${CFLAGS}"
user $export FCFLAGS="${CFLAGS}"
user $export FFLAGS="${CFLAGS}"

Configure LAMMPS for compilation

The new Make.py of LAMMPS requires python2.7, so I installed it in my home directory.

Check the flags at the end of the first Make.py line. The python script does not accept CCFLAG parameters like '--param l1-cache-line-size=64', and also expects the parameters to NOT have a '-' in front. Therefore, the CFLAGS environmental variable can not be directly used here.


{{Cmd|cd src|~/packages/bin/python2.7 ./Make.py -png yes -jpg yes -s ffmpeg gzip exceptions -fft fftw3 dir=/home/bgo/shared/gnu-openmpi -a file -m none -mpi mpi dir=/home/bgo/shared/gnu-openmpi -cc /home/bgo/shared/gnu-openmpi/bin/mpiCC -flags CCFLAGS add 12 O3 march=core2 mcx16 msahf mmovbe maes mpclmul mpopcnt mabm mbmi mavx mtune=generic -j 8|make yes-all|make no-{GPU,KIM,KOKKOS,VORONOI} no-USER-{ATC,AWPMD,OMP,QUIP,H5MD,SMD,VTK} }}

The CCFLAGS parameters, which could not be specified on the command line, can be manually added to MAKE/MINE/Makefile.auto file.

Compiling LAMMPS

LAMMPS Libraries

user $~/packages/bin/python2.7 ./Make.py -j 8 -colvars make=g++ -a lib-colvars
user $~/packages/bin/python2.7 ./Make.py -j 8 -meam make=gfortran -a lib-meam
user $~/packages/bin/python2.7 ./Make.py -j 8 -poems make=g++ -a lib-poems
user $~/packages/bin/python2.7 ./Make.py -j 8 -qmmm make=gfortran -a lib-qmmm
user $~/packages/bin/python2.7 ./Make.py -j 8 -reax make=gfortran -a lib-reax

Standalone binary

user $make -j7 auto
user $cp src/lmp_auto /home/bgo/shared/gnu-openmpi/bin/lmp

Shared library

Compile shared library using Makefile

Each user that wants to use LAMMPS as a library should use their own lammps src. They can compile their own programs like mpic++ -I/home/bgo/lammps/src -c simple.cpp

Add -L/home/bgo/packages/lib to FFT_PATH in MAKE/MINE/Makefile.auto so the libpython2.7.so can be found when linking. Any of the _PATH variables will work, I just choose FFT_PATH because that was closest to where my cursor was at the time!

user $make clean-all
user $make -j7 mode=shlib auto