On Sun, Aug 18, 2013 at 8:49 PM, Thomas Jahns <jahns@xxxxxxx> wrote: > > 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 Hi did you try cfortran ? It is a header only file what allow to link fortran with C and vice versa. I use debian package and i maintain upstream. http://packages.qa.debian.org/c/cfortran.html Please report bug here http://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=cfortran And download from here http://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=cfortran I plan to modernize it, so please test it and report any error. Please test plain old fortran call first not function that are part of module. Bastien > > -- > 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 <jahns@xxxxxxx> > > > > > _______________________________________________ > Autoconf mailing list > Autoconf@xxxxxxx > https://lists.gnu.org/mailman/listinfo/autoconf > _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx https://lists.gnu.org/mailman/listinfo/autoconf