demos for learning modern cpp (since c++11)
tested on MacOS and Linux (Ubuntu)
contrib folder is copied from ClickHouse, do some tiny changes according to my requirements.
- jemalloc
- grpc
- protobuf
- boringssl: google fork of openssl
- rapidjson
- poco c++ library
- etc.
# add submodule
git submodule add https://github.com/google/googletest.git third_party/googletest
git submodule add https://github.com/xtensor-stack/xsimd.git third_party/xsimd
git submodule add https://github.com/google/benchmark.git third_party/benchmark
# update submodule
git submodule sync --recursive
git submodule update --init --recursive
- google test
- google mock
- gflags: github docs
- google glog
- google benchmark
- google sanitizer
- The Boost C++ Libraries: 1st cn, 2nd en, boost-cmake
ubuntu 20.04:
- gcc version 9.4.0: 4.7G
- Ubuntu clang version 15.0.0: 1.8G
- gcc version 11.1.0: 3.7G
install latest clang:
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
#!/bin/bash
set -x
set -u
set -e
BUILD_DIR=_build
# https://github.com/open-mpi/ompi/issues/9317
# openmpi missing flag on ubuntu 20.04
# export LDFLAGS="-lopen-pal"
time (
rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}
cd ${BUILD_DIR}
cmake .. -G Ninja -DRELEASE_ENABLE_O3=ON -DBUILD_WITH_LLVM=ON
cmake --build .
ctest
)