-
Notifications
You must be signed in to change notification settings - Fork 32
/
build.sh
executable file
·96 lines (82 loc) · 2.12 KB
/
build.sh
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
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
58
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
96
#!/bin/sh
echo "******************************************";
echo "* Discontinuous galerkin setup. *";
echo "******************************************";
echo
echo "[1] Get depedencies and external libraries.";
module load cmake/3.11.1
module load gcc/4.9.2
dpkg -s cmake > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "mCmake found.";
else
echo "Cmake not found, installing...";
apt-get -y install cmake;
echo "Cmake installed.";
fi
dpkg -s g++ > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "G++ found.";
else
echo "G++ not found, installing...";
apt-get -y install g++;
export CC=gcc;
export CXX=g++;
echo "G++ installed.";
fi
dpkg -s gfortran > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "Gfortran found.";
else
echo "Gfortran not found, installing...";
apt-get -y install gfortran;
echo "Gfortran installed.";
fi
dpkg -s libblas-dev liblapack-dev > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "Lapack/Blas found.";
else
echo "Lapack/Blas not found, installing...";
apt-get -y install libblas-dev liblapack-dev;
echo "Lapack/Blas installed.";
fi
if [ ! -d "gmsh-4.1.4-Linux64-sdk" ]; then
echo "Gmsh not found, installing...";
wget http://gmsh.info/bin/Linux/gmsh-4.1.4-Linux64-sdk.tgz
tar -xf gmsh-4.1.4-Linux64-sdk.tgz
rm -rf gmsh-4.1.4-Linux64-sdk.tgz
echo "Gmsh installed."
else
echo "Gmsh found.";
fi
cd gmsh-4.1.4-Linux64-sdk/
export FC=gfortran
export PATH=${PWD}/bin:${PWD}/lib:${PATH}
export INCLUDE=${PWD}/include:${INCLUDE}
export LIB=${PWD}/lib:${LIB}
export PYTHONPATH=${PWD}/lib:${PYTHONPATH}
export DYLD_LIBRARY_PATH=${PWD}/lib:${DYLD_LIBRARY_PATH}
cd ../
if [ ! -d "eigen-eigen-323c052e1731" ]; then
echo "Eigen not found, installing...";
wget http://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz
tar -xf 3.3.7.tar.gz
rm -rf 3.3.7.tar.gz
echo "Eigen installed."
else
echo "Eigen found."
fi
cd eigen-eigen-323c052e1731/
export INCLUDE=${PWD}:${INCLUDE}
cd ../
echo "[2] Build sources.";
rm -rf build/
mkdir build
cd build/
cmake ../ -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles"
make -j4
if [ $? -eq 0 ]; then
echo "[end] Everything went successfully.";
else
echo "[end] Error!";
fi