Skip to content

Building from source

This page is for licensees who have the source distribution. If you installed a binary package, Get started is the page you want.

Linux with Intel oneAPI is the supported platform, and the only one whose results we stand behind.

  • Linux — the release platform and the only one we validate scientific results on. Intel oneAPI: ifx/icx, oneMKL, Intel MPI.
  • Windows — use WSL and follow the Linux route. A native Windows preset exists as a development convenience and is not a supported configuration; not all of its I/O paths are verified.
  • macOS — development only and CPU only. Useful for editing, examples and smoke checks. Do not use Intel compilers with oneMKL on macOS.
PlatformCompilerMath backendFFT backendMPI
LinuxIntel ifx / icx / icpxoneMKLMKL FFTIntel MPI or a compatible MPI
Windows (development)Intel ifx / icxoneMKLMKL FFTIntel MPI
macOS (development)Homebrew gfortran with AppleClang for C/C++OpenBLASuser-installed FFTWHomebrew OpenMPI

One configure step from the repository root builds everything: the licence component, the library, and the SDK examples.

Terminal window
source /opt/intel/oneapi/setvars.sh
cmake --fresh --preset linux-intel-debug
cmake --build --preset linux-intel-debug
ctest --preset linux-intel-debug --output-on-failure
cmake --install out/build/linux-intel-debug
cmake --build --preset linux-intel-debug --target package

Release presets (linux-intel-release, macos-arm64-release) take the same four commands.

OptionDefaultEffect
MUPRO_BUILD_TDGLONBuild the ferroelectric TDGL solver.
MUPRO_BUILD_MAGNETICONBuild the magnetic and micromagnetic solvers.
MUPRO_ENABLE_HDF5OFFWrite fields as HDF5 in addition to the native format. Needs an HDF5 build first, and adds six test cases.

To compile-check one solver without building the rest, configure into a separate directory and build just the library target:

Terminal window
cmake --fresh --preset linux-intel-debug -B out/build/linux-intel-debug-tdgl \
-DMUPRO_BUILD_TDGL=ON
cmake --build out/build/linux-intel-debug-tdgl --target mupro

Building an example against an installed SDK

Section titled “Building an example against an installed SDK”

examples/demo1 is a downstream project: it finds the SDK with find_package(mupro) rather than being part of the build. After installing:

Terminal window
cmake -S examples/demo1 -B examples/demo1/build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH="$PWD/out/install/linux-intel-debug"
cmake --build examples/demo1/build

The example enables C, C++ and Fortran, because the SDK exports MPI C dependencies and the static library contains C++ object code.

The C ABI example builds the same way:

Terminal window
cmake -S examples/c_api_tdgl -B examples/c_api_tdgl/build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH="$PWD/out/install/linux-intel-debug"
cmake --build examples/c_api_tdgl/build
./examples/c_api_tdgl/build/c_api_tdgl

It prints a structured MUPRO_STATUS_NOT_SETUP message: the C ABI is a skeleton, and the TDGL solve backend is not connected to it yet. That message is the expected output, not a failure.

Terminal window
ctest --preset linux-intel-debug --output-on-failure

The default configuration registers 127 test cases, and a Linux debug build passes all of them. Enabling MUPRO_ENABLE_HDF5 adds six more.

A test counts as passing only if it exits zero and prints its own completion marker. A program that stops early, traps a floating-point exception, or fails an I/O operation therefore fails the test even when its exit status looks clean.