Compiling LAMMPS 25Sep11 on HECToR Phase 3 (Cray XE6, Interlagos)

This page contains the compilation instructions for compiling LAMMPS 25Sep11 version of LAMMPS on HECToR Phase 3 (Cray XE6, Interlagos).

Download/unpack the source code

Download the latest version of LAMMPS from http://lammps.sandia.gov/download.html unpack it:

gunzip lammps.tar.gz
tar xvf lammps.tar
cd lammps-25Sep11/src

Setup the build environment

Switch to the GNU compiler Suite. Since Jan 2011 LAMMPS has had serious issues building with the PGI compiler so use GNU instead.

module swap PrgEnv-cray PrgEnv-gnu 

Load the FFTW 3 module:

module load fftw

Edit the existing Makefile.xe6 supplied under src/MAKE/Makefile.xe6. The following flags were used to compile LAMMPS:

 CC =            CC
 CCFLAGS =       -O3 -march=bdver1
 DEPFLAGS =      -M
 LINK =          CC
 LINKFLAGS =     -O3 -march=bdver1
 LIB =           -lstdc++
 ARCHIVE =       ar
 ARFLAGS =       -rc
 SIZE =          size

If FFTW is required then the paths to this must also be specified in the Makefile:
 FFT_INC =       -DFFT_FFTW3 -I$FFTW_INC
 FFT_PATH =      -L$FFTW_DIR
 FFT_LIB =       -lfftw3

Build the code

Build the parallel version with:

 make makelist
 make xe6

If the build is successful you'll get something like:

 size ../lmp_xe6
   text    data     bss     dec     hex filename
 6402140   84448  206904 6693492  662274 ../lmp_xe6

Additional instructions for building the serial version of LAMMPS

To build the serial version of LAMMPS you first need to build the MPI STUBS library:

cd STUBS
cp Makefile Makefile.orig

Edit Makefile and set

 CC =            CC
 CCFLAGS =       -O3

Make the MPI STUBS library with

make 

The suppled Makefile.serial can be used as a starting point. Edit serial makefile to include the STUBS library, flags used:

 CC =            CC
 CCFLAGS =       -O3 -march=bdver1
 DEPFLAGS =      -M
 LINK =          CC
 LINKFLAGS =     -O3 -march=bdver1
 LIB =           -lstdc++
 ARCHIVE =       ar
 ARFLAGS =       -rc
 SIZE =          size

If FFTW is required the paths to FFTW must also be set in Makefile.serial

 FFT_INC =       -DFFT_FFTW3 -I$FFTW_INC
 FFT_PATH =      -L$FFTW_DIR
 FFT_LIB =       -lfftw3

Build serial LAMMPS

cd ../
gmake serial 

If successful you get something like:

 size ../lmp_serial
   text    data     bss     dec     hex filename
 5297477   79280  112160 5488917  53c115 ../lmp_serial
 

Modules loaded for the centrally installed build were:

Currently Loaded Modulefiles:
  1) modules/3.2.6.6                                                            
  2) nodestat/2.2-1.0400.29866.4.3.gem                                          
  3) sdb/1.0-1.0400.30000.6.18.gem                                              
  4) MySQL/5.0.64-1.0000.4667.20.1                                              
  5) lustre-cray_gem_s/1.8.4_2.6.32.45_0.3.2_1.0400.6221.1.1-1.0400.30252.1.29  
  6) udreg/2.3.1-1.0400.3911.5.6.gem                                            
  7) ugni/2.3-1.0400.3912.4.29.gem                                              
  8) gni-headers/2.1-1.0400.3906.5.1.gem                                        
  9) dmapp/3.2.1-1.0400.3965.10.12.gem                                          
 10) xpmem/0.1-2.0400.29883.4.6.gem                                             
 11) hss-llm/6.0.0                                                              
 12) Base-opts/1.0.2-1.0400.29823.8.1.gem                                       
 13) xtpe-network-gemini
 14) PrgEnv-gnu/4.0.30
 15) xt-mpich2/5.3.4
 16) atp/1.3.0
 17) xt-asyncpe/5.03
 18) pmi/2.1.4-1.0000.8596.8.9.gem
 19) xt-libsci/11.0.03
 20) gcc/4.6.1
 21) pbs/10.4.0.10125
 22) packages-phase2b
 23) budgets/1.0
 24) xtpe-interlagos
 25) fftw/3.3.0.0