Delft3D Flexible Mesh Compilation
• Posted in: Software, Hydrodynamics
This in an update to my Delft3D 4 Compilation tutorial. This tutorial explains how to compile the latest stable release of the Delft3D Flexible Mesh source code, which includes the Delft3D 4 (structured) kernels too. However, the Delft3D 4 kernels created from this source code package do not seem compatible with the Delft3D 4 GUI.
At the time of writing, the stable release GUI for Flexible Mesh is not available, but it is possible to run the kernels via scripts.
Prerequisites
In order to compile Delft3D Flexible Mesh kernels release 2025.01, the following software is required:- Visual Studio Community 2022 (version 17) with workload “Desktop development with C++” and the following additional components:
- C++ MFC for latest v143 build tools (x86 & x64)
- C++/CLI support for v143 build tools (Latest)
- C++ Modules for v143 build tools (x64/x86 - experimental)
- Intel oneAPI Base Toolkit 2024. To save disk space, I only install the following components:
- Intel oneAPI Math Kernel Library
- Intel Distribution for GDB
- Intel oneAPI HPC Toolkit 2024. To save disk space, I only install the following components:
- Intel MPI Library
- Intel oneAPI DPC++/C++ Compiler & Intel C++ Compiler Classic
- Intel Fortran Compiler (Beta) & Intel Fortran Compiler Classic
During the Intel oneAPI installation, make sure to activate integration with Visual Studio.
Please do not manually install other dependencies such as CMake.
The components listed above do not guarantee a minimal installation (i.e., some of them may be unnecessary; feel free to test).
Download links
- Delft3D Flexible Mesh source code:
- Delft3D FM Kernels - Stable release - Source code
- As of the time of writing, the source code package is for release 2025.01 (
delft3d-all-release-2025.01.zip).
- Visual Studio Community 2022
- Official website, latest version
- At the time of writing, Visual Studio version is 17.14.12.
- Intel oneAPI Base Toolkit:
- Intel oneAPI HPC Toolkit:
Note that Delft3D source code repository was migrated from Subversion to Git, and it is now restricted to co-developers and Deltares employees. Therefore, the source code package listed above is not the latest development version but the latest public release by Deltares.
Compilation
Compilation is straightforward thanks to the build.bat script:
- Open “Intel oneAPI command prompt for Intel 64 for Visual Studio 2022”.
- Change the working directory using the
cdcommand to the Delft3D source code folder (wherebuild.batis located).- Make sure that the path does not contain spaces. It is also advisable to use a short path (e.g.,
C:\MyDelft3D\...).
- Make sure that the path does not contain spaces. It is also advisable to use a short path (e.g.,
- Run
build.bat -build -build_type Releaseand wait for the automatic preparation and compilation.- Alternatively, run
build.bat -config delft3d4 -build -build_type Releasefor Delft3D 4 kernels (no Flexible Mesh).
- Alternatively, run
- The compiled kernels will be in the
install_allsubfolder.- If you compiled the Delft3D 4 kernels, the files will be in the
install_delft3d4subfolder.
- If you compiled the Delft3D 4 kernels, the files will be in the
Notes
At the time of writing, Deltares had not yet released the GUI for Flexible Mesh, so I don’t know how to install the kernels. In the install_all/bin subfolder, however, there are run scripts for the different kernels. I used those to run the examples included in the source code package, and they all worked.
Keep in mind that even if you compiled the Delft3D 4 kernels following this tutorial, the resultant installation directory does not seem to be compatible with the Delft3D 4 GUI. The installation directory for the Delft3D 4 GUI consist of a x64 folder with subfolders for each kernel. The directory created by following this tutorial contains three folders: bin, lib, and share; and all the kernel executables are in bin. Additionally, I don’t know if these Delft3D 4 kernels are compatible with the Flexible Mesh GUI.
If you need Delft3D 4 kernels with a GUI, see my other tutorial.