McStas Readout Master 0.3.3
Loading...
Searching...
No Matches
Installation

Build and install from source

git clone https://github.com/mcdotstar/mcstas-readout-master.git
cmake -S mcstas-readout-master -B mcstas-readout-master-build -DCMAKE_INSTALL_PREFIX="$HOME/.local"
cmake --build mcstas-readout-master-build --target install -j

This installs:

  • readout-config
  • readout-replay
  • readout-combine
  • libreadout and public headers
  • McStas component files in share/Readout

Verify the installation

readout-config --show compdir
readout-config --show libdir
readout-combine --help
readout-replay --help

Linking from CMake

The install prefix carries a full CMake package, so external projects can consume the library in the standard way:

find_package(Readout REQUIRED)
add_executable(consumer main.c)
target_link_libraries(consumer PRIVATE Readout::readout)

If the prefix is not a system default, point CMake at it with -DCMAKE_PREFIX_PATH="$HOME/.local" (or Readout_DIR). The package is only generated by the install step — there is no build-tree export, so find_package(Readout) will not find an un-installed build directory.

Readout::readout provides the C API headers as-is. Consumers of the C++ surface (reader.h, replay.h, CollectorClass.h, ...) must supply HighFive and HDF5 headers themselves; they are not part of the export.

Local developer build (without install)

The build tree mirrors the install layout. A direct build is enough:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j

Then expose build/bin on PATH so McStas tools resolve readout-config.

McStas version note

SEARCH SHELL "readout-config --show compdir" requires McStas 3.3+. For McStas 3.2, copy the .comp files to a known McStas component search directory and omit SEARCH SHELL.