Skip to content

Build And Integrate ​

NeoMC currently builds from source as a set of static C++20 libraries.

Requirements ​

  • CMake 3.20 or newer;
  • a C++20 compiler;
  • POSIX threads;
  • HDF5 C and Zlib when importer support is enabled.

Build The Core Libraries ​

bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target neomc_core --parallel

The default build does not enable importers, benchmark consumers, data tools or core-evidence executables.

Use NeoMC From Another CMake Project ​

The current repository does not install or export a find_package(NeoMC) package. Add the source tree as a subdirectory:

cmake
add_subdirectory(path/to/neomc)

add_executable(my_transport main.cc)
target_link_libraries(my_transport PRIVATE neomc_simulation)

neomc_simulation brings the public runtime dependencies transitively. Link a lower-level target only when the application deliberately uses that module without the simulation runtime.

Applications that use file-backed data resolvers also link the importer target:

cmake
target_link_libraries(
  my_transport
  PRIVATE
    neomc_simulation
    neomc_physics_data_importers
)

Build Importers And Repository Examples ​

bash
cmake -S . -B build \
  -DCMAKE_BUILD_TYPE=Release \
  -DNEOMC_BUILD_IMPORTERS=ON \
  -DNEOMC_BUILD_BENCHMARKS=ON
cmake --build build --parallel

The available options are:

OptionDefaultPurpose
NEOMC_BUILD_IMPORTERSOFFHDF5, ENDF and reference-data importers
NEOMC_BUILD_BENCHMARKSOFFrepository use-case consumers
NEOMC_BUILD_GEANT4_BENCHMARKSOFFoptional Geant4 comparison programs
NEOMC_BUILD_CORE_EVIDENCEOFFnarrow physics evidence executables
NEOMC_BUILD_DATA_TOOLSOFFevaluated-data processing and audit tools

Benchmark and Geant4 builds require importers.

Physics Data Is Separate ​

The source repository does not bundle complete transport libraries. Importer examples expect authoritative upstream files under a local data/ tree or at paths supplied on the command line. See Physics data and cross sections before running a data-backed example.

NeoMC user documentation.