-
Notifications
You must be signed in to change notification settings - Fork 1
Compiling
The codebase uses a manually written Makefile located in the top-level directory that has been tested on the Tiger3 HPC system. To build the project, you can use standard make commands. Additionally, make sure that HDF5 and NETCDF modules or paths are defined before building.
Before compiling, it is strongly recommended that you clean any previously built files to ensure a fresh and consistent build:
make cleanLoad the required modules:
module load intel/2024.2
module load intel-oneapi/2024.2
module load hdf5/oneapi-2024.2/1.14.4
module load netcdf/oneapi-2024.2/hdf5-1.14.4/4.9.2Then compile the project:
makeThis will generate the final executable:
bin/routingAdditionally, if compiling on Tiger3 you can directly use the compile script provided:
./compile.shThe code uses the GNU C++ compiler (g++) and is written in C++17. The Makefile includes optimization flags designed to improve performance on modern hardware:
CXX := icpx
CXXFLAGS := -O3 -ipo -fp-model fast=2 -qopenmp -fma \
-xSapphireRapids -qopt-report-phase=vec -qopt-prefetch \
-Rpass=loop-vectorize -Rpass=inline -DNDEBUG -std=c++17The following libraries are linked during the build:
LDFLAGS := -lboost_system -L${NETCDF_PATH}/lib64 -lnetcdfEnsure that the NETCDF_PATH environment variable is set correctly and points to a valid NetCDF installation.
The code is organized into several directories, and the Makefile automatically compiles all source files under src/, including nested directories like src/I_O and src/utils.
Object files are stored in a separate build/ directory, and the final binary is placed in the bin/ directory:
src/ → Source files
build/ → Object files
bin/ → Final binary The code is portable and should compile with any modern C++ compiler that supports:
- C++17
- OpenMP
- Boost
- NetCDF
The default compiler is icpx, but you may adapt the Makefile for use with:
- Intel (icpc / icpx)
- gcc
- Clang (with OpenMP support)
- Cray, PGI, or IBM XL C++ compilers
For best results, use the latest version of your compiler, especially if building with OpenMP. Some older versions of Clang may not support OpenMP reliably. Additionally, use what is best for the HPC system at your institution.
Getting Started
User Guide
- Background
- Compiling
- OpenMP
- Solver
- The YAML File
- Parameters
- Initial Conditions
- Boundary Conditions
- Reservoirs
- Runoff Forcings
- Output Files
Programmer Guide