0

I have a large fortran code-base of which I would like to move some parts to dll's. After doing some research I know how to build a normal fortran dll with my IDE of choice (code::blocks) and how to use it in another fortran program. However, I have run into a wall. As long as I only need to put procedures in the dll everything is peachy. However, what I want to do is to include a Fortran 2003 class in such a way that I can also use the class in my fortran program. The first problem is that a class needs to be imbedded in a module (which is slightly but importantly different from a normal fortran file for a dll). In itself, this is not a big issue for building the dll, but it is when trying to access the subroutines or class.

I currently have a stopgap solution which entails including a use statement in my program: use mydllmodule; and also placing the module file mydllmodule.mod in the module directory of my program.

Is there a nicer way of creating a fortran dll which contains fortran classes, and allows them to be accessed in the main program (without the use of compiler specific pragma's, since this code is compiled and run on my local windows machine for development, and compiled and run on an HPC for production). I am looking for a setup in which the life of the user can be as simple as possible (i.e. just put dll somewhere, maybe use a use-statement)

thanks

DannyVanpoucke
  • 100
  • 1
  • 8

0 Answers0