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


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

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

incardon's avatar
incardon committed
12
echo "Branch: $3"
incardon's avatar
incardon 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
incardon's avatar
incardon committed
21 22 23
cd openfpm_devices
git checkout GPU_test
cd ..
incardon's avatar
incardon committed
24
git clone git@git.mpi-cbg.de:openfpm/openfpm_data.git openfpm_data
incardon's avatar
incardon committed
25 26
cd openfpm_data
git checkout GPU_test
incardon's avatar
incardon committed
27
cd ..
incardon's avatar
incardon committed
28
git clone git@git.mpi-cbg.de:openfpm/openfpm_pdata.git openfpm_pdata
incardon's avatar
incardon committed
29
git clone git@git.mpi-cbg.de:openfpm/openfpm_vcluster.git openfpm_vcluster
incardon's avatar
incardon committed
30 31
cd openfpm_vcluster
git checkout GPU_test_new
incardon's avatar
incardon committed
32
cd ..
incardon's avatar
incardon committed
33

incardon's avatar
incardon committed
34 35
cd "$1/openfpm_io"

incardon's avatar
incardon committed
36

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

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

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

incardon's avatar
incardon committed
59 60
# Go in the right branch

incardon's avatar
incardon committed
61 62 63 64 65
echo "Compiling on $2"

sh ./autogen.sh
if [ "$2" == "master" ]
then
incardon's avatar
incardon committed
66
 sh ./configure CXX=mpic++ --with-hdf5=$HOME/$3/HDF5/bin/h5pcc --disable-gpu
incardon's avatar
incardon committed
67 68 69 70
elif [ "$2" == "gin" ]
then
 module load gcc/4.8.2
 module load boost/1.54.0
incardon's avatar
incardon committed
71
 sh ./configure CXX=mpic++ --with-boost=/sw/apps/boost/1.54.0/ --with-hdf5=$HOME/$3/HDF5/bin/h5pcc
incardon's avatar
incardon committed
72
else
incardon's avatar
incardon committed
73
 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/
incardon's avatar
incardon committed
74
fi
incardon's avatar
incardon committed
75 76

echo "-------------------------------"
incardon's avatar
incardon committed
77
ls ../openfpm_vcluster/src/VCluster/VCluster.cpp
incardon's avatar
incardon committed
78 79
echo "-------------------------------"

incardon's avatar
incardon committed
80
make VERBOSE=1 -j 1 
incardon's avatar
incardon committed
81 82 83 84 85 86

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