《Lammps-安装步骤详解(共7页).doc》由会员分享,可在线阅读,更多相关《Lammps-安装步骤详解(共7页).doc(7页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上一 lamps非并行安装1 在终端输入:cd /mnt (源码包lammps.tar.gz放在/mnt下 (cp /home/lab/Desktop/lammps.tar.gz /mnt))gunzip lamps.tar.gztar xvf lamps.tarmv lammps-5Dec10 lmp (重命名为lmp)cd lmp/src/STUBSmake cleanmakecd /mnt/lmp/src/MAKEvi Makefile.serial 后出现# g+ = RedHat Linux box, g+4, gfortran, no MPI,no FFTS
2、HELL = /bin/sh# -# compiler/linker settings# specify flags and libraries needed for your compilerCC = g+4 g+4该为g+CCFLAGS = -g -ODEPFLAGS = -MLINK = g+4 g+4改为g+LINKFLAGS = -g -OLIB = ARCHIVE = arARFLAGS = -rcSIZE = size# -然后存档,退出,终端输入cd /mnt/lmp/srcmake clean-allmake serial之后linux开始编译,最后会在/mnt/lmp/sr
3、c下生成lmp_serial的可执行文件。mv lmp_serial lmp 2 计算一example终端输入:cd /mnt/lmp/e*/shearcp /mnt/lmp/src/lmp /mnt/lmp/e*/shear./lmpin.shear 即开始计算二lammps的并行安装1 安装fftw终端输入:cd /mntgunzip fftw-2.1.5.tar.gz (源码包fftw-2.1.5.tar.gz在 /mnt下) tar xvf fftw-2.1.5.tarcd fftw-2.1.5./configure prefix=/opt/fftw -enable -floatmak
4、emake install (fftw-2.1.5即安装在/opt/fftw下)2 安装mpich终端输入:cd /mntgunzip mpich2-1.3.1.tar.gztar xvf mpich2-1.3.1.tarcd /mpich2-1.3.1./configure prefix=/opt/mpichmakemake install (mpich即安装在/opt/mpich下)然后配置环境变量终端输入:cdvi .bashrc开始编译为If -f /etc/bashrc ; then. /etc/bashrc fi export PATH=/opt/mpich/bin:$PATHex
5、port LD_LIBRARY_PATH=/opt/mpich/lib:/opt/fftw/lib:$LD_LIBRARY_PATH3 安装lammpscd /mntgunzip lammps.tar.gztar xvf lammps.tarmv lammps-5Dec10 lmpcd /lmp/srcmake yes-allmake no-gpumake no-user-atc(几个特殊的package:meam,poems,reax,gpu,user-atc需要特别安装,如下)cd /mnt/lmp/lib/meamlsmake f Makefile.gfortran (安装meam)cd
6、 /mnt/lmp/lib/poemslsmake f Makefile.g+cd /mnt/lmp/lib/reaxlsmake f Makefile.gfortran(然后对Makefile.serial文件进行编译)cd /mnt/lmp/src/MAKEvi Makefile.serial (按下i可修改)# g+ = RedHat Linux box, g+4, gfortran, MPICH2, FFTWSHELL = /bin/sh# -# compiler/linker settings# specify flags and libraries needed for your
7、compilerCC = g+4 g+4改为mpic+CCFLAGS = -g -ODEPFLAGS = -MLINK = g+4 g+4改为mpic+LINKFLAGS = -g -OLIB = ARCHIVE = arARFLAGS = -rcSIZE = size# -# LAMMPS-specific settings# specify settings for LAMMPS features you will use# LAMMPS ifdef options, see doc/Section_start.htmlLMP_INC = -DLAMMPS_GZIP# MPI librar
8、y, can be src/STUBS dummy lib# INC = path for mpi.h, MPI compiler settings# PATH = path for MPI library# LIB = name of MPI libraryMPI_INC =-I/opt/mpich/include -DMPICH_SKIP_MPICXXMPI_PATH = -I/opt/mpich/libMPI_LIB = /opt/mpich/lib/libmpich.a #-lmpich -lpthread# FFT library, can be -DFFT_NONE if not
9、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 libraryFFT_INC = -I/opt/fftw/include -DFFT_FFTWFFT_PATH = -I/opt/ffte/libFFT_LIB = /opt/fftw/libfftw.a #-lfftw# additional system libraries needed by
10、LAMMPS package libraries# these settings are IGNORED if the corresponding LAMMPS package# (e.g. gpu, meam) is NOT included in the LAMMPS build# SYSLIB = names of libraries# SYSPATH = paths of librariesgpu_SYSLIB = -lcudartmeam_SYSLIB = -lmeam lgfortranpoems_SYSLIB= -lpoems -lgfortranreax_SYSLIB = -l
11、reax -lgfortranuser-atc_SYSLIB = -lblas -llapackgpu_SYSPATH = -L/usr/local/cuda/lib64meam_SYSPATH = -L/mnt/lmp/lib/meampoems_SYSPATH= -L/mnt/lmp/lib/poemsreax_SYSPATH = -L/mnt/lmp/lib/reaxuser-atc_SYSPATH = # -# build rules and dependencies# no need to edit this sectioninclude Makefile.packageEXTRA_
12、INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC)EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(PKG_SYSPATH)EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(PKG_SYSLIB)# Link target$(EXE): $(OBJ) $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) $(SIZE) $(EXE)# Library target
13、lib: $(OBJ) $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)# Compilation rules%.o:%.cpp $(CC) $(CCFLAGS) $(EXTRA_INC) -c $%.d:%.cpp $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $ $# Individual dependenciesDEPENDS = $(OBJ:.o=.d)include $(DEPENDS)存档退出(esc :wq exit),终端输入:cd /mnt/lmp/srcmake clean-allmake serial (lammps开始安装,最后可生成lmp_serial的可执行文件)mv lmp_serial lmp4 并行计算一examplea:终端输入cd /mnt/lmp/examples/shearcp /opt/mpich/bin/mpirun /mnt/lmp/e*/shearcp /mnt/lmp/src/lmp /mnt/lmp/e*/shearmpirun np 4 ./lmpin.shear (lammps开始计算)b:终端输入cd /mnt/lmp/e*/shear/opt/mpich/bin/mpirun np 4 /mnt/lmp/src/lmpin.shear专心-专注-专业
限制150内