Fortran FLI queston

I am developing an application whose main calculations will be done in a set of Fortran 95 routines. Is it the case that any Fortran routine (integer function, per Gauss documentation) called directly from Gauss MUST NOT be in a Fortran module? I have success in test cases as long as I'm calling functions that are not in a module, but not if the same routines are in a module. If this restriction is true, it  makes things a bit more messy on the Fortran end of things.

Thanks for your help!

Joffre

2 Answers



0



This particular Aptech poster is not intimately familiar with Fortran 95 modules. However, I think you should be able to find the answer by looking at what it takes to call a Fortran 95 module from C.

I would expect that the worst case is that you would have to make a small C wrapper function to call your Fortran module and then that would be called by DLLCALL. Though I would not expect this to be required.

Some common reasons (which you may well have thought of) that you might be having trouble are:

  1. The function is not exported in the shared library.
  2. The compiler has used name decoration to change the name.

If that does not help, let us know your exact error, operating system, and compiler.

aptech

1,773


0



Test answer because I'm getting blocked from answering because I'm "posting too fast", according to WordPress.

 

Your Answer

2 Answers

0

This particular Aptech poster is not intimately familiar with Fortran 95 modules. However, I think you should be able to find the answer by looking at what it takes to call a Fortran 95 module from C.

I would expect that the worst case is that you would have to make a small C wrapper function to call your Fortran module and then that would be called by DLLCALL. Though I would not expect this to be required.

Some common reasons (which you may well have thought of) that you might be having trouble are:

  1. The function is not exported in the shared library.
  2. The compiler has used name decoration to change the name.

If that does not help, let us know your exact error, operating system, and compiler.

0

Test answer because I'm getting blocked from answering because I'm "posting too fast", according to WordPress.

 


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.