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


4
5
6
7
8
9
10
workspace=$1
hostname=$(hostname)
branch=$3

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

12
echo "Branch: $3"
Pietro Incardona's avatar
Pietro Incardona committed
13
14
15
16
17
18
19
20

# Make a directory in /tmp/openfpm_data

mkdir /tmp/openfpm_io
mv * .[^.]* /tmp/openfpm_io
mv /tmp/openfpm_io openfpm_io

git clone git@git.mpi-cbg.de:openfpm/openfpm_devices.git openfpm_devices
Pietro Incardona's avatar
Pietro Incardona committed
21
cd openfpm_devices
22
git checkout master
Pietro Incardona's avatar
Pietro Incardona committed
23
cd ..
Pietro Incardona's avatar
Pietro Incardona committed
24
git clone git@git.mpi-cbg.de:openfpm/openfpm_data.git openfpm_data
Pietro Incardona's avatar
Pietro Incardona committed
25
cd openfpm_data
26
git checkout master
Pietro Incardona's avatar
Pietro Incardona committed
27
cd ..
Pietro Incardona's avatar
Pietro Incardona committed
28
git clone git@git.mpi-cbg.de:openfpm/openfpm_pdata.git openfpm_pdata
Pietro Incardona's avatar
Pietro Incardona committed
29
cd openfpm_pdata
30
git checkout master
Pietro Incardona's avatar
Pietro Incardona committed
31
cd ..
Pietro Incardona's avatar
Pietro Incardona committed
32
git clone git@git.mpi-cbg.de:openfpm/openfpm_vcluster.git openfpm_vcluster
Pietro Incardona's avatar
Pietro Incardona committed
33
cd openfpm_vcluster
34
git checkout master
Pietro Incardona's avatar
Pietro Incardona committed
35
cd ..
Pietro Incardona's avatar
Pietro Incardona committed
36

Pietro Incardona's avatar
Pietro Incardona committed
37
38
cd "$1/openfpm_io"

Pietro Incardona's avatar
Pietro Incardona committed
39

40
if [ x"$hostname" == x"cifarm-centos-node.mpi-cbg.de"  ]; then
41
        ./install_MPI_mpich.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
Pietro Incardona's avatar
Pietro Incardona committed
42
	export PATH="$HOME/openfpm_dependencies/openfpm_io/$branch/MPI/bin/:$PATH"
43
44
45
46
        ./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
	./install_HDF5.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
fi

47
if [ x"$hostname" == x"cifarm-ubuntu-node"  ]; then
48
        ./install_MPI_mpich.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
Pietro Incardona's avatar
Pietro Incardona committed
49
	export PATH="$HOME/openfpm_dependencies/openfpm_io/$branch/MPI/bin/:$PATH"
50
51
52
53
	./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
	./install_HDF5.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
fi

54
if [ x"$hostname" == x"cifarm-mac-node.mpi-cbg.de"  ]; then
55
56
        export PATH="/usr/local/bin:$PATH"
        ./install_MPI_mpich.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
Pietro Incardona's avatar
Pietro Incardona committed
57
	export PATH="$HOME/openfpm_dependencies/openfpm_io/$branch/MPI/bin/:$PATH"
58
59
60
61
	./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
	./install_HDF5.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
fi

Pietro Incardona's avatar
Pietro Incardona committed
62
63
# Go in the right branch

Pietro Incardona's avatar
Pietro Incardona committed
64
65
66
67
68
echo "Compiling on $2"

sh ./autogen.sh
if [ "$2" == "master" ]
then
Pietro Incardona's avatar
Pietro Incardona committed
69
 sh ./configure CXX=mpic++ --with-hdf5=$HOME/$3/HDF5/bin/h5pcc --disable-gpu
Pietro Incardona's avatar
Pietro Incardona committed
70
71
72
73
elif [ "$2" == "gin" ]
then
 module load gcc/4.8.2
 module load boost/1.54.0
Pietro Incardona's avatar
Pietro Incardona committed
74
 sh ./configure CXX=mpic++ --with-boost=/sw/apps/boost/1.54.0/ --with-hdf5=$HOME/$3/HDF5/bin/h5pcc
Pietro Incardona's avatar
Pietro Incardona committed
75
else
Pietro Incardona's avatar
Pietro Incardona committed
76
 sh ./configure CXX=mpic++ --with-hdf5=$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5 --with-boost=$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST --with-pdata=../../openfpm_pdata/
Pietro Incardona's avatar
Pietro Incardona committed
77
fi
Pietro Incardona's avatar
Pietro Incardona committed
78

Pietro Incardona's avatar
Pietro Incardona committed
79
make VERBOSE=1 -j 4
Pietro Incardona's avatar
Pietro Incardona committed
80
81
82
83
84
85

if [ $? -ne 0 ]; then
   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to compile the openfpm_io test \" }] }" https://hooks.slack.com/services/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
   exit 1 ; 
fi