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

# Make a directory in /tmp/openfpm_data

5
echo "Build on: $2 with $4 branch $5"
incardon's avatar
incardon committed
6

incardon's avatar
incardon committed
7 8 9
# Check if libHilbert is installed

if [ ! -d $HOME/openfpm_dependencies/openfpm_data/LIBHILBERT ]; then
incardon's avatar
incardon committed
10
	./install_LIBHILBERT.sh $HOME/openfpm_dependencies/openfpm_data/ 4
incardon's avatar
incardon committed
11 12
fi

incardon's avatar
incardon committed
13
rm -rf $HOME/openfpm_dependencies/openfpm_data/BOOST
incardon's avatar
incardon committed
14

incardon's avatar
incardon committed
15
if [ ! -d $HOME/openfpm_dependencies/openfpm_data/BOOST ]; then
incardon's avatar
incardon committed
16
	if [ x"$2" == x"mac," ]; then
incardon's avatar
incardon committed
17
		echo "Compiling for OSX"
incardon's avatar
incardon committed
18
#        	./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_data/ 4 darwin
incardon's avatar
incardon committed
19
	else
incardon's avatar
incardon committed
20
		echo "Compiling for Linux"
incardon's avatar
incardon committed
21
#		./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_data 4 gcc
incardon's avatar
incardon committed
22 23 24
	fi
fi

incardon's avatar
incardon committed
25 26
exit 1

incardon's avatar
incardon committed
27 28
ls $HOME/openfpm_dependencies/openfpm_data/BOOST/lib

incardon's avatar
incardon committed
29 30 31 32 33 34
mkdir /tmp/openfpm_data_$3
mv * .[^.]* /tmp/openfpm_data_$3
mv /tmp/openfpm_data_$3 openfpm_data

mkdir openfpm_data/src/config

incardon's avatar
Test  
incardon committed
35
git clone https://git.mpi-cbg.de/openfpm/openfpm_devices.git openfpm_devices
incardon's avatar
incardon committed
36
cd openfpm_devices
incardon's avatar
incardon committed
37
git checkout GPU_test
incardon's avatar
incardon committed
38
cd ..
incardon's avatar
incardon committed
39 40 41 42 43

cd "$1/openfpm_data"

pre_command=""
sh ./autogen.sh
44
options="$options --disable-gpu "
incardon's avatar
incardon committed
45
options="$options --with-boost=$HOME/openfpm_dependencies/openfpm_data/BOOST  --with-libhilbert=$HOME/openfpm_dependencies/openfpm_data/LIBHILBERT"
incardon's avatar
incardon committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

if [ x"$3" == x"SE"  ]; then
  options="$options --enable-se-class1 --enable-se-class2 --enable-se-class3 --with-action-on-error=throw --enable-test-coverage"
  opt_comp="for security enhancement"
fi

if [ x"$3" == x"VALGRIND" ]; then
  pre_command="valgrind --leak-check=full"
  options="$options --disable-gpu --enable-test-coverage"
  opt_comp="for valgrind test"
fi

sh ./configure $options
if [ $? -ne 0 ]; then
    curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to comfigure openfpm_data test $opt_comp \" }] }" https://hooks.slack.com/services/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
    exit 1
fi
incardon's avatar
incardon committed
63
make VERBOSE=1
incardon's avatar
incardon committed
64 65 66 67 68 69

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_data test $opt_comp \" }] }" https://hooks.slack.com/services/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
    exit 1
fi