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

call subroutine in dll A from subroutine in dll B

Erik_J_
Beginner
271 Views

I have some LAPACK routines (F95 or F77?) in a DLL and write some stubs to cal the LAPACK routines that I call  from C#
I put those stubs in another DLL.
At least, that's the general idea to solve the problem of having to recompile ALL the Fortran many times, when I put everything in one DLL.
I want to build the LAPACK dll only once and develop the stubs separately.
How would I do this calling of the LAPACK routines?

I was pointed to "modules" and to "loadlibrary" which seem to be quite different approaches.

I use VS2015 on win10 and call from c#, which goes well.

0 Kudos
2 Replies
Arjen_Markus
Honored Contributor I
271 Views

Just you would call routines in a static library. The routines in the DLL with LAPACK should be exported, but that is matter of linking it. (You may want to use a .def file for this). Linking is done against the corresponding import library (.lib instead of .dll). No need to explicitly load the DLL via LoadLibrary.

0 Kudos
Steven_L_Intel1
Employee
271 Views

I wouldn't use a ,def file for this - just link one DLL against the other's export library.

0 Kudos
Reply