Skip to content

Instantly share code, notes, and snippets.

@H0R5E
Last active January 16, 2024 00:37
Show Gist options
  • Save H0R5E/8ea0d262b79cadc2c0973d5fc06334a4 to your computer and use it in GitHub Desktop.
Save H0R5E/8ea0d262b79cadc2c0973d5fc06334a4 to your computer and use it in GitHub Desktop.
Instructions for compiling the SNL-Delft3D-CEC version of Delft3D-4

Delft3D-4 (SNL-Delft3D-CEC) Compilation

This is a short guide for compiling and testing the SNL-Delft3D-CEC current energy converter modification for the Deltares Delft3D-4 solver.

Download SNL-Delft3D-CEC source code

The SNL-Delft3D-CEC Home Page contains details regarding installing and running the code. As the version in the master branch is out of date, I have created a pull request to update the code to tag 65936 from the Deltares SVN servers which is the recommended version for Delft3D-4 according to the Deltares Get Started page.

The code in the pull request can be downloaded as a zip file from this link. Unzip this code to some path, which we will refer to as \path\to\Delft3D below.

If and when the code is merged into the master branch of SNL-Delft3D-CEC, I will update this information accordingly.

If you want to download the vanilla version of Delft3D-4 instead, then, first, install an SVN client like sliksvn and then save my SVN helper script as Check-Out-SVN.ps1. Now run it using PowerShell like so:

.\Check-Out-SVN.ps1 \path\to\Delft3D -SRC https://svn.oss.deltares.nl/repos/delft3d/tags/delft3d4/65936

Install Anaconda, Visual Studio, Intel FORTRAN compiler and Delft3D-4 GUI

Required Software

  1. Anaconda Python
  2. Visual Studio
  3. Intel oneAPI Base Toolkit
  4. Intel oneAPI HPC Toolkit
  5. Delft3D-4 GUI

Follow the default installation instructions for Anaconda Python.

For Visual Studio, choose the "Desktop development with C++" workload and ensure the following additional components are selected:

  1. C++ MFC for latest v142 build tools (x86 & x64)
  2. C++/CLI support for v142 build tools (Latest)
  3. C++ Modules for v142 build tools (x64/x86 – experimental)

See the SciVision guide for installing the Intel FORTRAN compiler using Intel oneAPI.

After logging into the Deltares Get Started pages, use the request form to obtain a copy of the Delft3D-4 GUI and a license. Install the DS_Flex license manager with your license file and then install the Delft3D-4 GUI.

Prepare Visual Studio Solution

Save this python helper script as prepare_sln_auto.py in the \path\to\Delft3D\src directory.

Now, run the script from an Anaconda3 Powershell prompt (open from the Anaconda3 Start menu folder):

(base) PS > cd \path\to\Delft3D\src
(base) PS > python prepare_sln_auto.py
...
Visual Studio  Version : 2019
.Net Framework Version : v4.6.1
Intel oneAPI Version : 2021
Solution path :

Compile with Visual Studio

  1. Open Visual Studio
  2. Open the delft3d_open.sln file in the src directory
  3. Using the solution explorer, open the third_party_open/netcdf/netcdff/Header Files/nfconfig.inc file
  4. Edit line 99 to read #define HAVE_TS29113_SUPPORT and save the file
  5. Change the configuration from "Debug" to "Release"
  6. Change the platform from "Win32" to "x64"
  7. Select "Build Solution" from the "Build" menu
  8. Wait...

Test

After downloading the SNL-Delft3D-CEC Tutorial 2 Files, follow the steps in the SNL-Delft3D-CEC Tutorial 1 and SNL-Delft3D-CEC Tutorial 2 pdf files.

Binaries

The x64 binaries compiled in this tutorial are available to download with this release.

@how-ll
Copy link

how-ll commented Oct 12, 2022

Hi~
I got some errors, when I am compiling by using "delft3d_open.sln". Here are some my errors:

error #6439: This symbol has too many characters. [OMPX_TARGET_ALIGNED_ALLOC_DEVICE] (from File: omp_lib.h; Line: 895)
error #6439: This symbol has too many characters. [OMPX_TARGET_ALIGNED_ALLOC_SHARED] (from File: omp_lib.h; Line: 911)
Compilation Aborted (code 1) (from File: ...\engines_gpl\part\packages\kernel_f\src\delpar.F90 Line: 1)
fatal error LNK1181: cannot open input file '...\src\engines_gpl\part\packages\kernel_f\x64\Release\part_kernel_f.lib'
fatal error LNK1181: cannot open input file '...\src\engines_gpl\waq\bin\x64\Release\delwaq_dll.lib'

How can I fix these errors? Could you kindly give me some suggestions? I have got Delft3D-4 complication for about 2 weeks.
Thank you very much!

@LutherT
Copy link

LutherT commented Nov 30, 2022

Hi~ I got some errors, when I am compiling by using "delft3d_open.sln". Here are some my errors:

error #6439: This symbol has too many characters. [OMPX_TARGET_ALIGNED_ALLOC_DEVICE] (from File: omp_lib.h; Line: 895) error #6439: This symbol has too many characters. [OMPX_TARGET_ALIGNED_ALLOC_SHARED] (from File: omp_lib.h; Line: 911) Compilation Aborted (code 1) (from File: ...\engines_gpl\part\packages\kernel_f\src\delpar.F90 Line: 1) fatal error LNK1181: cannot open input file '...\src\engines_gpl\part\packages\kernel_f\x64\Release\part_kernel_f.lib' fatal error LNK1181: cannot open input file '...\src\engines_gpl\waq\bin\x64\Release\delwaq_dll.lib'

How can I fix these errors? Could you kindly give me some suggestions? I have got Delft3D-4 complication for about 2 weeks. Thank you very much!

Hi, I have the same issue. Have you managed to fix it?

@andreall
Copy link

andreall commented Feb 8, 2023

Hi~ I got some errors, when I am compiling by using "delft3d_open.sln". Here are some my errors:
error #6439: This symbol has too many characters. [OMPX_TARGET_ALIGNED_ALLOC_DEVICE] (from File: omp_lib.h; Line: 895) error #6439: This symbol has too many characters. [OMPX_TARGET_ALIGNED_ALLOC_SHARED] (from File: omp_lib.h; Line: 911) Compilation Aborted (code 1) (from File: ...\engines_gpl\part\packages\kernel_f\src\delpar.F90 Line: 1) fatal error LNK1181: cannot open input file '...\src\engines_gpl\part\packages\kernel_f\x64\Release\part_kernel_f.lib' fatal error LNK1181: cannot open input file '...\src\engines_gpl\waq\bin\x64\Release\delwaq_dll.lib'
How can I fix these errors? Could you kindly give me some suggestions? I have got Delft3D-4 complication for about 2 weeks. Thank you very much!

Hi, I have the same issue. Have you managed to fix it?

I am getting the same issue..did you managed to fix it?? Thanks!

@melloukimed
Copy link

Hi, I have the same issue, i was wondering if you managed to compile the code ?

@crc2001
Copy link

crc2001 commented Mar 6, 2023

Hi, I have the same issue, i was wondering if you managed to compile the code ?

You need to use oneAPI 2021. The problem is related to the version of the Intel Fortran Compiler; the 2023 version does not work with the version of Delft3D. Also, install Boost, NetCDF and HFD5.

@melloukimed
Copy link

@ervelascor , Could you please share a link from where I can download one API 2021?

@crc2001
Copy link

crc2001 commented Mar 8, 2023

@ervelascor , Could you please share a link from where I can download one API 2021?

Here: https://ufile.io/f/hcyu9. Itis a temporary repository, so you have to download within one month. Also, be sure you have completely uninstalled the oneAPI2023, otherwise it will create conflicts.

@LutherT
Copy link

LutherT commented Mar 9, 2023

Hi, I have the same issue, i was wondering if you managed to compile the code ?

You need to use oneAPI 2021. The problem is related to the version of the Intel Fortran Compiler; the 2023 version does not work with the version of Delft3D. Also, install Boost, NetCDF and HFD5.

Hi. Thanks, I have doanloaded the 2021 API. But I still have issues. What did you mean by install Boost, NetCDF and HDF? Are they to be seprately installed and not compiled through delft3d? Thanks for your help!

@beeblack7
Copy link

hi there

@ervelascor , Could you please share a link from where I can download one API 2021?

Here: https://ufile.io/f/hcyu9. Itis a temporary repository, so you have to download within one month. Also, be sure you have completely uninstalled the oneAPI2023, otherwise it will create conflicts.

hi there, im coming late, is there any possible way to download oldest one API version here? im really getting stuck to compiled this app with these kind of error, or maybe is it possible to share the compiled file that we need to run delft3d? can we use the binaries right here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment