- Development Environment
- Docker
- Docker Compose
- VSCode devcontainer also supported.
- Build System
- Coding Style: Google C++ Style
- Formatter: clang-format
- Lintee: clang-tidy
- Test Framework: Google Test
- Benchmark Framework: Google Benchmark
- CI/CD: GitHub Actions
At first, you need to set environment variables referenced by docker-compose.yml.
./docker/init_env.sh
You can build and launch the development environment by using Docker Compose
docker-compose build
docker-compose run dev
or, you can also do it by using VSCode devcontainer, by executing Dev Containers: Open Folder in Container...
and select the project's root directory.
You can configure by using CMake and build fastly by using Ninja
cmake -B build -GNinja
cmake --build build
You can test by running CTest. The project uses Google Test as the test framework.
ctest --test-dir build
The project uses Google Benchmark as the benchmark framework.
./build/bin/cpp-template_benchmark
You can get the following result:
2023-02-26T12:31:10+00:00
Running ./build/bin/cpp-template_benchmark
Run on (80 X 3383.81 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x40)
L1 Instruction 32 KiB (x40)
L2 Unified 256 KiB (x40)
L3 Unified 51200 KiB (x2)
Load Average: 2.95, 3.46, 3.50
-------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------
BM_vadd/8 114 ns 114 ns 6336100
BM_vadd/64 276 ns 276 ns 2492204
BM_vadd/512 1342 ns 1342 ns 533077
BM_vadd/4096 10032 ns 10030 ns 71436
BM_vadd/8192 19511 ns 19506 ns 36428
find . -type f -name "*.h" -not -path './build/*' -or -name "*.cc" -not -path './build/*' | xargs clang-format --dry-run -Werror
find . -type f -name "CMakeLists.txt" -not -path './build/*' -or -name "*.cmake" -not -path './build/*' | xargs cmake-format --check
find . -type f -name "*.h" -not -path './build/*' -or -name "*.cc" -not -path './build/*' | xargs clang-tidy -p build
cd build
cpack -G "TGZ"