Skip to content

Installation ​

Prerequisites ​

ADS-IDAC builds from source and requires:

  • CMake 3.20.5 or newer
  • Ninja build system (recommended)
  • Boost libraries: serialization, program_options
  • C++17 compiler: GCC 9+, Clang 11+, or Intel oneAPI icpx
  • Fortran compiler: gfortran 9+ or Intel ifx
  • MPI (optional): OpenMPI or Intel MPI for parallel execution
  • LZ4 development files
  • mold or gold linker (optional, Linux): CMake links a test program with mold, then with gold, and uses the first one that works; otherwise it reports Using default system linker and continues. With GCC, mold needs GCC 12.1 or newer.

Platform-specific packages ​

sh
brew install cmake ninja gcc boost open-mpi lz4 pkgconf
sh
sudo apt install cmake ninja-build pkg-config liblz4-dev libboost-serialization-dev \
  libboost-program-options-dev gfortran g++ libopenmpi-dev
sh
# Intel compilers via oneAPI toolkit
source /opt/intel/oneapi/setvars.sh
sudo dnf install cmake ninja-build boost-devel lz4-devel pkgconf-pkg-config

Building from Source ​

Configure ​

From the repository root:

bash
mkdir -p build && cd build
bash
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_CXX_COMPILER=clang++ \
  -DCMAKE_C_COMPILER=clang \
  -DCMAKE_Fortran_COMPILER=gfortran-NN \
  -DENABLE_HCL=OFF \
  -DCMAKE_PREFIX_PATH=/opt/homebrew
bash
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_CXX_COMPILER=g++ \
  -DCMAKE_C_COMPILER=gcc \
  -DCMAKE_Fortran_COMPILER=gfortran
bash
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_CXX_COMPILER=icpx \
  -DCMAKE_C_COMPILER=icx \
  -DCMAKE_Fortran_COMPILER=ifx
bash
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_CXX_COMPILER=g++ \
  -DCMAKE_C_COMPILER=gcc \
  -DCMAKE_Fortran_COMPILER=gfortran \
  -DENABLE_MPI=OFF

On macOS, gfortran-NN is the versioned binary that Homebrew's gcc formula installs (ls /opt/homebrew/bin/gfortran-*). After Homebrew upgrades gcc, boost or open-mpi, an existing build tree points at removed paths: reconfigure it in place with cmake . -U "MPI*" -DCMAKE_Fortran_COMPILER=/opt/homebrew/bin/gfortran-NN and rebuild.

Build ​

bash
ninja -j$(nproc)

The executable is written to build/bin/adsidac. The steam table files (tpfh2o, tpfh2onew, tpfd2o) are copied to build/bin/ during configure. RELAP5 reads them from its working directory; see Working directory and steam tables.

Verify ​

bash
# Run the BV4 test case (36 sequences at Truncation_time=15.5)
cd bin && ./adsidac --project-dir=../tests/BV4 --input-deck=../tests/BV4/BV4.i

CMake Options ​

OptionDefaultDescription
ENABLE_MPIONMPI parallel execution. OFF builds serial-only without MPI dependency
ENABLE_HCLONHCL/SMILE fault tree and BBN support. OFF for macOS or systems without SMILE libraries
BUILD_UNIT_TESTSONBuild Boost.Test unit tests
BUILD_FUNCTIONAL_TESTSONBuild functional tests
BUILD_INTEGRATION_TESTSONBuild integration/validation tests
USE_PREBUILT_RELAPOFFUse pre-built RELAP .a files instead of compiling Fortran source
PREBUILT_RELAP_COMPILERintelWhich Fortran runtime to link when using pre-built RELAP (intel or gnu)
PREBUILT_RELAP_DIRlib/relap/<compiler>/Location of the pre-built RELAP libraries
ENABLE_SERIALIZATION_TESTOFFBuild the serialization test executable
ENABLE_LONG_CHECKPOINT_TESTSOFFRegister the six Truncation_time=1000 checkpoint and resume tests (label long, MPI builds only)

Running Tests ​

bash
cd build

# Everything that is registered
ctest

# One test by name, with its output
ctest -R BV4_Serial_Validate -V

# By label
ctest -L integration      # all BV4 validation, checkpoint and interrupt tests
ctest -L checkpoint       # checkpoint and resume tests
ctest -L interrupt        # Ctrl+C checkpoint test
ctest -L adsmd            # input validator manifest test (registered when cargo is found)

The integration tests run the BV4 case and compare the output counts with the values in Reference baselines. They share one project directory and are serialized by a resource lock, so ctest -j does not run them concurrently. MPI tests are registered only when ENABLE_MPI=ON.

The six Truncation_time=1000 checkpoint tests are registered only when the build is configured with -DENABLE_LONG_CHECKPOINT_TESTS=ON; select or exclude them with ctest -L long and ctest -LE long.

Compiler Performance Notes ​

CompilerFortran optC++ optNotes
GNU Release-O3-O3Fastest RELAP5 compute. Recommended.
Intel Release-O0 (forced)-O3Intel Fortran crashes RELAP5 at any optimization due to AVX memcpy issues
Intel Debug-O0-O0Slowest. Use for development only.

GNU Release builds are 2-2.5x faster than Intel for RELAP5-dominated workloads because gfortran safely handles -O3 while Intel Fortran is forced to -O0.

Docker ​

Pre-configured Docker images are available for reproducible builds. See Docker/README.md for details.

bash
# GNU source build
docker build -f Docker/gnu-build/Dockerfile -t adsidac-gnu .

# Intel source build
docker build -f Docker/build/Dockerfile -t adsidac .

ADS-IDAC Engine Documentation