views:

38

answers:

1

I have obtained program that is lovely mesh of fortran and c code. In order for this program to compile it requires a series of libraries that comes precompiled from software vendor. This included among others Intel MKL, MPICH2 etc. On linux everything works just fine. But on windows I am stuck:

Using the command line, I can compile the program using ifort in two of the following ways:
[A] ifort /Qlowercase /assume:underscore .......
[B] ifort /Quppercase /assume:nounderscore ........

If I decided to with option A, I will get a series of missing symbols since some the external libraries is compiled using uppercase nounderscore, and I am unable to resolve these symbols. Likewise if I go with option B, other external libraries will complain since they are compiled using lowercase with a underscore.

Is there any way to remap the symbols/functions during the link state? Is there any alternative?

+1  A: 

If you use the ISO C Binding in your Fortran source code you can exactly specify the name of the C routine to be called. Include an underscore or not, as appropriate for the particular routine. The "binding name" is also case sensitive so you can also control this aspect of routine names. Then use the compiler option so that the compiler doesn't further alter names.

M. S. B.
Okay I took some effort, but it solved. Actually with the ISO binding, I can compile with all kinds of combination of mangling. Thanks!
Smidstrup