Skip to content

Installation

Build Requirements

neomc currently builds with:

  • a C++20 compiler;
  • CMake 3.20 or newer.

Importer-backed workflows additionally require:

  • HDF5 with the C component;
  • Zlib.

Minimal Library-Only Build

Build the core libraries without importers or benchmark executables:

bash
cmake -S . -B build \
  -DNEOMC_BUILD_IMPORTERS=OFF \
  -DNEOMC_BUILD_BENCHMARKS=OFF \
  -DNEOMC_ENABLE_BENCHMARK_CHECKS=OFF
cmake --build build --parallel

Default Importer And Benchmark Build

The repository defaults are currently:

  • NEOMC_BUILD_IMPORTERS=ON
  • NEOMC_BUILD_BENCHMARKS=ON
  • NEOMC_ENABLE_BENCHMARK_CHECKS=ON

Example:

bash
cmake -S . -B build
cmake --build build --parallel

NEOMC_BUILD_BENCHMARKS cannot be enabled unless NEOMC_BUILD_IMPORTERS is also enabled.

Optional Geant4 reference executables are controlled separately with:

  • NEOMC_BUILD_GEANT4_BENCHMARKS=ON

Reference Data

Importer-backed benchmarks expect a local reference/ tree. The repository treats reference/ as a local, ignored area for upstream source and data files.

Typical benchmark executables pass reference directly as the first argument or through a --reference-root reference option, depending on the executable.

Common Build Modes

  • Core-only library validation:
bash
cmake -S . -B build \
  -DNEOMC_BUILD_IMPORTERS=OFF \
  -DNEOMC_BUILD_BENCHMARKS=OFF \
  -DNEOMC_ENABLE_BENCHMARK_CHECKS=OFF
  • Importer and benchmark workflow:
bash
cmake -S . -B build
  • Benchmark workflow with optional Geant4 reference executables:
bash
cmake -S . -B build \
  -DNEOMC_BUILD_GEANT4_BENCHMARKS=ON

Verification

After building a benchmark-enabled configuration, run:

bash
ctest --test-dir build --output-on-failure

This executes lightweight benchmark checks for the enabled benchmark targets.

NeoMC user documentation.