level 2
数理学院哈哈
楼主
1. 使用fftw-2.1.5.tar.gz, mpich-1.2.7p1.tar.gz, lammps.tar.gz
2. $ sudo apt-get install g++ libmpich1.0-dev openssh-server mpich-bin
3. 如果有安裝 libmpich-mpd1.0-dev, libmpich-shmem1.0-dev, mpich2, mpich2-doc, mpich-mpd-bin mpich-shmem-bin的話,請用sudo apt-get remove --purge <package name>移除.
4. $ ifconfig|grep "inet addr" #把左上角的IP記下來
$ gksudo gedit /etc/hosts #把電腦名稱前面的那個IP(通常是127.0.1.1),用上個步驟所記得的IP換掉
5. $ sudo useradd -m -s /bin/bash cluster
$ sudo passwd cluster #輸入密碼,建議與系統密碼相同
$ sudo su - cluster -c "mkdir ~/bin;export PATH=~/bin:$PATH"
6. 安裝fftw-2.1.5
$ tar -zxvf fftw-2.1.5.tar.gz
$ cd fftw-2.1.5
$ ./configure --prefix=/<PATH>/ --enable-float #<PATH>是fftw安裝的位置
$ make
$ sudo make install
7. 安裝mpich-1.2.7p1
$ tar -zxvf mpich-1.2.7p1.tar.gz
$ cd mpich-1.2.7p1
$ ./configure --prefix=/<PATH>/ #<PATH>是mpich安裝的位置,中途請輸入yes與密碼,建議與系統密碼相同
$ make
$ sudo make install
8. 安裝lammps
$ tar -zxvf lammps.tar.gz
修改/lammps-<version>/src/MAKE/Makefile.g++ #範例在步驟10
$ cd lammps-<version>/src
$ make g++
9. 找一個project來測試
$ mpirun -np 8 ./lmp_g++ < in.script
一開始跳出的視窗,請輸入yes,接著輸入host的密碼(就是上述步驟所設定的),lammps就開始動啦~~
可以用top的指令來看lmp_g++在運作的程序,會有另一番爽感~
10. Makefile.g++, 注意<PATH>的部分要換成相應的路徑
===============================================================
# g++ = RedHat Linux box, g++4, gfortran, MPICH2, FFTW
SHELL = /bin/sh
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler
CC = g++
CCFLAGS = -g -O
DEPFLAGS = -M
LINK = g++
LINKFLAGS = -g -O
LIB =
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
MPI_INC = -DMPICH_SKIP_MPICXX -I/<PATH>/include
MPI_PATH = -L/<PATH>/lib
MPI_LIB = -lmpich -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 -I/<PATH>/include
FFT_PATH = -L/<PATH>/fftw/lib
FFT_LIB = -lfftw
# additional system libraries needed by 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 libraries
gpu_SYSLIB = -lcudart
meam_SYSLIB = -lgfortran
reax_SYSLIB = -lgfortran
user-atc_SYSLIB = -lblas -llapack
gpu_SYSPATH = -L/usr/local/cuda/lib64
meam_SYSPATH =
reax_SYSPATH =
user-atc_SYSPATH =
# ---------------------------------------------------------------------
# build rules and dependencies
# no need to edit this section
include Makefile.package
EXTRA_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
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
# Compilation rules
%.o:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) -c $<
%.d:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@
# Individual dependencies
DEPENDS = $(OBJ:.o=.d)
include $(DEPENDS)
===============================================================
2015年09月24日 01点09分
1
2. $ sudo apt-get install g++ libmpich1.0-dev openssh-server mpich-bin
3. 如果有安裝 libmpich-mpd1.0-dev, libmpich-shmem1.0-dev, mpich2, mpich2-doc, mpich-mpd-bin mpich-shmem-bin的話,請用sudo apt-get remove --purge <package name>移除.
4. $ ifconfig|grep "inet addr" #把左上角的IP記下來
$ gksudo gedit /etc/hosts #把電腦名稱前面的那個IP(通常是127.0.1.1),用上個步驟所記得的IP換掉
5. $ sudo useradd -m -s /bin/bash cluster
$ sudo passwd cluster #輸入密碼,建議與系統密碼相同
$ sudo su - cluster -c "mkdir ~/bin;export PATH=~/bin:$PATH"
6. 安裝fftw-2.1.5
$ tar -zxvf fftw-2.1.5.tar.gz
$ cd fftw-2.1.5
$ ./configure --prefix=/<PATH>/ --enable-float #<PATH>是fftw安裝的位置
$ make
$ sudo make install
7. 安裝mpich-1.2.7p1
$ tar -zxvf mpich-1.2.7p1.tar.gz
$ cd mpich-1.2.7p1
$ ./configure --prefix=/<PATH>/ #<PATH>是mpich安裝的位置,中途請輸入yes與密碼,建議與系統密碼相同
$ make
$ sudo make install
8. 安裝lammps
$ tar -zxvf lammps.tar.gz
修改/lammps-<version>/src/MAKE/Makefile.g++ #範例在步驟10
$ cd lammps-<version>/src
$ make g++
9. 找一個project來測試
$ mpirun -np 8 ./lmp_g++ < in.script
一開始跳出的視窗,請輸入yes,接著輸入host的密碼(就是上述步驟所設定的),lammps就開始動啦~~
可以用top的指令來看lmp_g++在運作的程序,會有另一番爽感~
10. Makefile.g++, 注意<PATH>的部分要換成相應的路徑
===============================================================
# g++ = RedHat Linux box, g++4, gfortran, MPICH2, FFTW
SHELL = /bin/sh
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler
CC = g++
CCFLAGS = -g -O
DEPFLAGS = -M
LINK = g++
LINKFLAGS = -g -O
LIB =
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
MPI_INC = -DMPICH_SKIP_MPICXX -I/<PATH>/include
MPI_PATH = -L/<PATH>/lib
MPI_LIB = -lmpich -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 -I/<PATH>/include
FFT_PATH = -L/<PATH>/fftw/lib
FFT_LIB = -lfftw
# additional system libraries needed by 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 libraries
gpu_SYSLIB = -lcudart
meam_SYSLIB = -lgfortran
reax_SYSLIB = -lgfortran
user-atc_SYSLIB = -lblas -llapack
gpu_SYSPATH = -L/usr/local/cuda/lib64
meam_SYSPATH =
reax_SYSPATH =
user-atc_SYSPATH =
# ---------------------------------------------------------------------
# build rules and dependencies
# no need to edit this section
include Makefile.package
EXTRA_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
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
# Compilation rules
%.o:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) -c $<
%.d:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@
# Individual dependencies
DEPENDS = $(OBJ:.o=.d)
include $(DEPENDS)
===============================================================