forked from chronolaw/cpp_study
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·82 lines (62 loc) · 2.15 KB
/
setup.sh
File metadata and controls
executable file
·82 lines (62 loc) · 2.15 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
#!/bin/sh
# chrono @ 2021-03
# apt-get
DEBIAN_FRONTEND=noninteractive apt-get install -y \
vim cmake gdb pstack strace \
libmsgpack-dev protobuf-compiler libprotobuf-dev libprotoc-dev \
libcurl4-openssl-dev libzmq3-dev \
python3-dev python3-pip \
google-perftools libgoogle-perftools-dev
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
# python3 pybind11
pip3 install pybind11
#WORKDIR='/root/'
#HOME='/root'
# git source code
git clone https://github.com/chronolaw/cpp_study --depth=1
# setup env
cp ${HOME}/cpp_study/env/vimrc ${HOME}/.vimrc \
cp ${HOME}/cpp_study/env/bashrc ${HOME}/.bashrc \
cp ${HOME}/cpp_study/env/gitconfig ${HOME}/.gitconfig \
# source
JSON_VERSION="3.9.1"
CPR_VERSION="1.4.0"
LUAJIT_VERSION="2.1-20200102"
LUABRIDAGE_VERSION="2.6"
GPERF_VERSION="2.8"
#echo ${JSON_VERSION}
#echo ${HOME}
mkdir ${HOME}/github
cd ${HOME}/github
# test
#exit
# json
curl -fsL https://github.com/nlohmann/json/releases/download/v${JSON_VERSION}/json.hpp -o json.hpp
ln -s ~/github/json.hpp ~/cpp_study/common/
# curl/cpr
curl -fsL https://github.com/whoshuu/cpr/archive/${CPR_VERSION}.tar.gz -o cpr.tgz
tar xfz cpr.tgz
cd cpr-${CPR_VERSION}
cmake . -DUSE_SYSTEM_CURL=ON -DBUILD_CPR_TESTS=OFF
make && make install && make clean
cd ..
# luajit
curl -fsL https://github.com/openresty/luajit2/archive/v${LUAJIT_VERSION}.tar.gz -o luajit.tgz
tar xfz luajit.tgz
cd luajit2-${LUAJIT_VERSION}
make && make install && make clean
ln -s /usr/local/lib/libluajit-5.1.so.2 /lib/x86_64-linux-gnu/
cd ..
# luabridge
curl -fsL https://github.com/vinniefalco/LuaBridge/archive/${LUABRIDAGE_VERSION}.tar.gz -o LuaBridge.tgz
tar xfz LuaBridge.tgz
ln -s ~/github/LuaBridge-${LUABRIDAGE_VERSION}/Source/LuaBridge/ ~/cpp_study/common/
# gperftools
curl -fsL https://github.com/gperftools/gperftools/releases/download/gperftools-${GPERF_VERSION}/gperftools-${GPERF_VERSION}.tar.gz -o gperf.tgz
tar xfz gperf.tgz
ln -s ~/github/gperftools-${GPERF_VERSION}/pprof-symbolize /bin/pprof
# flame graph
git clone https://github.com/brendangregg/FlameGraph.git --depth=1
ln -s ~/github/FlameGraph/flamegraph.pl ~/cpp_study/section4/
# clean
rm *.tgz