autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fortran module name mangling


From: Thomas Jahns
Subject: Re: fortran module name mangling
Date: Sun, 18 Aug 2013 20:49:11 +0200

Hello,

On Aug 17, 2013, at 13:07 , Frederik Beaujean wrote:
I want to call a subroutine in a fortran module in C++ and discovered
the AC_FC_FUNC macro. It seems it does not work with fortran modules. So
the result it produces is useless. For concreteness, I want to call
nestRun from the multinest library defined in fortran as

module Nested
...
contains

 subroutine nestRun(...)
...

end subroutine nestRun
end module Nested

On linux with gfortran 4.6 and autoconf 2.68, I try

AC_FC_FUNC(nestRun)
echo "mangled name:" $nestRun

and obtain

mangled name: nestrun_

but the actual name in the library is __nested_MOD_nestrun

Until now, the "recommended" procedure in multinest is to manually check
for either of the gnu or intel compiler and enter the mangled routine
name by hand. But this is hardly portable, as I just tried it out on the old gfortran 4.2 on a mac, and the mangled name is different from the above.


I'd like to collaborate on this but I only have the following compilers available to test for:

- PGI versions from 9.x on
- Intel versions 10.x and later
- IBM XL Fortran 12.1.0.x and later
- NAG 5.1 and later
- SX but I have no control over the version on the system

(and several versions of gfortran of course), so if one could find others with Lahey and other Fortran 90 or more modern compilers, that would be a plus.

Regards, Thomas
--
Thomas Jahns
DKRZ GmbH, Department: Application software

Deutsches Klimarechenzentrum
Bundesstraße 45a
D-20146 Hamburg

Phone: +49-40-460094-151
Fax: +49-40-460094-270
Email: Thomas Jahns <address@hidden>



Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]