forked from thermohub/thermohubclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-dependencies.sh
executable file
·76 lines (62 loc) · 1.89 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
#!/bin/bash
# Installing dependencies needed to build thermofun on (k)ubuntu linux 16.04 or 18.04
sudo apt-get install -y libcurl4-openssl-dev
# Uncomment what is necessary to reinstall by force
#sudo rm -f /usr/local/lib/libvelocypack.a
#sudo rm -f /usr/local/lib/libjsonarango.a
#sudo rm -f /usr/local/include/nlohmann/json.hpp
threads=3
BRANCH_JSON=master
BRANCH_TFUN=master
git status
# nlohmann/json
test -f /usr/local/include/nlohmann/json.hpp || {
# Building yaml-cpp library
mkdir -p ~/code && \
cd ~/code && \
git clone https://github.com/nlohmann/json.git && \
cd json && \
mkdir -p build && \
cd build && \
cmake .. -DJSON_BuildTests=OFF && \
make && \
sudo make install
# Removing generated build files
cd ~ && \
rm -rf ~/code
}
# Velocypack from ArangoDB (added for installing JSONIO database client)
# if no VPack installed in /usr/local/lib/libvelocypack.a (/usr/local/include/velocypack)
test -f /usr/local/lib/libvelocypack.a || {
# Building velocypack library
mkdir -p ~/code && \
cd ~/code && \
git clone https://github.com/arangodb/velocypack.git && \
cd velocypack && \
mkdir -p build && \
cd build && \
cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DBuildVelocyPackExamples=OFF && \
make -j $threads && \
sudo make install
# Removing generated build files
cd ~ && \
rm -rf ~/code
}
# JSONIO database client (added for building ThermoMatch code)
# if no JSONIO installed in /usr/local/lib/libjsonio.a (/usr/local/include/jsonio)
test -f /usr/local/lib/libjsonarango.a || {
# Building jsonio library
mkdir -p ~/code && \
cd ~/code && \
git clone https://bitbucket.org/gems4/jsonarango.git -b $BRANCH_JSON && \
cd jsonarango && \
mkdir -p build && \
cd build && \
cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=Release && \
make -j $threads && \
sudo make install
# Removing generated build files
cd ~ && \
rm -rf ~/code
}
sudo ldconfig