forked from povanberg/DGFEM-Acoustic
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·179 lines (154 loc) · 4.13 KB
/
build.sh
File metadata and controls
executable file
·179 lines (154 loc) · 4.13 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#!/bin/sh
echo "******************************************";
echo "* Discontinuous galerkin setup. *";
echo "******************************************";
echo
echo "[0] Create some project directories if don't exist.";
mkdir 3rdParty
mkdir results
echo "[1] Get depedencies and external libraries.";
dpkg -s cmake > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "mCmake found.";
else
echo "Cmake not found, installing...";
sudo 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...";
sudo 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...";
sudo 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...";
sudo apt-get -y install libblas-dev liblapack-dev;
echo "Lapack/Blas installed.";
fi
# dpkg -s libtbb2 > /dev/null 2>&1;
# if [ $? -eq 0 ]; then
# echo "TBB found.";
# else
# echo "TBB not found, installing...";
# sudo apt-get -y install libtbb2;
# echo "TBB installed.";
# fi
dpkg -s libglu1-mesa > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "libGLU found.";
else
echo "libGLU not found, installing...";
sudo apt-get -y install libglu1-mesa;
echo "libGLU installed.";
fi
dpkg -s libxft2 > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "libxft found.";
else
echo "libxft not found, installing...";
sudo apt-get -y install libxft2;
echo "libxft2 installed.";
fi
dpkg -s libvtk9-dev > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "libvtk9-dev found.";
else
echo "libvtk9-dev not found, installing...";
sudo apt-get -y install libvtk9-dev;
echo "libvtk9-dev installed.";
fi
dpkg -s libfftw3-dev > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "libfftw3-dev found.";
else
echo "libfftw3-dev not found, installing...";
sudo apt-get -y install libfftw3-dev;
echo "libfftw3-dev installed.";
fi
dpkg -s nlohmann-json3-dev > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "nlohmann-json3-dev found.";
else
echo "nlohmann-json3-dev not found, installing...";
sudo apt-get -y install nlohmann-json3-dev;
echo "nlohmann-json3-dev installed.";
fi
gmsh_version=4.13.0
# LINUX
if [ ! -d "3rdParty/gmsh" ]; then
echo "Gmsh not found, installing...";
wget http://gmsh.info/bin/Linux/gmsh-${gmsh_version}-Linux64-sdk.tgz
tar -xf gmsh-${gmsh_version}-Linux64-sdk.tgz
rm -rf gmsh-${gmsh_version}-Linux64-sdk.tgz
mv gmsh-${gmsh_version}-Linux64-sdk 3rdParty/gmsh
echo "Gmsh installed."
else
echo "Gmsh found.";
fi
# macOS
# if [ ! -d "3rdParty/gmsh" ]; then
# echo "Gmsh not found, installing...";
# wget https://gmsh.info/bin/macOS/gmsh-${gmsh_version}-MacOSX-sdk.tgz
# tar -xf gmsh-${gmsh_version}-MacOSX-sdk.tgz
# rm -rf gmsh-${gmsh_version}-MacOSX-sdk.tgz
# mv gmsh-${gmsh_version}-MacOSX-sdk 3rdParty/gmsh
# echo "Gmsh installed."
# else
# echo "Gmsh found.";
# fi
cd 3rdParty/gmsh/
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 "3rdParty/eigen" ]; then
# echo "Eigen not found, installing...";
# wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
# tar -xf eigen-3.4.0.tar.gz
# rm -rf eigen-3.4.0.tar.gz
# mv eigen-3.4.0 3rdParty/eigen
# echo "Eigen installed."
# else
# echo "Eigen found."
# fi
# cd 3rdParty/eigen/
# export INCLUDE=${PWD}:${INCLUDE}
# cd ../../
dpkg -s libeigen3-dev > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "Eigen found.";
else
echo "libeigen3-dev not found, installing...";
sudo apt-get -y install libeigen3-dev;
echo "Eigen installed.";
fi
echo "[2] Build sources.";
rm -rf build/
mkdir build
cd build/
cmake ../ -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles"
make -j
if [ $? -eq 0 ]; then
echo "[end] Everything went successfully.";
else
echo "[end] Error!";
fi