build.sh 3.68 KB
Newer Older
incardon's avatar
incardon committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#! /bin/bash

# Make a directory in /tmp/OpenFPM_pdata

echo "Directory: $1"
echo "Machine: $2"

mkdir src/config

git submodule init
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi

git submodule update
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi

mkdir openfpm_numerics/src/config


if [ "$2" == "gin" ]
then
 echo "Compiling on gin\n"
 source ~/.bashrc
 module load gcc/4.9.2
incardon's avatar
incardon committed
30
 mkdir $HOME/$5
incardon's avatar
incardon committed
31
 if [ x"$4" == x"full" ]; then
incardon's avatar
incardon committed
32
  ./install -i $HOME/$5  -s -c "--prefix=/home/jenkins/openfpm_install"
incardon's avatar
incardon committed
33
 elif [ x"$3" == x"numerics" ]; then
incardon's avatar
incardon committed
34
  ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install"
35
  make $3
incardon's avatar
incardon committed
36
 else
incardon's avatar
incardon committed
37
  ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install --no-recursion"
incardon's avatar
incardon committed
38
  make $3
incardon's avatar
incardon committed
39
 fi
incardon's avatar
incardon committed
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
 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

 source $HOME/openfpm_vars

 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" == "wetcluster" ]
then
 echo "Compiling on wetcluster"

## produce the module path

 source ~/.bashrc
 module load gcc/4.9.2
 module load openmpi/1.8.1
 module load boost/1.54.0

 sh ./autogen.sh
64
 ./install -m -s -c "--with-boost=/sw/apps/boost/1.54.0/ CXX=mpic++ --no-recursion"
incardon's avatar
incardon committed
65
 make $3
incardon's avatar
incardon committed
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86

 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
87 88
 mkdir /scratch/p_ppm/$5
 ./install -m -i "/scratch/p_ppm/$5" -s -c"CXX=mpic++ --no-recursion"
incardon's avatar
incardon committed
89
 make $3
incardon's avatar
incardon committed
90 91 92 93 94 95 96 97 98 99

 source $HOME/openfpm_vars

 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
100

incardon's avatar
incardon committed
101
 mkdir $HOME/$5
incardon's avatar
incardon committed
102
 if [ x"$4" == x"full" ]; then
incardon's avatar
incardon committed
103
  ./install -i $HOME/$5  -s -c "--prefix=/Users/jenkins/openfpm_install"
incardon's avatar
incardon committed
104
 elif [ x"$3" == x"numerics" ]; then
incardon's avatar
incardon committed
105
  ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install"
106
  make $3
incardon's avatar
incardon committed
107
 else
incardon's avatar
incardon committed
108
  ./install -i $HOME/$5 -m -s -c "--prefix=/Users/jenkins/openfpm_install --no-recursion"
incardon's avatar
incardon committed
109
  make $3
incardon's avatar
incardon committed
110
 fi
incardon's avatar
incardon committed
111 112 113 114 115 116 117 118 119

 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