#Install lamps-7Aug19 (version: 2019-08-07)
For convenience, I created a folder /home/hsiung/software/lammps. All files are downloaded and installed in this folder.
cat /etc/redhat-release
Use the cat command to check the version: CentOS Linux release 7.9.2009 (Core)
1. Download and install openmpi (mpich can also be used, see the installation process of lamps-10Aug15 below for details)
openmpi official website https://www.open-mpi.org/software/ompi/v4.1/
Here I downloaded openmpi-4.1.1.tar.gz and uploaded it to the folder
#Decompress tar -zxvf openmpi-4.1.1.tar.gz cd openmpi-4.1.1 #Create a folder to use as the installation location of openmpi mkdir openmpi411 ./configure --prefix=/home/hsiung/software/lammps/openmpi411 ? make make install #If no error is reported, the installation is basically successful. Then add environment variables. vim ~/.bashrc export PATH=/home/hsiung/software/lammps/openmpi411/bin:$PATH export LD_LIBRARY_PATH=/home/hsiung/software/lammps/openmpi411/lib/:$LD_LIBRARY_PATH source ~/.bashrc
2. Download and install fftw
fftw official website https://www.fftw.org/download.html
Here I downloaded fftw-3.3.10.tar.gz and uploaded it to the folder
#Decompress tar -zxvf fftw-3.3.10.tar.gz cd fftw-3.3.10 #Create a folder to use as the installation location of fftw3310 mkdir fftw3310 ./configure --prefix=/home/hsiung/software/lammps/fftw3310 ? make make install #If no error is reported, the installation is basically successful. Then add environment variables. vim ~/.bashrc export PATH=/home/hsiung/software/lammps/fftw3310/bin:$PATH export LD_LIBRARY_PATH=/home/hsiung/software/lammps/fftw3310/lib:$LD_LIBRARY_PATH source ~/.bashrc
3. Lammps software package download
lammps official website https://download.lammps.org/tars/index.html
Download the lammps-7Aug2019.tar.gz installation package and upload it to the folder
#Decompress tar -zxvf lammps-7Aug2019.tar.gz cd /home/hsiung/software/lammps/lammps-7Aug19/src/MAKE
#Modify the Makefile.mpi file
# MPI library
# see discussion in Section 2.2 (step 5) of manual
# MPI wrapper compiler/linker can provide this info
# can point to dummy MPI library in src/STUBS as in Makefile.serial
# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library
MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I/home/hsiun/software/lammps/openmpi411/include
MPI_PATH = -L/home/hsiung/software/lammps/openmpi411/lib
MPI_LIB = -lmpi
#FFT library
# see discussion in Section 2.2 (step 6) of manual
# can be left blank to use provided KISS FFT library
# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library
FFT_INC = -DFFT_FFTW3 -I/home/hsiung/software/lammps/fftw3310/include
FFT_PATH = -L/home/hsiung/software/lammps/fftw3310/lib
FFT_LIB = -lfftw3
#Then enter the src directory: cd.. make yes-all make no-lib make mpi
Error reporting
#If no error is reported here, an lmp_mpi file will be generated. ls -ali lmp_mpi 697286107 -rwxrwxr-x. 1 hsiung hsiung 104631768 Nov 2 08:45 lmp_mpi #If an error is reported here make[1]: *** [Makefile:89: ../lmp_mpi] Error 1 make[1]: Leaving directory '/home/hsiung/software/lammps/lammps-7Aug19/src/Obj_mpi' make: *** [Makefile:212: mpi] Error 2 #Clear old compiled files make clean-all #Check whether the Makefile.mpi file has been modified improperly make mpi
#Add environment variables vim ~/.bashrc export PATH=/home/hsiung/software/lammps/lammps-7Aug19/src:$PATH source ~/.bashrc #test cd /home/hsiung/software/lammps/lammps-7Aug19/examples #For example, enter melt cd /home/hsiung/software/lammps33/lammps-7Aug19/examples/melt mpirun -np 1 lmp_mpi < in.melt
#File deletion (because the disk capacity is limited, tar.gz and decompressed files can be deleted according to your own needs)
rm-rf lammps-7Aug2019.tar.gz lammps-7Aug2019 fftw-3.3.10.tar.gz fftw-3.3.10 openmpi-4.1.1.tar.gz openmpi-4.1.1
#Install lamps-10Aug15 (version: 2015-08-10)
%%%Because I need to use a package developed by others, I found that I kept getting errors after installing version 19, so I checked the date of the package developed by the author, so I tried to install the version of lamps corresponding to the date.
1. Download and install mpich (openmpi is not used here because the lamps-10Aug15 manual (/doc/Manual.pdf is included in the decompressed package) mentioned that it may be incompatible, so I chose to install mpich)
mpich official website https://www.mpich.org/static/downloads/
Here I downloaded mpich-3.2.1.tar.gz and uploaded it to the folder
#Decompress tar -zxvf mpich-3.2.1.tar.gz cd mpich-3.2.1.tar.gz #Create a folder to use as the installation location of mpich mkdir mpich321 ./configure --prefix=/home/hsiung/software/lammps/mpich321 ? make make install
#If no error is reported, the installation is basically successful. Then add environment variables.
vim ~/.bashrc export MPI=/home/hsiung/software/lammps/mpich321 export PATH=$MPI/bin:$PATH export LD_LIBRARY_PATH=$MPI/lib:$LD_LIBRARY_PATH export MANPATH=$MANPATH:$MPI/share/man export INFOPATH=$INFOPATH:$MPI/share/man export INCLUDE=$MPI/include:$INCLUDE source ~/.bashrc
2. Download and install fftw (see the lamps-7Aug19 installation process above for details)
3. Lammps software package download
(For details, please see the installation process of lamps-7Aug19 above)
#Modify the Makefile.mpi file
#LAMMPS ifdef settings
# see possible settings in Section 2.2 (step 4) of manual
LMP_INC = -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 ###Old versions are not complete here, and may appear during compilation’Please set -DLAMMPS_MEMALIGN=64 in CCFLAGS for your LAMMPS makefile’
# MPI library
# see discussion in Section 2.2 (step 5) of manual
# MPI wrapper compiler/linker can provide this info
# can point to dummy MPI library in src/STUBS as in Makefile.serial
# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library
MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I/home/hsiung/software/lammps/mpich321/include
MPI_PATH = -L/home/hsiung/software/lammps/mpich321/include
MPI_LIB = -lmpi
#FFT library
# see discussion in Section 2.2 (step 6) of manual
# can be left blank to use provided KISS FFT library
# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library
FFT_INC = -DFFT_FFTW3 -I/home/hsiung/software/lammps/fftw3310/include
FFT_PATH = -L/home/hsiung/software/lammps/fftw3310/lib
FFT_LIB = -lfftw3
#Then enter the src directory:
cd /home/hsiung/software/lammps/lammps-10Aug15/src make yes-ASPHERE yes-BODY yes-CLASS2 yes-COLLOID yes-COMPRESS yes-CORESHELL yes-DIPOLE yes-GRANULAR yes-KSPACE yes-MANYBODY yes-MC yes-MISC yes-MOLECULE yes-MPIIO yes-OPT yes-PERI yes -QEQ yes-REPLICA yes-RIGID yes-SHOCK yes-SNAP yes-SPIN yes-SRD
#Compile poems library
cd /home/hsiung/software/lammps/lammps-10Aug15/lib/poems rm*.o make -f Makefile.g++ cd /home/hsiung/software/lammps/lammps-10Aug15/src make yes-poems
#Compile mean library
cd /home/hsiung/software/lammps/lammps-10Aug15/lib/mean rm*.o make -f Makefile.gfortran cp Makefile.lammps.gfortran Makefile.lammps cd /home/hsiung/software/lammps/lammps-10Aug15/src make yes-meam
#Compile reax library
cd /home/hsiung/software/lammps/lammps-10Aug15/lib/reax rm*.o make -f Makefile.gfortran cp Makefile.lammps.gfortran Makefile.lammps cd /home/hsiung/software/lammps/lammps-10Aug15/src make yes-reax
#Compile user library
cd /home/hsiung/software/lammps/lammps-10Aug15/src make yes-USER-BOCS yes-USER-CGDNA yes-USER-CGSDK yes-USER-DIFFRACTION yes-USER-DPD yes-USER-DRUDE yes-USER-EFF yes-USER-FEP yes-USER-INTEL yes-USER- LB yes-USER-MANIFOLD yes-USER-MEAMC yes-USER-MESO yes-USER-MGPT yes-USER-MISC yes-USER-MOFFF yes-USER-MOLFILE yes-USER-OMP yes-USER-PHONON yes-USER- PTM yes-USER-QTB yes-USER-REAXC yes-USER-SMTBQ yes-USER-SDPD yes-USER-SPH yes-USER-TALLY yes-USER-UEF make mpi
#For the following steps, refer to the lamps-7Aug19 installation process.
Study notes (if there is any infringement, it will be deleted if contacted)
Reference materials
http://t.csdnimg.cn/rw5TE
http://t.csdnimg.cn/kUs5C
Does anyone know how to install lamps? Can you teach me? – yellow fish’s answer – Zhihu
https://www.zhihu.com/question/378572817/answer/2847696158
Does anyone know how to install lamps? Can you teach me? – Answer from Gentai Technology – Zhihu
https://www.zhihu.com/question/378572817/answer/2278958243