|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +# chrono @ 2021-03 |
| 4 | + |
| 5 | +# apt-get |
| 6 | +DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
| 7 | + vim cmake gdb pstack strace \ |
| 8 | + libmsgpack-dev protobuf-compiler libprotobuf-dev libprotoc-dev \ |
| 9 | + libcurl4-openssl-dev libzmq3-dev \ |
| 10 | + python3-dev python3-pip \ |
| 11 | + google-perftools libgoogle-perftools-dev |
| 12 | + |
| 13 | +DEBIAN_FRONTEND=noninteractive apt-get autoremove -y |
| 14 | + |
| 15 | +# python3 pybind11 |
| 16 | +pip3 install pybind11 |
| 17 | + |
| 18 | +#WORKDIR='/root/' |
| 19 | + |
| 20 | +HOME='/root' |
| 21 | + |
| 22 | +git clone https://github.com/chronolaw/cpp_study --depth=1 |
| 23 | + |
| 24 | +# setubp env |
| 25 | +cp ${HOME}/cpp_study/env/vimrc ${HOME}/.vimrc \ |
| 26 | +cp ${HOME}/cpp_study/env/bashrc ${HOME}/.bashrc \ |
| 27 | +cp ${HOME}/cpp_study/env/gitconfig ${HOME}/.gitconfig \ |
| 28 | + |
| 29 | +# source |
| 30 | + |
| 31 | +JSON_VERSION="3.9.1" |
| 32 | +CPR_VERSION="1.4.0" |
| 33 | +LUAJIT_VERSION="2.1-20200102" |
| 34 | +LUABRIDAGE_VERSION="2.6" |
| 35 | +GPERF_VERSION="2.8" |
| 36 | + |
| 37 | +#echo ${JSON_VERSION} |
| 38 | + |
| 39 | +mkdir ${HOME}/github |
| 40 | +cd ${HOME}/github |
| 41 | + |
| 42 | +# json |
| 43 | +curl -fsL https://github.com/nlohmann/json/releases/download/v${JSON_VERSION}/json.hpp -o json.hpp |
| 44 | +ln -s ~/github/json.hpp ~/cpp_study/common/ |
| 45 | + |
| 46 | +# curl/cpr |
| 47 | +curl -fsL https://github.com/whoshuu/cpr/archive/${CPR_VERSION}.tar.gz -o cpr.tgz |
| 48 | +tar xfz cpr.tgz |
| 49 | +cd cpr-${CPR_VERSION} |
| 50 | +cmake . -DUSE_SYSTEM_CURL=ON -DBUILD_CPR_TESTS=OFF |
| 51 | +make && make install && make clean |
| 52 | +cd .. |
| 53 | + |
| 54 | +# luajit |
| 55 | +curl -fsL https://github.com/openresty/luajit2/archive/v${LUAJIT_VERSION}.tar.gz -o luajit.tgz |
| 56 | +tar xfz luajit.tgz |
| 57 | +cd luajit2-${LUAJIT_VERSION} |
| 58 | +make && make install && make clean |
| 59 | +ln -s /usr/local/lib/libluajit-5.1.so.2 /lib/x86_64-linux-gnu/ |
| 60 | +cd .. |
| 61 | + |
| 62 | +# luabridge |
| 63 | +curl -fsL https://github.com/vinniefalco/LuaBridge/archive/${LUABRIDAGE_VERSION}.tar.gz -o LuaBridge.tgz |
| 64 | +tar xfz LuaBridge.tgz |
| 65 | +ln -s ~/github/LuaBridge-${LUABRIDAGE_VERSION}/Source/LuaBridge/ ~/cpp_study/common/ |
| 66 | + |
| 67 | +# gperftools |
| 68 | +curl -fsL https://github.com/gperftools/gperftools/releases/download/gperftools-${GPERF_VERSION}/gperftools-${GPERF_VERSION}.tar.gz -o gperf.tgz |
| 69 | +tar xfz gperf.tgz |
| 70 | +ln -s ~/github/gperftools-${GPERF_VERSION}/pprof-symbolize /bin/pprof |
| 71 | + |
| 72 | +# flame graph |
| 73 | +git clone https://github.com/brendangregg/FlameGraph.git --depth=1 |
| 74 | +ln -s ~/github/FlameGraph/flamegraph.pl ~/cpp_study/section4/ |
| 75 | + |
| 76 | +# clean |
| 77 | +rm *.tgz |
| 78 | + |
0 commit comments