build.sh 2.14 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

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

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

cd "$1/openfpm_data"

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

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
58
make
incardon's avatar
incardon committed
59 60 61 62 63 64

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

65 66 67
ls build/src/mem_map