Installation & build
CMake, configuration options, and application integration.
01Requirements#
Requires CMake 3.20+ and a C++20 compiler. SIMD sources compile with x86 AVX instructions; the build does not guarantee general ARM portability. CUDA is needed only for device kernels.
02Build from the repository root#
Run inside NexusModel. Tests and CPU benchmarks are enabled by default. Multi-configuration generators place executables under Release.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Releasecmake --build build --config Releasectest --test-dir build -C Release --output-on-failure# Windows / MSVC.\build\Release\nexus_model_bench.exe03Build options#
CUDA architecture defaults to 86; select your GPU architecture. The MatrixFlash option enables the bridge header; the consumer must separately supply MatrixFlash dependencies. NEXUS_MODEL_ENABLE_AVX512 defaults to ON and compiles the kernels. AVX-512 is not selected on the Ryzen 7 5800H.
| Option | Default |
|---|---|
| NEXUS_MODEL_WITH_CUDA | OFF |
| NEXUS_MODEL_WITH_MATRIXFLASH | OFF |
| NEXUS_MODEL_BUILD_TESTS | ON |
| NEXUS_MODEL_BUILD_BENCHMARKS | ON |
| NEXUS_MODEL_BUILD_EXAMPLES | OFF |
| NEXUS_MODEL_ENABLE_AVX512 | ON |
| NEXUS_MODEL_WARNINGS_AS_ERRORS | ON |
04Link your application#
Installation rules copy the archive and headers; this version does not export a find_package configuration. Use the alias target with add_subdirectory.
cmake_minimum_required(VERSION 3.20)project(example LANGUAGES CXX)add_subdirectory(NexusModel)add_executable(example main.cpp)target_link_libraries(example PRIVATE nexus_model::nexus_model)05CUDA build#
Requires the CUDA Toolkit. The GPU benchmark also links cuBLAS. This configuration does not automatically move host layers to GPU.
cmake -S . -B build-cuda -DNEXUS_MODEL_WITH_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=86cmake --build build-cuda --config Release