Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28381 Discussions

WAMIT dll doesn't work when recompiled with new compiler in Windows

Thomas__Sarah
Beginner
1,513 Views

Hi,

I am trying to modify a dll file that is used within a commercial software called WAMIT. The instruction manual for WAMIT states:

"WAMIT Version 7 is compiled with Intel Visual Fortran (Version 12.1). The previous Version 6.4PC was compiled with Intel Visual Fortran (Version 10.1) and earlier versions were compiled with Compaq Visual Fortran. Any of these Fortran compilers can be used to compile modified versions of the files geomxact.dll and newmodes.dll for use with a single processor (NCPU=1), using the following procedure:
• Open a new project ‘geomxact’ as a Fortran Dynamic Link Library
• Add geomxact.f to the project
• Build a release version of geomxact.dll
• Copy the new version of geomxact.dll to the working directory for WAMIT ....

...It may be possible to use other FORTRAN compilers to build the DLL files, but certain conventions in calling subroutines must be consistent with those of Intel Visual Fortran."

I have not been able to find any of these 3 old compilers, so have instead tried to rebuild the dll from the fortran file using Intel Visual Fortran Compiler 18.0 (from Intel® Parallel Studio XE Cluster Edition for Windows* 2018) together with Microsoft Visual Studio Enterprise 2015 (currently on a 30 day trial period). I am running on a 64 bit computer with Windows 10.

I have followed the above instructions from the WAMIT manual, however there is something different about the dll that is built, as WAMIT is unable to see the file, giving the error "The system cannot find the file specified".

I have asked the WAMIT developers, and they have told me that they do not understand Visual Basic so I should contact you, as they apparently did the last time that they changed compilers.

Please can you help me to troubleshoot this? Perhaps there are some options that I can add to the fortran project which will make the dll the same as when compiled by Intel Visual Fortran 12.1?

Many thanks in advance,

Sarah

 

0 Kudos
1 Solution
mecej4
Honored Contributor III
1,517 Views

Much depends on which version of WAMIT is under use. Which version are you using? From the WAMIT documentation, it appears that versions 7.x of WAMIT are 64-bit, so what was written regarding 32-bit targets and STDCALL does not apply if you are using versions 7.x of WAMIT. 

You really need to settle the 32-or-64-bit question first. Dumpbin /headers is one way to do so. For more ways, please see https://www.raymond.cc/blog/determine-application-compiled-32-64-bit/ .

If you want useful advice about the error messages that you see, you must be willing to share those error messages here. Those messages may mean little to you, but it may happen that the error message will tell someone else exactly what went wrong.

 

View solution in original post

0 Kudos
24 Replies
Thomas__Sarah
Beginner
278 Views
0 Kudos
Thomas__Sarah
Beginner
278 Views

FIXED!

Thank-you so much everyone for your help! It was indeed compiling a 32-bit dll instead of a 64 bit dll. I have now recompiled it as a 64 bit dll, and WAMIT is able to run again. I am sorry that I didn't notice this before, and am so appreciative of all of your guidance here.

I haven't yet used the particular WAMIT function that calls this dll, so there may be further questions on that when I get there, but I have at least succeeded in building a dll that WAMIT is able to see (even if I am not using the function, then WAMIT won't run without recognising the newmodes.dll).

One last question however:

I wrote the following option in the command line in visual basic: "/iface:cvf" as instructed to earlier (I think regarding STDCALL). Should I leave that there now that I am compiling 64 bit?

Thanks,

Sarah

0 Kudos
mecej4
Honored Contributor III
278 Views

Thomas, Sarah wrote:
 I wrote the following option in the command line in visual basic: "/iface:cvf" as instructed to earlier (I think regarding STDCALL). Should I leave that there now that I am compiling 64 bit?

Don't specify /iface:cvf when building 64-bit objects, the option will just cause confusion later. There was no 64-bit version of CVF for Windows.

You wrote "Visual Basic" in many places, but you probably had "Visual Studio" in mind.

0 Kudos
Thomas__Sarah
Beginner
278 Views

Yes, you are correct sorry, I meant Visual Studio :-)

I have just run my modified fortran code, and the resulting dll works within WAMIT! I cannot thank you all enough for your help. This has been an incredibly frustrating week, and I can finally now progress with my research/numerical model :-)

Many thanks,

Sarah

0 Kudos
Reply