build.sh 3.88 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

incardon's avatar
Latest  
incardon 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

incardon's avatar
incardon committed
16 17 18 19 20 21 22
mkdir src/config
mkdir openfpm_numerics/src/config


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

incardon's avatar
incardon committed
24 25 26 27
 ## Check if MPI folder exist if not copy MPICH

 if [ ! -d $HOME/$5/MPI ]; then
   echo "COPY MPICH"
incardon's avatar
incardon committed
28
   cp -R $HOME/MPI $HOME/$5/MPI
incardon's avatar
incardon committed
29
   echo 1 > $HOME/$5/MPI/version
incardon's avatar
incardon committed
30 31
 fi

incardon's avatar
incardon committed
32 33 34 35
 ### Activate MPI ###

 export PATH="$PATH:$HOME/$5/MPI/bin"

incardon's avatar
incardon committed
36
 mkdir $HOME/$5
incardon's avatar
incardon committed
37
 if [ x"$4" == x"full" ]; then
incardon's avatar
incardon committed
38
  CC=gcc-4.9.2 CXX=g++-4.9.2 FC=gfortran-4.9.2 F77=gfortran-4.9.2 ./install -i $HOME/$5  -s -c "--prefix=/home/jenkins/openfpm_install"
39 40
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
incardon's avatar
incardon committed
41
 elif [ x"$3" == x"numerics" ]; then
incardon's avatar
incardon committed
42
  CC=gcc-4.9.2 CXX=g++-4.9.2 FC=gfortran-4.9.2 F77=gfortran-4.9.2 ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install"
43 44
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
45
  make $3
incardon's avatar
incardon committed
46
 else
incardon's avatar
incardon committed
47
  CC=gcc-4.9.2 CXX=g++-4.9.2 FC=gfortran-4.9.2 F77=gfortran-4.9.2 ./install -i $HOME/$5  -m -s -c "--prefix=/home/jenkins/openfpm_install --no-recursion"
48 49
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
  source $HOME/openfpm_vars_$5
incardon's avatar
incardon committed
50
  make $3
incardon's avatar
incardon committed
51
 fi
52

incardon's avatar
incardon committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
 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
79
 mkdir /scratch/p_ppm/$5
incardon's avatar
incardon committed
80
 ./install -m -i "/scratch/p_ppm/$5" -s -c"CXX=mpic++ --no-recursion"
81
 mv $HOME/openfpm_vars $HOME/openfpm_vars_$5
82
 source $HOME/openfpm_vars_$5
incardon's avatar
incardon committed
83
 make $3
incardon's avatar
incardon committed
84 85 86 87 88 89 90 91 92


 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
93

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

 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