-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·148 lines (127 loc) · 3.53 KB
/
build.sh
File metadata and controls
executable file
·148 lines (127 loc) · 3.53 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
#!/bin/sh
echo "******************************************";
echo "* DGFEM-CAA-GUI setup. *";
echo "******************************************";
echo
echo "[0] Create some project directories if don't exist.";
mkdir 3rdParty
mkdir results
mkdir data
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 libqtermwidget5-1-dev > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "libqtermwidget5-1-dev found.";
else
echo "libqtermwidget5-1-dev not found, installing...";
sudo apt-get -y install libqtermwidget5-1-dev;
echo "libqtermwidget5-1-dev 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.12.2
# 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 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 ../../
if [ ! -d "3rdParty/qcustomplot" ]; then
echo "QCustomPlot not found, installing...";
wget https://www.qcustomplot.com/release/2.1.0fixed/QCustomPlot.tar.gz
tar -xf QCustomPlot.tar.gz
rm -rf QCustomPlot.tar.gz
mv qcustomplot 3rdParty/qcustomplot
echo "QCustomPlot installed."
else
echo "QCustomPlot found."
fi
cd 3rdParty/eigen/
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 -j
if [ $? -eq 0 ]; then
echo "[end] Everything went successfully.";
else
echo "[end] Error!";
fi