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

# Make a directory in /tmp/openfpm_data

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

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

mkdir openfpm_vcluster/src/config

incardon's avatar
incardon committed
16
17
## It is equivalent to the git modules

incardon's avatar
incardon committed
18
19
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
20
21
22
23
24
25
cd openfpm_data
git checkout 6c2a5911ac16f93ab0ae1e7ac14723c952aa5c16
cd ..
cd openfpm_devices
git checkout 46e4994c5dff879a71e6ae090c50b2f23235d435
cd ..
incardon's avatar
incardon committed
26
27
28

cd "$1/openfpm_vcluster"

incardon's avatar
incardon committed
29
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
# 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

incardon's avatar
incardon committed
57
export PATH="$PATH:$HOME/openfpm_dependencies/openfpm_vcluster/MPI/bin"
58

incardon's avatar
incardon committed
59
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
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
incardon's avatar
incardon committed
96
 sh ./configure  CXX=mpic++
incardon's avatar
incardon committed
97
98
99
100
101
102
103
104
105
106
107
 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
incardon's avatar
incardon committed
108
 sh ./configure  CXX=mpic++ --with-boost=$HOME/openfpm_dependencies/openfpm_vcluster/BOOST
incardon's avatar
incardon committed
109
110
111
112
113
 make
 if [ $? -ne 0 ]; then exit 1 ; fi

fi