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

# Make a directory in /tmp/OpenFPM_pdata

echo "Directory: $1"
echo "Machine: $2"
incardon's avatar
incardon committed
7
echo "Branch name: $5"
incardon's avatar
incardon committed
8 9 10 11 12 13 14 15

mkdir src/config
mkdir openfpm_numerics/src/config


if [ "$2" == "gin" ]
then
 echo "Compiling on gin\n"
incardon's avatar
incardon committed
16

incardon's avatar
incardon committed
17 18
 source ~/.bashrc
 module load gcc/4.9.2
incardon's avatar
incardon committed
19
 mkdir $HOME/$5
incardon's avatar
incardon committed
20
 if [ x"$4" == x"full" ]; then
incardon's avatar
incardon committed
21
  ./install -i $HOME/$5  -s -c "--prefix=/home/jenkins/openfpm_install"
22 23
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
incardon's avatar
incardon committed
24
 elif [ x"$3" == x"numerics" ]; then
25 26 27
  ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install"
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
28
  make $3
incardon's avatar
incardon committed
29
 else
incardon's avatar
incardon committed
30
  ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install --no-recursion"
31 32
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
incardon's avatar
incardon committed
33
  make $3
incardon's avatar
incardon committed
34
 fi
35

incardon's avatar
incardon committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
   exit 1 ;
 fi


 if [ $? -ne 0 ]; then
   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
   exit 1 ; 
 fi

elif [ "$2" == "taurus" ]
then
 echo "Compiling on taurus"

 source /etc/profile
 echo "$PATH"
 module load eigen/3.2.0
 module load suitesparse/4.2.1-gnu-multimkl
 module load boost/1.60.0
 module load gcc/5.3.0
 module load openmpi/1.10.2-gnu
 module unload bullxmpi
 
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/incard/PARMETIS/lib:/home/incard/METIS/lib:/home/incard/HDF5/lib"

incardon's avatar
incardon committed
62
 mkdir /scratch/p_ppm/$5
incardon's avatar
incardon committed
63
 ./install -m -i "/scratch/p_ppm/$5" -s -c"CXX=mpic++ --no-recursion"
64
 mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
65
 source $HOME/openfpm_vars_$5
incardon's avatar
incardon committed
66
 make $3
incardon's avatar
incardon committed
67 68 69 70 71 72 73 74 75


 if [ $? -ne 0 ]; then
   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
   exit 1 ; 
 fi
else
 echo "Compiling general"
 source ~/.bashrc
incardon's avatar
incardon committed
76

incardon's avatar
incardon committed
77
 mkdir $HOME/$5
incardon's avatar
incardon committed
78
 if [ x"$4" == x"full" ]; then
incardon's avatar
incardon committed
79
  ./install -i $HOME/$5  -s -c "--prefix=/Users/jenkins/openfpm_install"
80 81
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
incardon's avatar
incardon committed
82
 elif [ x"$3" == x"numerics" ]; then
incardon's avatar
incardon committed
83
  ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install"
84 85
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
86
  make $3
incardon's avatar
incardon committed
87
 else
incardon's avatar
incardon committed
88
  ./install -i $HOME/$5 -m -s -c "--prefix=/Users/jenkins/openfpm_install --no-recursion"
89 90
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
incardon's avatar
incardon committed
91
  make $3
incardon's avatar
incardon committed
92
 fi
incardon's avatar
incardon committed
93 94 95 96 97 98 99 100 101

 if [ $? -ne 0 ]; then
   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
   exit 1 ;
 fi

fi