This document details the build prerequisites, CMake presets, toolchain requirements, and compile configurations for ParallelComputeLab.
- C++ Compiler: GCC 11+ or Clang 13+ with full C++20 support (
std::span, concepts,std::allocator_traits). - Build System: CMake 3.20 or newer, Make or Ninja.
- OpenMP:
libgomp(GCC) orlibomp(Clang) for parallel loop execution. - Python (Offline Analysis): Python 3.9+ with optional
numpyandmatplotlibfor generating charts. - GoogleTest & Google Benchmark: Automatically acquired via CMake
FetchContent(pinned tags:v1.15.2andv1.9.0respectively).
sudo apt-get update
sudo apt-get install -y cmake g++ libomp-dev python3 python3-pip python3-numpy python3-matplotlibParallelComputeLab provides predefined build presets via CMakePresets.json:
| Preset | Build Type | Features Enabled | Primary Use Case |
|---|---|---|---|
release |
Release |
-O3, OpenMP, AVX2/FMA, Tests, Benchmarks |
Maximum performance benchmarking |
debug |
Debug |
-O0 -g, Debug assertions, Tests |
Debugging kernel behavior and step-through |
asan-ubsan |
Debug |
-fsanitize=address,undefined -g |
Memory safety, leak detection, UB checking |
tsan |
RelWithDebInfo |
-fsanitize=thread -g |
Concurrency race detection |
profiling |
RelWithDebInfo |
-fno-omit-frame-pointer -g -O3 |
Linux perf, flamegraphs, and VTune |
# Configure
cmake -B build/release -S ParallelComputeLab -DCMAKE_BUILD_TYPE=Release
# Compile all targets using available CPU cores
cmake --build build/release -j$(nproc)Generated binaries in build/release/:
parallel_compute_core.a(Static library)parallel_compute_tests(Correctness test executable)parallel_compute_benchmarks(Google Benchmark executable)system_info_cli(Hardware and CPU diagnostics tool)
cmake -B build/asan -S ParallelComputeLab \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_ASAN_UBSAN=ON \
-DBUILD_BENCHMARKS=OFF
cmake --build build/asan -j$(nproc)
./build/asan/parallel_compute_testscmake -B build/tsan -S ParallelComputeLab \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_TSAN=ON \
-DBUILD_BENCHMARKS=OFF
cmake --build build/tsan -j$(nproc)cmake -B build/portable -S ParallelComputeLab \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_AVX2=OFF
cmake --build build/portable -j$(nproc)
ctest --test-dir build/portable --output-on-failureTo inspect compiler auto-vectorization decisions directly:
g++ -O3 -std=c++20 -IParallelComputeLab/include -fopt-info-vec-optimized \
-c ParallelComputeLab/src/algorithms/elementwise.cpp -o /dev/nullTo view generated AVX2 and FMA assembly instructions:
g++ -O3 -mavx2 -mfma -std=c++20 -IParallelComputeLab/include -DPARALLEL_COMPUTE_HAS_AVX2=1 \
-S ParallelComputeLab/src/simd/simd_elementwise.cpp -o - | grep -E "vaddps|vmulps|vfmadd"