Friday, November 5, 2010

Installing lammps using Intel Compilers, OpenMPI and FFTW (Update)

This is an update of  Blog Entry Installing lammps using Intel Compilers, OpenMPI and FFTW

The steps are still relevant and workable, but if you are doing a lot of customisation pathing or you just simply wish to tweak the parameters in the configuration file, here is my sample script. I got my information from the Message threads of LAMMPS http://lammps.sandia.gov/threads/msg12768.html

Here are my settings, amending the $SOURCE/lammps-30Mar10/src/MAKE/Makefile.Linux

# linux = RedHat Linux box, Intel icc, MPICH2, FFTW

SHELL = /bin/sh
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler

CC = mpicc
CCFLAGS = -g -O -I/usr/local/fftw/include -DFFT_FFTW
DEPFLAGS = -M
LINK = mpicc
LINKFLAGS = -O
USRLIB = -lfftw -lmpi
LIB = -lstdc++ -lpthread
ARCHIVE = ar
ARFLAGS = -rc
SIZE = size

# ---------------------------------------------------------------------

# LAMMPS-specific settings
# specify settings for LAMMPS features you will use
# LAMMPS ifdef options, see doc/Section_start.html

LMP_INC = -DLAMMPS_GZIP
# MPI library, can be src/STUBS dummy lib
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library:wq

MPI_INC = -DMPICH_IGNORE_CXX_SEEK
MPI_PATH = -L/usr/mpi/intel/lib # where I store my openmpi binary and lib
MPI_LIB = -lmpi -lpthread

# FFT library, can be -DFFT_NONE if not using PPPM from KSPACE package
# INC = -DFFT_FFTW, -DFFT_INTEL, -DFFT_NONE, etc, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library

FFT_INC = -DFFT_FFTW
FFT_PATH = -L/usr/local/fftw/lib # I've put my fftw at /usr/local/fftw
FFT_LIB = -lfftw

.............

You can add further flags at CCFLAGS. See my other blog entry
  1. Understanding -DOMPI_SKIP_MPICXX Flag for compiler/linker settings
  2. Understanding -DOMPI_IGNORE_CXX_SEEK Flag for compiler/linker settings

2 comments:

Alok said...

Dear Sir,

I'm trying to install lammps using Makefile.linux. I have edited my Makefile.linux as suggested by you. after creating many .o file, it show the following error:

fix_reax_bonds.o: In function `LAMMPS_NS::FixReaxBonds::end_of_step()':
fix_reax_bonds.cpp:(.text+0x128): undefined reference to `getnsbmax_'
fix_reax_bonds.cpp:(.text+0x135): undefined reference to `getcutof3_'
fix_reax_bonds.cpp:(.text+0x2bd): undefined reference to `cbkia_'
fix_reax_bonds.cpp:(.text+0x2ca): undefined reference to `cbkia_'
fix_reax_bonds.cpp:(.text+0x314): undefined reference to `cbkia_'
fix_reax_bonds.cpp:(.text+0x31e): undefined reference to `cbkc_'
fix_reax_bonds.cpp:(.text+0x33d): undefined reference to `cbkia_'
fix_reax_bonds.cpp:(.text+0x365): undefined reference to `cbknubon2_'
fix_reax_bonds.cpp:(.text+0x36d): undefined reference to `cbkbo_'
fix_reax_bonds.cpp:(.text+0x388): undefined reference to `cbkabo_'
fix_reax_bonds.cpp:(.text+0x393): undefined reference to `cbklonpar_'




please help in building lammps. Thanks in advance.

kittycool said...

Hi,

I'm assuming you are using Intel Compilers, FFTW and OpenMPI on CentOS?
Can you post me your Makefile?