build.sh 3.5 KB
Newer Older
1
2
3
4
5
6
#! /bin/bash

# Make a directory in /tmp/OpenFPM_pdata

echo "Directory: $1"
echo "Machine: $2"
Pietro Incardona's avatar
Pietro Incardona committed
7
echo "Branch name: $5"
8

Pietro Incardona's avatar
Latest    
Pietro Incardona committed
9
10
11
12
13
14
15
#### If you have a dep_dir file change the branch name to the dep_dir

dep_dir=$(cat dep_dir)
if [ x"$dep_dir" != x"" ]; then
  set -- "${@:1:4}" "$dep_dir"
fi

16
17
18
19
20
21
22
mkdir src/config
mkdir openfpm_numerics/src/config


if [ "$2" == "gin" ]
then
 echo "Compiling on gin\n"
Pietro Incardona's avatar
Pietro Incardona committed
23

24
25
 source ~/.bashrc
 module load gcc/4.9.2
Pietro Incardona's avatar
Pietro Incardona committed
26
 mkdir $HOME/$5
Pietro Incardona's avatar
Pietro Incardona committed
27
 if [ x"$4" == x"full" ]; then
Pietro Incardona's avatar
Pietro Incardona committed
28
  ./install -i $HOME/$5  -s -c "--prefix=/home/jenkins/openfpm_install"
29
30
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
Pietro Incardona's avatar
Pietro Incardona committed
31
 elif [ x"$3" == x"numerics" ]; then
32
33
34
  ./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
35
  make $3
Pietro Incardona's avatar
Pietro Incardona committed
36
 else
Pietro Incardona's avatar
Pietro Incardona committed
37
  ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install --no-recursion"
38
39
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
Pietro Incardona's avatar
Pietro Incardona committed
40
  make $3
Pietro Incardona's avatar
Pietro Incardona committed
41
 fi
42

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 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"

Pietro Incardona's avatar
Pietro Incardona committed
69
 mkdir /scratch/p_ppm/$5
Pietro Incardona's avatar
Pietro Incardona committed
70
 ./install -m -i "/scratch/p_ppm/$5" -s -c"CXX=mpic++ --no-recursion"
71
 mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
72
 source $HOME/openfpm_vars_$5
Pietro Incardona's avatar
Pietro Incardona committed
73
 make $3
74
75
76
77
78
79
80
81
82


 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
Pietro Incardona's avatar
Pietro Incardona committed
83

Pietro Incardona's avatar
Pietro Incardona committed
84
 mkdir $HOME/$5
Pietro Incardona's avatar
Pietro Incardona committed
85
 if [ x"$4" == x"full" ]; then
Pietro Incardona's avatar
Pietro Incardona committed
86
  ./install -i $HOME/$5  -s -c "--prefix=/Users/jenkins/openfpm_install"
87
88
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
Pietro Incardona's avatar
Pietro Incardona committed
89
 elif [ x"$3" == x"numerics" ]; then
Pietro Incardona's avatar
Pietro Incardona committed
90
  ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install"
91
92
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
93
  make $3
Pietro Incardona's avatar
Pietro Incardona committed
94
 else
Pietro Incardona's avatar
Pietro Incardona committed
95
  ./install -i $HOME/$5 -m -s -c "--prefix=/Users/jenkins/openfpm_install --no-recursion"
96
97
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
Pietro Incardona's avatar
Pietro Incardona committed
98
  make $3
Pietro Incardona's avatar
Pietro Incardona committed
99
 fi
100
101
102
103
104
105
106
107
108

 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