RAMSES-CPP aims to provide a functional and physically consistent alternative to the original Fortran implementation while maintaining strict bit-perfect parity in data structures and I/O.
Building RAMSES-CPP is designed to be straightforward using modern CMake.
To build RAMSES-CPP from source, ensure you have the following installed on your system:
git clone https://github.com/SinsuSquid/RAMSES_CPP.git
cd RAMSES_CPP
mkdir build && cd build
cmake ..
make -j$(nproc)
This will generate the dimensional executables (e.g., ramses_1d, ramses_3d) and the reference verification tool verify_ref in the build/ directory.
You can customize the build using the following CMake flags:
-DRAMSES_NDIM=[1|2|3]: Set the number of dimensions (default is 3).-DRAMSES_NENER=N: Set the number of non-thermal energy variables (default is 0).-DRAMSES_USE_MHD=[ON|OFF]: Enable or disable the Magnetohydrodynamics module (default is OFF).-DRAMSES_USE_MPI=[ON|OFF]: Force enable/disable MPI support (usually auto-detected).Example: Building for 2D MHD
cmake .. -DRAMSES_NDIM=2 -DRAMSES_USE_MHD=ON
make -j
If an MPI implementation is installed and detected by CMake, the build system will automatically define RAMSES_USE_MPI. This enables the LoadBalancer class for distributed execution and compiles the code to run across multiple MPI ranks. If MPI is not found, the code safely falls back to a sequential build.