build.sh 1.75 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
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
19
git clone https://git.mpi-cbg.de/openfpm/openfpm_devices.git openfpm_devices
incardon's avatar
incardon committed
20
cd openfpm_devices
incardon's avatar
incardon committed
21
git checkout GPU_test
incardon's avatar
incardon committed
22
cd ..
incardon's avatar
incardon committed
23 24 25 26 27

cd "$1/openfpm_data"

pre_command=""
sh ./autogen.sh
28 29
options="$options --disable-gpu "
options="$options --with-libhilbert=$HOME/openfpm_dependencies/openfpm_data/LIBHILBERT"
incardon's avatar
incardon committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53

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
make

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