#! /bin/bash ## Install lammps (version xxx) ## Default location is dir=$HOME/ii ## Execute this in $dir/script/ ## Assure that python-devel.x86_64 is installed. Check this out by typing 'which python-config'. If it returns /usr/bin/python-config, then it is fine. Else yum install iy python-devel.x86_64 or sudo apt-get -y install python-dev. ## Mandatory requirements: ## $dir/openmpi-1.8.5 ## $dir/fftw-3.3.4 ## -L/$dir/lib/ -llapack -lblas export dir=/home/$(whoami)/ii #export PATH=$dir/python/bin:$PATH cd $dir if [ -d $dir/configrepo ]; then echo "$dir/configrepo" existed else mkdir $dir/configrepo fi ####### begin installation #################################################### cd $dir/ rm -rf lammps_5May15.tgz wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/lammps/lammps_5May15.tgz tar -zxvf lammps_5May15.tgz mv lammps_5May15.tgz configrepo cd lammps_5May15 mylammpsdir=$(echo $PWD) # atc # cd $mylammpsdir/lib cd atc rm -f *.a *.o #mv Makefile.mpic++ Makefile.mpic++.orig #wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/lammps/Makefile.lammps.installed.atc #wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/lammps/Makefile.lammps.installed.atc #rm -rf Makefile.lammps.installed #cp Makefile.lammps.installed.atc Makefile.lammps.installed #wget Makefile.mpic++ make -f Makefile.mpic++ cd $mylammpsdir/lib/awpmd #wget http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/lammps/Makefile.lammps.installed.awpmd #rm -rf Makefile.lammps.installed #cp Makefile.lammps.installed.awpmd Makefile.lammps.installed make -f Makefile.mpicc # linalg # cd $mylammpsdir/lib/linalg rm -f *.a *.o make -f Makefile.gfortran # gpu ## Make only if NVIDIA CUDA is available on the machine cd $mylammpsdir/lib if [ -d "$mylammpsdir/lib/gpu" ];then cd gpu echo 'I am in gpu/' str=$(which nvcc) if [ ! "$str" ];then echo 'make no gpu' echo str= $str else echo 'make gpu' rm -f *.a *.o make -f Makefile.linux.double fi fi # cuda ## Make only if NVIDIA CUDA is available on the machine cd $mylammpsdir/lib if [ -d "$mylammpsdir/lib/cuda" ];then cd gpu echo 'I am in cuda/' str=$(which nvcc) if [ ! "$str" ];then echo 'make no cuda' echo str= $str else echo 'make cuda' rm -f *.a *.o make fi fi # meam # cd $mylammpsdir/lib cd meam rm -f *.a *.o make -f Makefile.gfortran # poems # cd $mylammpsdir/lib cd poems rm -f *.a *.o make -f Makefile.g++ # reax # cd $mylammpsdir/lib/reax rm -f *.a *.o make -f Makefile.gfortran cd $mylammpsdir/lib/qmmm rm -f *.a *.o make -f Makefile.gfortran cd $mylammpsdir/lib/colvars rm -f *.a *.o make -f Makefile.g++ cd $mylammpsdir/lib/colvars rm -f *.a *.o make -f Makefile.g++ cd $mylammpsdir/lib/voronoi rm -rf includelink liblink python install.py -d ~/ii/configrepo/voronoi-build -g -b -i ~/ii/voronoi rm -rf includelink ln -s $dir/voronoi/include/voro++ includelink # Now exit /lib cd $mylammpsdir/src make yes-all make yes-voronoi make no-kim make no-user-quip make no-kokkos # gpu ## Make only if NVIDIA CUDA is available on the machine if [ -d "$mylammpsdir/lib/gpu" ];then str=$(which nvcc) if [ ! "$str" ];then make no-gpu else make yes-gpu fi fi # cuda ## Make only if NVIDIA CUDA is available on the machine if [ -d "$mylammpsdir/lib/cuda" ];then str=$(which nvcc) if [ ! "$str" ];then make no-user-cuda else make yes-user-cuda fi fi rm -rf lmp_gnu make gnu ln -s lmp_gnu lmp_ii ln -s $mylammpsdir/src/lmp_gnu $dir/bin/lmp_ii