Skip to content

icejoywoo/modern-cpp-demo

Repository files navigation

Modern Cpp Demo

ci status

demos for learning modern cpp (since c++11)

tested on MacOS and Linux (Ubuntu)

contrib

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.

third-party submodules

# 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

Learning Materials

Articles from WeChat Official Accounts

misc

output size

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)"

build script

#!/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
)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages