Created
December 3, 2015 04:50
-
-
Save pvanheus/9a418153337e1b33dc6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ge 1 ] ; then | |
STEP=$# | |
else | |
STEP=1 | |
fi | |
if [ $# -ge 2 ] ; then | |
MODE=$2 | |
else | |
MODE=intelmpi | |
fi | |
if [ $MODE == "intelmpi" ] ; then | |
source /opt/intel/bin/compilervars.sh intel64 | |
CC=icc | |
CXX=icpc | |
FC=ifort | |
FCFLAGS=-m64 | |
F77=ifort | |
FFLAGS=-m64 | |
elif [ $MODE == "openmpi" ] ; then | |
module add openmpi-x86_64 | |
CC=gcc | |
CXX=g++ | |
FC=gfortran | |
FCFLAGS=-m64 | |
F77=gfortran | |
FFLAGS=-m64 | |
fi | |
export CC CXX FC FCFLAGS F77 FFLAGS | |
PREFIX=/opt/$MODE/GADGET2 | |
GSLURL=http://gnu.afri.cc/gsl/gsl-1.9.tar.gz | |
FFTWURL=http://www.fftw.org/fftw-2.1.5.tar.gz | |
GADGETURL=http://wwwmpa.mpa-garching.mpg.de/gadget/gadget-2.0.7.tar.gz | |
if [ $STEP -le 1 ] ; then | |
wget -c $GSLURL | |
wget -c $FFTWURL | |
wget -c $GADGETURL | |
fi | |
if [ $STEP -le 2 ] ; then | |
TAR=$(echo $GSLURL|sed 's^.*/^^') | |
DIR=$(echo $TAR|sed 's/.tar.gz$//') | |
tar xf $TAR | |
( cd $DIR ; ./configure --prefix=$PREFIX && make -j4 && make install ) | |
fi | |
if [ $STEP -le 3 ] ; then | |
TAR=$(echo $FFTWURL|sed 's^.*/^^') | |
DIR=$(echo $TAR|sed 's/.tar.gz$//') | |
tar xf $TAR | |
(cd $DIR ; ./configure --prefix=$PREFIX --enable-mpi --enable-type-prefix --enable-float && make -j4 && make install ) | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment