C++-to-FORTRAN interface (was Re: your mail)

From: Pasha Murat (murat@cdfsga.fnal.gov)
Date: Sat Dec 05 1998 - 05:11:06 MET


Canguo Li writes:
 > 
 > 
 > On Fri, 4 Dec 1998, Valery Fine wrote:
 > 
 > >    Not it is not. This order is defined by platform/vendor/compiler.
 > >    For example for Digital Visual Fortran on Windows platform one 
 > > needs:
 > 
 > Dear Valery:
 > 
 >   Your explanation on calling Fortran from C/C++ on various platforms
 > is very valuable, and I've saved the message for future reference.
 > 
 >   Then I guess you have a ready answer for another question on 
 > Fortran compiler:
 > 
 >    On HP, I compiled my Geant3.21 application(written in Fortran) without
 > adding-post-pending-underscore, then I call CernLib and Geant3 subroutines 
 > by explicitly adding the postpending underscores. I think this makes my 
 > application's more readable and robust. However, when I tried to port this 
 > application to RedHat Linux on PC, where the fortran compilers are fort77 
 > and g77, I couldn't find the option to compile without adding postpending
 > underscore(which should have been the default for any fortran compiler?). 
 > 
 >  Do you or any Rooter happen to know the trick? Thanks in advance.
 > 
 > --Canguo


Dear Canguo,

	FORTRAN compilers on most of the platforms (SGI, SUN, Linux ...)
append FORTRAN global names with the underscore. This is different for 
Windows though. On Linux there is no way to have the names of FORTRAN globals 
without underscore. As you mentioned, the default for HP is different 
(no postfixing), however there is an option (+ppu, if I remember correctly) 
which forces the FORTRAN names to be underscore-terminated. 

You may want to consider using the undescore-terminated names as the default.


							-pasha.



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:40 MET