-
Notifications
You must be signed in to change notification settings - Fork 9
/
install-dependencies.sh
executable file
·114 lines (93 loc) · 3.04 KB
/
install-dependencies.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
# Installing dependencies needed to build ThermoFun on (k)ubuntu linux 20.04
EXTN=so
#sudo rm -rf /usr/local/include/nlohmann
#sudo rm -rf /usr/local/include/eigen3/Eigen/Eigen
#sudo rm -rf /usr/local/include/pybind11
#sudo rm -rf /usr/local/include/spdlog
#sudo rm -f /usr/local/lib/libChemicalFun.$EXTN
workfolder=${PWD}
BRANCH_TFUN=master
BUILD_TYPE=Release
# nlohmann/json library v. 3.6.1 or up
# if not installed in /usr/local/include/nlohmann)
test -f /usr/local/include/nlohmann/json.hpp || {
# Getting nlohmann/json library
mkdir -p ~/code && \
cd ~/code && \
git clone https://github.com/nlohmann/json.git && \
cd json && \
mkdir -p build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF -DJSON_MultipleHeaders=ON && \
sudo make install
# Removing generated build files
cd ~ && \
rm -rf ~/code
}
# Eigen3 math library (added for building and installing xGEMS)
# if not installed in /usr/local/include/eigen3)
test -d /usr/local/include/eigen3/Eigen || {
# Building eigen library
mkdir -p ~/code && \
cd ~/code && \
git clone https://gitlab.com/libeigen/eigen.git -b 3.4.0 && \
cd eigen && \
mkdir -p build && \
cd build && \
cmake .. \
make && \
sudo make install
# Removing generated build files
cd ~ && \
rm -rf ~/code
}
# spdlog
# if no spdlog installed in /usr/local/include/spdlog (copy only headers)
test -d /usr/local/include/spdlog || {
# Building spdlog library
mkdir -p ~/code && \
cd ~/code && \
git clone https://github.com/gabime/spdlog -b v1.11.0 && \
cd spdlog/include && \
sudo cp -r spdlog /usr/local/include
# Removing generated build files
cd ~ && \
rm -rf ~/code
}
#Pybind11
test -d /usr/local/include/pybind11 || {
# Building pybind11 library
mkdir -p ~/code && \
cd ~/code && \
git clone https://github.com/pybind/pybind11.git && \
cd pybind11 && \
mkdir -p build && \
cd build && \
cmake .. -DPYBIND11_TEST=OFF && \
make && \
sudo make install
# Removing generated build files
cd ~ && \
rm -rf ~/code
}
# ChemicalFun library
# if no ChemicalFun installed in /usr/local/lib/ (/usr/local/include/ChemicalFun)
test -f /usr/local/lib/libChemicalFun.$EXTN || {
# Building chemicalfun library
mkdir -p ~/code && \
cd ~/code && \
git clone https://bitbucket.org/gems4/chemicalfun.git -b $BRANCH_TFUN && \
cd chemicalfun && \
mkdir -p build && \
cd build && \
cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=$BUILD_TYPE && \
make -j $threads && \
sudo make install
# Removing generated build files
cd ~ && \
rm -rf ~/code
}
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sudo ldconfig
fi