build.sh 2.69 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
workspace=$1
hostname=$(hostname)
branch=$3

Pietro Incardona's avatar
Pietro Incardona committed
10

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

Pietro Incardona's avatar
Pietro Incardona committed
15

Pietro Incardona's avatar
Pietro Incardona 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

22
23
## It is equivalent to the git modules

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

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

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
Pietro Incardona's avatar
Pietro Incardona committed
43
        if [ x"$hostname" == x"cifarm-mac-node" ]; then
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
Pietro Incardona's avatar
Pietro Incardona committed
54
	./install_MPI.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
55
56
fi

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

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

Pietro Incardona's avatar
Pietro Incardona committed
64
elif [ "$hostname" == "wetcluster" ]; then
Pietro Incardona's avatar
Pietro Incardona 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

Pietro Incardona's avatar
Pietro Incardona committed
86
elif [ "$hostname" == "taurus" ]; then
Pietro Incardona's avatar
Pietro Incardona 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
Pietro Incardona's avatar
Pietro Incardona committed
96
 sh ./configure  CXX=mpic++
Pietro Incardona's avatar
Pietro Incardona 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
Pietro Incardona's avatar
Pietro Incardona committed
108
 sh ./configure  CXX=mpic++ --with-boost=$HOME/openfpm_dependencies/openfpm_vcluster/BOOST
Pietro Incardona's avatar
Pietro Incardona committed
109
110
111
112
113
 make
 if [ $? -ne 0 ]; then exit 1 ; fi

fi