build.sh 2.83 KB
Newer Older
Pietro Incardona's avatar
Pietro Incardona committed
1
2
3
#! /bin/bash

# Make a directory in /tmp/openfpm_data
Pietro Incardona's avatar
retry    
Pietro Incardona committed
4
#
Pietro Incardona's avatar
Pietro Incardona committed
5
6
7
8

echo "$PATH"
echo "Directory: $1"
echo "Machine: $2"
9
echo "Branch: $3"
Pietro Incardona's avatar
Pietro Incardona committed
10
11
12
13
14
15
16

mkdir /tmp/openfpm_vcluster
mv * .[^.]* /tmp/openfpm_vcluster
mv /tmp/openfpm_vcluster openfpm_vcluster

mkdir openfpm_vcluster/src/config

17
18
## It is equivalent to the git modules

Pietro Incardona's avatar
Pietro Incardona committed
19
20
git clone git@git.mpi-cbg.de:/openfpm/openfpm_devices.git openfpm_devices
git clone git@git.mpi-cbg.de:/openfpm/openfpm_data.git openfpm_data
21
cd openfpm_data
Pietro Incardona's avatar
Pietro Incardona committed
22
git checkout 7b236b204edfe60d6a104da5a9e7e4f0aa1d6c90
23
24
cd ..
cd openfpm_devices
Pietro Incardona's avatar
Pietro Incardona committed
25
git checkout d956f9fd5bea586ee6281a483e3f0d5fa93a5415
26
cd ..
Pietro Incardona's avatar
Pietro Incardona committed
27
28
29

cd "$1/openfpm_vcluster"

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# install MPI and BOOST  LIBHILBERT if needed

if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/LIBHILBERT ]; then
        ./install_LIBHILBERT.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
fi


if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/BOOST ]; then
        if [ x"$2" == x"mac," ]; then
                echo "Compiling for OSX"
                ./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4 darwin
        else
                echo "Compiling for Linux"
                ./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4 gcc
        fi
fi


if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/MPI ]; then
        if [ x"$2" == x"mac," ]; then
                echo "Compiling for OSX"
                ./install_MPI.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
        else
                echo "Compiling for Linux"
                ./install_MPI.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
        fi
fi

Pietro Incardona's avatar
Pietro Incardona committed
58
export PATH="$PATH:$HOME/openfpm_dependencies/openfpm_vcluster/MPI/bin"
59

Pietro Incardona's avatar
Pietro Incardona committed
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
if [ "$2" == "gin" ]; then
 echo "Compiling on gin\n"
 module load gcc/4.9.2
 module load openmpi/1.8.1

elif [ "$2" == "wetcluster" ]; then
 echo "Compiling on wetcluster"

## produce the module path

 export MODULEPATH="/sw/apps/modules/modulefiles:$MODULEPATH"

 script="module load gcc/4.9.2\n 
module load openmpi/1.8.1\n
module load boost/1.54.0\n
compile_options='--with-boost=/sw/apps/boost/1.54.0/'\n
\n
sh ./autogen.sh\n
sh ./configure \"\$compile_options\"  CXX=mpic++\n
make\n
if [ \"\$?\" = "0" ]; then exit 1 ; fi\n
exit(0)\n"

 echo $script | sed -r 's/\\n/\n/g' > compile_script

 bsub -o output_compile.%J -K -n 1 -J compile sh ./compile_script

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

 echo "$PATH"
 module load gcc/5.3.0
 module load boost/1.60.0
 module load openmpi/1.10.2-gnu
 module unload bullxmpi

 sh ./autogen.sh
Pietro Incardona's avatar
Pietro Incardona committed
97
 sh ./configure  CXX=mpic++
Pietro Incardona's avatar
Pietro Incardona committed
98
99
100
101
102
103
104
105
106
107
108
 make
 if [ $? -ne 0 ]; then exit 1 ; fi

### to exclude --exclude=taurusi[6300-6400],taurusi[5400-5500]

else

 source $HOME/.bashrc
 echo "$PATH"
 echo "Compiling general"
 sh ./autogen.sh
Pietro Incardona's avatar
Pietro Incardona committed
109
 sh ./configure  CXX=mpic++ --with-boost=$HOME/openfpm_dependencies/openfpm_vcluster/BOOST
Pietro Incardona's avatar
Pietro Incardona committed
110
111
112
113
114
 make
 if [ $? -ne 0 ]; then exit 1 ; fi

fi