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

Call a Fortran DLL with IMSL from C#

akrallis
Beginner
1,015 Views
We have developed a Fortran DLL using the Fortran v10.1.025 which uses some of the IMSL functionality. We have also developed a C# wrapper class that calls the Fortran function. The C# method fails with "unable to load DLL" error (thisPCdoes not have the Fortran or IMSL installed). By using the dependancy walker tool we see that this behaviour is due to the absence of the imsl_dll.dll file. Please indicate us the appropriate way to manage callinga functionofFortran-IMSL DLL from C# (which specific compiler options or other configurations required).Furthermore Iwould like toask you if it is preferable to use the static or the dynamic form of the IMSL library.Thank you in advance.
0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,015 Views
You have a choice - you can place a copy of imsl_dll.dll on the target system where Windows will find it (a folder in PATH), or can build your DLL against the static IMSL library. My preference would be for the static build. You would probably also want to link the DLL against the static Fortran libraries.

Since you are using version 10.1, you'll want to add:

!DEC$ OBJCOMMENT LIB:"libguide.lib"

to the source that has the include of 'link_fnl_static.h"

View solution in original post

0 Kudos
1 Reply
Steven_L_Intel1
Employee
1,016 Views
You have a choice - you can place a copy of imsl_dll.dll on the target system where Windows will find it (a folder in PATH), or can build your DLL against the static IMSL library. My preference would be for the static build. You would probably also want to link the DLL against the static Fortran libraries.

Since you are using version 10.1, you'll want to add:

!DEC$ OBJCOMMENT LIB:"libguide.lib"

to the source that has the include of 'link_fnl_static.h"
0 Kudos
Reply