#! /bin/bash # This script installs mylammps in /share/apps. It is specially designed to work for Rocks Linux 5.3. It should theoretically work for Rocks of other version. This script must be run as su. ## It is assumed that fftw3 and mpich2 are already properly installed. fftw2 is assumed to be install in /shara/apps/fftw3, while mpich2 in /share/apps/mpich2-install. ## Also mandatory to have lapack and blas installed in /shara/apps. For this script to work, lapack and blas must have already been install in /share/apps/lapack-3.4.1 and /share/apps/blas respectively. ## For BLAS library: ## To intall blas in /share/apps/blas, simply execute the script http://www2.fizik.usm.my/configrepo/howto/BLAS_and_LAPACK/inst_blas as su in the terminal. The script will automaticaly install blas by downloading the source code from http://www.netlib.org/blas/blas.tgz. # Installation of lapack is a bit tricky. For detail refere to http://www2.fizik.usm.my/configrepo/howto/BLAS_and_LAPACK/inst_lapack ## This script assume the lapack library is to be found in /share/apps/lapack-3.4.1. # This script will create a folder mylamps in /share/apps/mylammps # Choose either scp from www2 (not current version) or git (current/latest version) or wget. By default, wget is used. # Make sure you have git installed, or yum install git.x86_64 as root, if you wish to download with git clone (instead of scp) ######### begin downloading ########################### cd /share/apps # Use either Option 1 or Option 2, but not both to download the mylammps. By default, Option 2 is used. Option 2 is faster but it does not contains the lastest version of mylammps. Option 1 is slower but it downloads directly the latest version from the source in the web. ## Option 1. Uncomment if want to use this option. # git clone http://git.icms.temple.edu/lammps-ro.git mylammps ## End of Option 1 ## Option 2. Default option. wget -r -l1 --no-parent -A.tar.gz http://www2.fizik.usm.my/configrepo/howto/mylammps/ cp www2.fizik.usm.my/configrepo/howto/mylammps/*.tar.gz . mv lammps*.tar.gz mylammps.tar.gz tar -zxvf mylammps.tar.gz rm -rf www2.fizik.usm.my mylammps.tar.gz ## mkdir mylammps mv lammps* mylammps ## End of Option 2 ####### begin installation #################################################### # atc # cd /share/apps/mylammps cd lib cd atc wget http://www2.fizik.usm.my/configrepo/howto/mylammps/Makefileg++atcR53 mv Makefile.g++ Makefile.g++.bk cp Makefileg++atcR53 Makefile.g++ make -f Makefile.g++ # linalg # cd /share/apps/mylammps/lib cd linalg wget http://www2.fizik.usm.my/configrepo/howto/mylammps/MakefilegfortranlinalgR53 mv Makefile.gfortran Makefile.gfortran.orig mv MakefilegfortranlinalgR53 Makefile.gfortran make -f Makefile.gfortran # meam # cd /share/apps/mylammps/lib cd meam wget http://www2.fizik.usm.my/configrepo/howto/mylammps/Makefile.lammps.R53 mv Makefile.lammps Makefile.lammps.orig mv Makefile.lammps.R53 Makefile.lammps make -f Makefile.gfortran # reax # cd /share/apps/mylammps/lib cd reax wget http://www2.fizik.usm.my/configrepo/howto/mylammps/Makefile.lammps.R53 mv Makefile.lammps Makefile.lammps.orig mv Makefile.lammps.R53 Makefile.lammps make -f Makefile.gfortran # peom # cd /share/apps/mylammps/lib cd poems make -f Makefile.g++ # Now exit /lib cd /share/apps/mylammps/src/MAKE wget http://www2.fizik.usm.my/configrepo/howto/mylammps/Makefile.g++.mylammps.src.MAKE.Rocks53 cp Makefile.g++ Makefile.g++.bk cp Makefile.g++.mylammps.src.MAKE.Rocks53 Makefile.g++ cd /share/apps/mylammps/src/ make yes-all make no-user-cuda make no-gpu make no-user-awpmd make no-kim make g++ # To run mylammps as an user, e.g., tlyoon, do the following: # 1. Create a hosts file in /home/tlyoon, where in /home/tlyoon/hosts contain the list of nodes's name, e.g., compute-0-0, compute-0-1, etc. # 2. Test run an input script, say, /share/apps/mylammps/examples/colloid/in.colloid, using NP = 8 cores, issue the following in your terminal, in say, /home/tlyoon/test # /share/apps/mpich2-install/bin/mpiexec -f ~/hosts -np 8 /share/apps/mylammps/src/lmp_g++ < /share/apps/mylammps/examples/colloid/in.colloid