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

# Make a directory in /tmp/openfpm_data

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

incardon's avatar
incardon committed
10
echo "Build on: $hostname with $type_compile branch: $branch"
incardon's avatar
incardon committed
11

incardon's avatar
incardon committed
12 13 14
# Check if libHilbert is installed

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

incardon's avatar
incardon committed
18

incardon's avatar
incardon committed
19
if [ ! -d $HOME/openfpm_dependencies/openfpm_data/BOOST ]; then
incardon's avatar
incardon committed
20
	if [ x"$hostname" == x"cifarm-mac-node" ]; then
incardon's avatar
incardon committed
21
		echo "Compiling for OSX"
incardon's avatar
incardon committed
22
        	./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_data/ 4 darwin
incardon's avatar
incardon committed
23
	else
incardon's avatar
incardon committed
24
		echo "Compiling for Linux"
incardon's avatar
incardon committed
25
		./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_data 4 gcc
incardon's avatar
incardon committed
26 27 28
	fi
fi

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

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 master
incardon's avatar
incardon committed
38
cd ..
incardon's avatar
incardon committed
39

incardon's avatar
incardon committed
40
cd "$workspace/openfpm_data"
incardon's avatar
incardon committed
41 42 43

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

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
incardon's avatar
incardon committed
60
    curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$hostname failed to comfigure openfpm_data test $opt_comp \" }] }" https://hooks.slack.com/services/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
incardon's avatar
incardon committed
61 62
    exit 1
fi
63
make
incardon's avatar
incardon committed
64 65

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

70 71 72
ls build/src/mem_map