Generic Module packaged in DLL

Generic Module packaged in DLL

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:


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


3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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.

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today