build.sh 2.94 KB
Newer Older
Pietro Incardona's avatar
Pietro Incardona committed
1
2
3
#! /bin/bash

# Make a directory in /tmp/openfpm_data
Pietro Incardona's avatar
retry    
Pietro Incardona committed
4
#
Pietro Incardona's avatar
Pietro Incardona committed
5

Pietro Incardona's avatar
Pietro Incardona committed
6
7
8
9
10
11
12
workspace=$1
hostname=$(hostname)
branch=$3

echo "Directory: $workspace"
echo "Machine: $hostname"
echo "Branch: $branch"
Pietro Incardona's avatar
Pietro Incardona committed
13

Pietro Incardona's avatar
Pietro Incardona committed
14

Pietro Incardona's avatar
Pietro Incardona committed
15
16
17
18
19
20
mkdir /tmp/openfpm_vcluster
mv * .[^.]* /tmp/openfpm_vcluster
mv /tmp/openfpm_vcluster openfpm_vcluster

mkdir openfpm_vcluster/src/config

21
22
## It is equivalent to the git modules

Pietro Incardona's avatar
Pietro Incardona committed
23
24
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
25
cd openfpm_data
Pietro Incardona's avatar
Pietro Incardona committed
26
git checkout 7b236b204edfe60d6a104da5a9e7e4f0aa1d6c90
27
28
cd ..
cd openfpm_devices
Pietro Incardona's avatar
Pietro Incardona committed
29
git checkout d956f9fd5bea586ee6281a483e3f0d5fa93a5415
30
cd ..
Pietro Incardona's avatar
Pietro Incardona committed
31

Pietro Incardona's avatar
Pietro Incardona committed
32
cd "$workspace/openfpm_vcluster"
Pietro Incardona's avatar
Pietro Incardona committed
33

34
35
36
37
38
39
40
41
# 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
Pietro Incardona's avatar
Pietro Incardona committed
42
        if [ x"$hostname" == x"cifarm-mac-node" ]; then
43
44
45
46
47
48
49
50
51
52
                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
Pietro Incardona's avatar
Pietro Incardona committed
53
        if [ x"$hostname" == x"cifarm-mac-node" ]; then
54
55
56
57
58
59
60
61
                echo "Compiling for OSX"
                ./install_MPI.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
        else
                echo "Compiling for Linux"
                ./install_MPI.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
        fi
fi

Pietro Incardona's avatar
Pietro Incardona committed
62
export PATH="$PATH:$HOME/openfpm_dependencies/openfpm_vcluster/MPI/bin"
63

Pietro Incardona's avatar
Pietro Incardona committed
64
if [ "$hostname" == "gin" ]; then
Pietro Incardona's avatar
Pietro Incardona committed
65
66
67
68
 echo "Compiling on gin\n"
 module load gcc/4.9.2
 module load openmpi/1.8.1

Pietro Incardona's avatar
Pietro Incardona committed
69
elif [ "$hostname" == "wetcluster" ]; then
Pietro Incardona's avatar
Pietro Incardona committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
 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

Pietro Incardona's avatar
Pietro Incardona committed
91
elif [ "$hostname" == "taurus" ]; then
Pietro Incardona's avatar
Pietro Incardona committed
92
93
94
95
96
97
98
99
100
 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
Pietro Incardona's avatar
Pietro Incardona committed
101
 sh ./configure  CXX=mpic++
Pietro Incardona's avatar
Pietro Incardona committed
102
103
104
105
106
107
108
109
110
111
112
 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
Pietro Incardona's avatar
Pietro Incardona committed
113
 sh ./configure  CXX=mpic++ --with-boost=$HOME/openfpm_dependencies/openfpm_vcluster/BOOST
Pietro Incardona's avatar
Pietro Incardona committed
114
115
116
117
118
 make
 if [ $? -ne 0 ]; then exit 1 ; fi

fi