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

Generic Module packaged in DLL

Intel_C_Intel
Employee
483 Views
We are converting a core DLL to use REAL(8) precision and would like to make the routine generic so that calling programs only require a "USE ..." rather than changing a lot of REAL(4)'s to REAL(8)'s. The general idea is that the interface defines the generic subroutine name used in higher level program components and the implementations have a structure like:

CONTAINS

Subroutine A_Single(DBLE(X),DBLE(Y),DBLE(Z))
...
Subroutine A_Double(X, Y, Z)

The only thing we have not done is determine the best way to package the generic function inside of the DLL. This is similar to the way Fortran generics are used but I'd like a pointer to an example of how it's done. Probably have one on the CVF 6.6 disk, but I haven't found it yet.

Thanks for all the help

John
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
483 Views
There should be nothing special about DLLs -- just don't forget to distribute .mod file that comes from compiling the module along with .dll and .lib. Mod file should be handled similarly as an INCLUDE file. AFAIK DLLIMPORT directives are not required, so that shouldn't be an issue.
0 Kudos
Intel_C_Intel
Employee
483 Views
Well, I found out that the generic module approach didn't really solve our problem. I had not thought it out fully and only later realized that C++, VB, and Delphi couldn't take advantage of the .mod file info so we will probably have to package the DLL with two modules; one for REAL(4) arguments and another for REAL(8) ones.

I've posted a better defined question related to this problem under the heading "common interface for mixed languages".

Thanks for the help
0 Kudos
Reply