Forum

RE: Error compiling Delft3D source code VS 2017 and IFORT18

PM
Pietro Mazzon, modified 3 Years ago.

Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 11 Join Date: 12/26/17 Recent Posts
Hi everyone,

I'm trying to compile the lastest version of the Delft3D source code (7545), but when I run the "prepare_sln" file form "src" folder and the window to choose the versions of Visual Studio and Intel Fortran shows, I get a problem.
I choose the versions VS 2017 (professional) and IFORT18 (I checked that they are correctly installed and IFORT component is correctly added to Visual Studio) but when I click apply in the command window error showed in the attached file occurs.
I'm using Python 3.6.4 (lastest available), on a Win10 PC.


(I'm sorry for the part in italian: ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat"" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch.

It sais that the file "vcvarsall.bat" is not recognized as an internal or external command, an executable program or a batch file)



I saw in another thread that even if these two versions of VS and IFORT are not tested yet, can be succesfully used to compile the source code.


Does someone has a solution to this poblem?

I would really appreciate your help, I'm being mad with that!!

Thanks to everyone,

Pietro
JA
Jorge Abramian, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 12 Join Date: 1/15/18 Recent Posts
I'm dealing with the same problem. Almost. I'm using Python 2.7. Running the file, the first error that strikes is that it is not recognizing the dir of VS 2017. It says that UniversalCRTSdkDir is not defined, and tries tu run in x86 VS 14 a .bat file that does not find.

To me the python file is somehow not taking the folder tree of VS 2017. May that be? I too need help.

Thanks,

jorge
JA
Jorge Abramian, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 12 Join Date: 1/15/18 Recent Posts
Hi Pietro, I believe we were both doing something wrong. Instead of compiling "prepare_sln.py" I directly opened in VS 2017 the file "delft3D_open.sln". It compiled for about an hour and then crashed. However, till then generated a win64 folder with several exe, including wave, swan, and flow2d3d.

I tried them and they seem to work. At least, I could run an example of wave (example 07). However, when I opened quickplot, I couldn't bring up anything (may be there is nothing to open!). All these is very new for me (used to work with DevC++ and Java, but VS and all these other tools are strange).

I also compiled the solution nefis.sln, without errors. It created a bunch of testXX.exe files. I don't know what they are for.

And compiled the io_netcdf.sln. It gave me 2 errors


"io_netcdf_dll: warning: TargetPath(C:\Delft3D GUI 4.03.01 Windows for source code users\Repository3\src\utils_lgpl\io_netcdf\packages\io_netcdf\dll\x64\Release\io_netcdf_dll.dll) does not match the Linker's OutputFile property value (C:\Delft3D GUI 4.03.01 Windows for source code users\Repository3\src\utils_lgpl\io_netcdf\packages\io_netcdf\dll\x64\Release\io_netcdf.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).

I don't know how to correct this, because the explanation is kind of cryptic to me. I don't know what is io-netcdf good for either. But, when the delft3D_open.sln failed, it showed an error, saying:

FATAL ERROR LINK 1181: cannot open file ..\io\lib\x64\release\io.lib.

I hope this helps you PIetro. If someone else who knows more about compiling and using Delft3D could give us a hand it will be very much appreciated.

Thank you and buona fortuna.

Jorge
Adri Mourits, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Padawan Posts: 97 Join Date: 1/3/11 Recent Posts
Hi Jorge and Pietro,

I'm sorry, I didn't test yet with VisualStudio 2017+Ifort18 yet. What happens if you remove/disable line 525 in prepare_sln.py: getUCRTVersionNumber()

I'm surprised you are able to compile the key parts of Delft3D (flow2d3d and wave, unfortunately not waq), given that prepare_sln.py crashed.

After running example 07, you should be able to open both the NetCDF and the Nefis wavm_obw output files in QuickPlot and inspect computed results. May be the QuickPlot "open file"-dialogue window is filtering these files out.

Forget about nefis.sln and io_netcdf.sln. You probably don't need them.

Regards,

Adri
JA
Jorge Abramian, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 12 Join Date: 1/15/18 Recent Posts
Hi Adri,

Thank you for your fast response. Actually, I checked and it compiled Waq too! I don´t know what is missing, but I did not use prepare_sln.py. I've just compiled the delft3D_open.sln.

1) I will check the line that you mentioned and try to compile again.

2) I ran example 7, and I can see 2 wavm-obw files. One .dat, the other .def. I cannot find any netcdf file. Anyway, I opened the .dat file in quickplot and yes, I was able to see wave height plots and vector plots.

3) I don't know what I have missing now. Everything seems to work, but for sure, something must be wrong as the compiler crashed before the end.

4) Is there a way to check if I have all the files required? The win64 folder contains 1158 files, in 62 folders. Total weight 480 Mb

Thanks!
JA
Jorge Abramian, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 12 Join Date: 1/15/18 Recent Posts
Jorge Abramian:
Hi Adri,

Thank you for your fast response. Actually, I checked and it compiled Waq too! I don´t know what is missing, but I did not use prepare_sln.py. I've just compiled the delft3D_open.sln.

1) I will check the line that you mentioned and try to compile again.

2) I ran example 7, and I can see 2 wavm-obw files. One .dat, the other .def. I cannot find any netcdf file. Anyway, I opened the .dat file in quickplot and yes, I was able to see wave height plots and vector plots.

3) I don't know what I have missing now. Everything seems to work, but for sure, something must be wrong as the compiler crashed before the end.

4) Is there a way to check if I have all the files required? The win64 folder contains 1158 files, in 62 folders. Total weight 480 Mb

Thanks!


Correction: I do not have the waq exe. Just the waq GUI exe. Seems that is what went wrong.
JA
Jorge Abramian, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 12 Join Date: 1/15/18 Recent Posts
Sorry all,

I'm still struggling with these codes. I tried to generate a new sln commenting line 525 of the prepare_sln.py file. It gives the same error when I run it:

Does not find ...\DFLOWFM\SCRIPTS\TEMPLATE\DFLOWFM_OPEN_TEMPLATE.SLN.

The dflowfm folder does not exist within src
the file dflowfm_open_template.sln does not exist within src

I don't know what to do next...

Discouraging...

bye
PM
Pietro Mazzon, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 11 Join Date: 12/26/17 Recent Posts
Hi Adri and Jorge,

Jorge, my error OCCURS when I try to run the python file "prepare_sln", so it's before the actual compilation in VS.
Anyway, I removed the line with that function in "prepare_sln" and now it runs correctly, creating the file compatible with my versions of VS and IFORT.
So, remove line 525 works, thanks Adri.

Unfortunately when I tried to build the source code with VS2017 and IFORT18 the whole OS chrashes, and the only thing I can see is an error about something that NET Framework can't manage.
So I guess that something must be arranged in the code to deal with these new versions.

Anyway, now I'm trying with VS2015 and IFORT16. I'll let you know if it works (I really hope that) or if I will still have problems.

Thank you,


Pietro
JA
Jorge Abramian, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 12 Join Date: 1/15/18 Recent Posts
Hi Pietro,

I did install VS2015 with Fortran 16. Compiled the python script with no problem. Ran the .sln. Same error as before. At a certain point gives a fatal error Link 1181, cannot find an io.lib.

82>C:\Delft3D GUI 4.03.01 Windows for source code users\Repository3\src\utils_lgpl\d_hydro_lib\include\d_hydro.h(41): warning C4005: 'HAVE_STRUCT_TIMESPEC': macro redefinition
82> C:\Delft3D GUI 4.03.01 Windows for source code users\Repository3\src\utils_lgpl\d_hydro_lib\include\d_hydro.h(41): note: command-line arguments: see previous definition of 'HAVE_STRUCT_TIMESPEC'
82>c:\delft3d gui 4.03.01 windows for source code users\repository3\src\utils_lgpl\d_hydro_lib\include\component.h(84): warning C4002: too many actual parameters for macro 'GetCurrentTime'
82>C:\Delft3D GUI 4.03.01 Windows for source code users\Repository3\src\utils_lgpl\d_hydro_lib\include\d_hydro.h(169): warning C4002: too many actual parameters for macro 'GetCurrentTime'
82>LINK : fatal error LNK1181: cannot open input file 'x64\Release\flow2d3d_openda_lib.lib'


By mistake I installed VS2015 update 4. May be that? I don't know how to check if Net framework 4.6 is installed. I can see other things installed, like asp. net frameworks and tools 2013.

I don't know if I have to build the solution as Release x64, anyway I tried different combinations.

Nothing.

If I was discourage...
PM
Pietro Mazzon, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 11 Join Date: 12/26/17 Recent Posts
Hi Jorge,

I tried again installing VS2015 (professional, update4) and IFORT16, and now they compile the file correctly.
I was unsure about the installation of .NET Framework too, so I tried to download the .NET Framework exe from Microsoft website, and when I ran it, the installer sais that it's already installed on the PC. I guess that it's included in VS, so don't worry about that, or try to do as I did.

Did you install VS professional or another version? Maybe it's that one the problem. Install the professional one.

In VS, you have to select: Release (not Debug) and x64 (not win32).

About your missing library, I mention this common error that I found here:

System and/or compiler specific libraries can not be found.
Normally these libraries are found via some environment parameters (PATH and LD_LIBRARY_PATH). Problems may occur when porting binaries to a machine without development tools. Especially when FLOW runs online with WAVE, finding the correct compiler specific libraries is sensitive.
All needed system/compiler specific libraries are copied into directory "myCode/bin/<platform>/***/bin" during installation. Thus creating a set of binaries that can be distributed to other machines.
Windows: Normally a message window appears to notify what library is missing.
Linux: Use the ldd command to find out what library is missing


About your fatal error: when I was compiling, the compilation stopped when it tried to compile the file "flow2d3d_openda" saying that it was not necessary to install it in x64 version. So I stopped the compilation manually. Then I checked the bin folder and I had the file: hydro.exe and flow2d3d.dll, so I guess that my binaries are built correctly.
So try to set "Release" and "x64", and maybe it will work.

I compiled the trunk version (https://svn.oss.deltares.nl/repos/delft3d/trunk/), but maybe you can try with a tag version (https://svn.oss.deltares.nl/repos/delft3d/tags/7545/ this one, or a previous one).
Which version are you using?

You can also try to have your repository saved on the Desktop (C:\Users\Desktop\DelfDashboard\Delf3D_Repository). I had an error installing Delft Dashboard, but I solved it when I saved the program on the desktop. Maybe it can help.

I also found this in the FAQ, it tells something about missing libraries: [url=http://oss.deltares.nl/web/delft3d/faq#On Windows compilation of the tools kubint, lint and datsel fail in debug mode with the message "LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'"]http://oss.deltares.nl/web/delft3d/faq#On Windows compilation of the tools kubint, lint and datsel fail in debug mode with the message "LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'"

Hope that this can help you emoticon

@Adri: About that problem with prepare.sln, I give a feedback. If I remove that line from the script, prepare.sln works with both VS2015 and VS2017. I tried also to download again the source code in different repositories, and when I ran from there prepare.sln without removing that line, it does not give the problem that I had. I don't know what gave that error.

Cheers,

Pietro
JA
Jorge Abramian, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 12 Join Date: 1/15/18 Recent Posts
Hi Pietro,

I ran the py script without any problem. Compiled Ok, without commenting any line. I don't remember what was going on before, but I got it right now.

I am running VS2015 with IF16. Release, x64 (although I tried other combinations leading to the same problems). Seems that MFC was missing. I installed it. Now, everything goes smooth till a point when everything hangs up and I have to reboot the computer. I used tags/7545.

Anyway, I got further this last time. It compiled almost everything. Hangs up with flow2d3d-Openda. And this is the problem from the beginnning, something related to not finding a library. It does not compile the following project VS either.

How do you stop manually the compilation at flow2d3d_openda? I cannot, as when I got to that point, the computer crashes...

Now, if xxx-openda is not needed, wouldn't it better to eliminate the project all together?

Just to check, I got the following bins (folder/exe files/other files, mostly dlls):

Dimr, 7 exe, 16
flow2d3d, 13 exe, 38
menu, 0, 1
part, 1, 1
plugins, 0, 1
scripts, 0, 3
shared, 3, 32
swan, 1, 1
waq, 2, 12
wave, 1, 20

I'm sure I have something missing. Please, could you check? Grazie mile.

jorge
PM
Pietro Mazzon, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 11 Join Date: 12/26/17 Recent Posts
Hi Jorge,

I tried yesterday evening to compile version tags/7545 but my PC chrashed.

I used the trunk version. Maybe you could try with that one.

I don't really know why, but every time that I compile the script, the compilation goes further, as happened to you.

The same for me, it stops with a file called "openda" and doesn't proceed anymore. To stop the compilation manually I tried to stop the building going in the menu in the upper part of VS, and there was an option for stopping the compilation. Actually, it didn't work, so I killed VS using the Task Manager. I waited a lot before the Task Manager started to work, but I made it. (an advice, before the compilation close everything, folders, web pages etc... and let the screen on the whole time. I noticed that if I try to use the PC during the calculation or I let the sreen saver on, the compilation freezes and the PC crushes).

About eliminating that project... I don't really know. You should ask that to Adri.

I checked in my folder and yes, you miss a folder called "esmf" containing an exe and some dlls. But I'm not completely sure that I have everything since I stopped the compilation. On the how-to-compile the source code webpage it's written that if you have "d_hydro.exe" and "flow2d3d.dll" the binaries are built correctly, so I guess that it can work (also your compiled code, without that esmf folder). But I don't really know that.

Did you try to run the examples in .../YourRepository/examples ?
Try with 01_standard. Let me know if it compiles the bat file.

Prego! emoticon

Pietro
JA
Jorge Abramian, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 12 Join Date: 1/15/18 Recent Posts
Hi Adri and Pietro,

Here I attached the output log. Yes Adri, I am trying with 7545. Please, Adri, take a look at the exchange we had with Pietro. Thanks a lot!

jorge
Adri Mourits, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18 (Answer)

Padawan Posts: 97 Join Date: 1/3/11 Recent Posts
Hi Jorge,

You managed to compile Delft3D-FLOW, Delft3D-WAVE and DELWAQ. Congratulations. You must be able to run the examples.

Problems are reported related to flow2d3d_openda (which is not being used anymore) and vs: a small tool that you will probably not use.

Regards,

Adri
ST
Sarah Margaret Trimble, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 2 Join Date: 5/24/18 Recent Posts

Hi all,

I see that the last update to this thread was > 3 months ago; however I have just had the same initial error (string has no attribute "decode" -- see attachment). The winding thread of solutions here is hard to follow. Is it still recommended that I first try removing (commenting out) line 524 using visual studio?

Thanks for your help --
Sarah 

SP
Seb Pitman, modified 3 Years ago.

RE: Error compiling Delft3D source code VS 2017 and IFORT18

Youngling Posts: 2 Join Date: 5/23/18 Recent Posts

Hi Sarah,

 

I've come up against the same problem today (VS 2017 enterprise and Ifort 18).

 

I took a look in the Programme Files and found the vcvarsall batch file that was being called, and then simply substituted its path into the prepare_sln file on Line 186, as follows:

getucrtdir["2017"] = '"' + str(os.environ.get("VS140COMNTOOLS")) + "..\\..\\VC\\vcvarsall.bat" + '" amd64&&set UniversalCRTSdkDir'

was replaced with:

getucrtdir["2017"] = '"' + "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" + '" amd64&&set UniversalCRTSdkDir'