build.sh 2.07 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 14 15 16 17 18 19 20
if [ ! -d $HOME/openfpm_dependencies/openfpm_data/BOOST ]; then
	if [ "$2" == x"mac" ]; then
        	./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_data/ 4 darwin
	else
		./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_data 4 gcc
	fi
fi

incardon's avatar
incardon committed
21 22 23 24 25 26
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
27
git clone https://git.mpi-cbg.de/openfpm/openfpm_devices.git openfpm_devices
incardon's avatar
incardon committed
28
cd openfpm_devices
incardon's avatar
incardon committed
29
git checkout GPU_test
incardon's avatar
incardon committed
30
cd ..
incardon's avatar
incardon committed
31 32 33 34 35

cd "$1/openfpm_data"

pre_command=""
sh ./autogen.sh
36
options="$options --disable-gpu "
incardon's avatar
incardon committed
37
options="$options --with-boost=$HOME/openfpm_dependencies/openfpm_data/BOOST  --with-libhilbert=$HOME/openfpm_dependencies/openfpm_data/LIBHILBERT"
incardon's avatar
incardon committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

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
55
make VERBOSE=1
incardon's avatar
incardon committed
56 57 58 59 60 61

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