Build‐And‐Toolchain - kirklasalle/SpaceEntropyCompression GitHub Wiki
Build System & Toolchain Configuration
The SpaceEntropyCompression (SEC) core library is engineered as a zero-dependency, modern C++20 engine designed to compile cleanly across embedded toolchains, desktop compilers, and high-performance computing clusters.
1. Toolchain Prerequisites
| Platform / Profile | Minimum Compiler Version | Architecture Flags | Optional Dependencies |
|---|---|---|---|
| Linux (x86_64) | GCC 11+ or Clang 14+ | -mbmi2 -mavx2 (or -mavx512f) |
OpenMP (for multi-chunk batching) |
| macOS (Apple Silicon) | Apple Clang 14+ / Xcode 14+ | -march=armv8.4-a+simd |
None |
| Embedded Linux (ARM) | GCC 10+ cross-compiler | -march=armv7-a or -march=armv8-a |
None |
| Bare-Metal / MCU (Tier 0) | arm-none-eabi-gcc 10+ |
-mcpu=cortex-m4 -mthumb |
None |
2. Quickstart Compilation (CMake)
# Clone the repository and configure out-of-source build
git clone https://github.com/kirklasalle/SpaceEntropyCompression.git
cd SpaceEntropyCompression
mkdir build && cd build
# Configure Release build with native hardware optimizations
cmake .. -DCMAKE_BUILD_TYPE=Release -DSEC_BUILD_TESTS=ON -DSEC_ENABLE_BENCHMARKS=ON
# Compile using all available host threads
cmake --build . --parallel $(nproc)
# Execute test suite
ctest --output-on-failure
3. CMake Configuration Options
| Option Flag | Default | Description |
|---|---|---|
SEC_BUILD_STATIC |
ON |
Generates self-contained static archive (libsec.a). |
SEC_BUILD_SHARED |
OFF |
Generates dynamic shared library (libsec.so / libsec.dylib). |
SEC_PROFILE_TIER |
AUTO |
Selects target architecture (TIER0_EDGE, TIER1_DESKTOP, TIER2_HYPERSCALE). |
SEC_USE_BMI2 |
ON |
Enables hardware-accelerated _pdep_u64 bit interleaving for Morton indexing. |
SEC_ENABLE_TENSORS |
ON |
Compiles discrete metric tensor compression kernels and VCI operators. |
SEC_NO_EXCEPTIONS |
OFF |
Disables C++ exceptions and RTTI for embedded deployment. |
4. Header-Only Integration
For rapid integration into existing astrophysics simulations or graphics renderers, SEC provides a consolidated single-header distribution:
#define SEC_IMPLEMENTATION
#include "sec_core.h"
int main() {
sec::EncoderConfig config = sec::DefaultConfig();
sec::Bitstream stream = sec::CompressCoordinates(points, count, config);
return 0;
}