build.sh 2.64 KB
Newer Older
incardon's avatar
incardon committed
1 2 3
#! /bin/bash

# Make a directory in /tmp/openfpm_data
incardon's avatar
incardon committed
4
#
incardon's avatar
incardon committed
5

incardon's avatar
incardon committed
6 7 8 9
workspace=$1
hostname=$(hostname)
branch=$3

incardon's avatar
incardon committed
10

incardon's avatar
incardon committed
11 12 13
echo "Directory: $workspace"
echo "Machine: $hostname"
echo "Branch: $branch"
incardon's avatar
incardon committed
14

incardon's avatar
incardon committed
15

incardon's avatar
incardon committed
16 17 18 19 20 21
mkdir /tmp/openfpm_vcluster
mv * .[^.]* /tmp/openfpm_vcluster
mv /tmp/openfpm_vcluster openfpm_vcluster

mkdir openfpm_vcluster/src/config

incardon's avatar
incardon committed
22 23
## It is equivalent to the git modules

incardon's avatar
incardon committed
24 25
git clone git@git.mpi-cbg.de:/openfpm/openfpm_devices.git openfpm_devices
git clone git@git.mpi-cbg.de:/openfpm/openfpm_data.git openfpm_data
26
cd openfpm_data
incardon's avatar
incardon committed
27
git checkout master
28 29
cd ..
cd openfpm_devices
incardon's avatar
incardon committed
30
git checkout master
31
cd ..
incardon's avatar
incardon committed
32

incardon's avatar
incardon committed
33
cd "$workspace/openfpm_vcluster"
incardon's avatar
incardon committed
34

incardon's avatar
incardon committed
35 36 37 38 39 40 41 42
# install MPI and BOOST  LIBHILBERT if needed

if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/LIBHILBERT ]; then
        ./install_LIBHILBERT.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
fi


if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/BOOST ]; then
incardon's avatar
incardon committed
43
        if [ x"$hostname" == x"cifarm-mac-node" ]; then
incardon's avatar
incardon committed
44 45 46 47 48 49 50 51 52 53
                echo "Compiling for OSX"
                ./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4 darwin
        else
                echo "Compiling for Linux"
                ./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4 gcc
        fi
fi


if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/MPI ]; then
incardon's avatar
incardon committed
54
	./install_MPI.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
incardon's avatar
incardon committed
55 56
fi

incardon's avatar
incardon committed
57
export PATH="$PATH:$HOME/openfpm_dependencies/openfpm_vcluster/MPI/bin"
58

incardon's avatar
incardon committed
59
if [ "$hostname" == "gin" ]; then
incardon's avatar
incardon committed
60 61 62 63
 echo "Compiling on gin\n"
 module load gcc/4.9.2
 module load openmpi/1.8.1

incardon's avatar
incardon committed
64
elif [ "$hostname" == "wetcluster" ]; then
incardon's avatar
incardon committed
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
 echo "Compiling on wetcluster"

## produce the module path

 export MODULEPATH="/sw/apps/modules/modulefiles:$MODULEPATH"

 script="module load gcc/4.9.2\n 
module load openmpi/1.8.1\n
module load boost/1.54.0\n
compile_options='--with-boost=/sw/apps/boost/1.54.0/'\n
\n
sh ./autogen.sh\n
sh ./configure \"\$compile_options\"  CXX=mpic++\n
make\n
if [ \"\$?\" = "0" ]; then exit 1 ; fi\n
exit(0)\n"

 echo $script | sed -r 's/\\n/\n/g' > compile_script

 bsub -o output_compile.%J -K -n 1 -J compile sh ./compile_script

incardon's avatar
incardon committed
86
elif [ "$hostname" == "taurus" ]; then
incardon's avatar
incardon committed
87 88 89 90 91 92 93 94 95
 echo "Compiling on taurus"

 echo "$PATH"
 module load gcc/5.3.0
 module load boost/1.60.0
 module load openmpi/1.10.2-gnu
 module unload bullxmpi

 sh ./autogen.sh
incardon's avatar
incardon committed
96
 sh ./configure  CXX=mpic++
incardon's avatar
incardon committed
97 98 99 100 101 102 103 104 105 106 107
 make
 if [ $? -ne 0 ]; then exit 1 ; fi

### to exclude --exclude=taurusi[6300-6400],taurusi[5400-5500]

else

 source $HOME/.bashrc
 echo "$PATH"
 echo "Compiling general"
 sh ./autogen.sh
incardon's avatar
incardon committed
108
 sh ./configure  CXX=mpic++ --with-boost=$HOME/openfpm_dependencies/openfpm_vcluster/BOOST
incardon's avatar
incardon committed
109
 make VERBOSE=1 -j 4
incardon's avatar
incardon committed
110 111 112 113
 if [ $? -ne 0 ]; then exit 1 ; fi

fi