G95: just say no to second underscore

Roy Mendelssohn Roy.Mendelssohn at noaa.gov
Mon Jan 29 21:43:15 MST 2007


For Absoft Fortran the standard that they are trying to enforce is  
for the name is lower case and an underscore at the end, but I am  
pretty certain that htis is a single underscore.  The compiler  
directives that Absoft prefer for their compiler are:

   -YEXT_NAMES=LCS -YEXT_SFX=_

As an Absoft tech support person put it several years ago:

> if you could request that the
> library be built with Fortran entry points folded to lower case with
> underscores appended to comply with all other libraries precompiled  
> for use
> with Pro Fortran:
> f77 -f -N15
> f90 -YEXT_NAME=LCS -YEXT_SFX=_

I don't know the g95 conventions,  I know that g77 had different  
conventions than Absoft.

HTH,

-Roy

On Jan 29, 2007, at 7:05 PM, Mark Hadfield wrote:

> Ed Hartnett wrote:
>> Howdy Mark!
>>
>> I am responding to your email rather late, because I just got g95 up
>> and running in the netCDF nightly build system.
> Good.
>
> I have cut out a lot of quoted text here, but basically my original  
> message described how to build netCDF with g95 using the "-fno- 
> second-underscore" convention. I also suggested making this the  
> default...
>
>> Can you tell me what the consequences of this are?
>>
>> Do g95 users have to use -fno-second-underscore when compiling a
>> fortran program with the netCDF library?
>>
> Yes, they would have to do this.
>> If I just set -Df2cFortran when compiling netCDF, g95 works without
>> any further fuss. What is wrong with doing that?
>>
> Only that g95's default "second-underscore" name mangling  
> complicates building other packages, e.g. the MITgcm ocean model,  
> and you can't mix libraries that use different name mangling  
> conventions. (The same is true of g77.) This can be worked around  
> in each case, of course, but personally I think it's simpler to use  
> "-fno-second-underscore" everywhere.
>> I have just added g95 to a number of our nightly test platforms. The
>> intention is to have netCDF 3.6.2 do the "right thing" for g95. Now I
>> just have to know what the right thing is!
>>
> Hmmm. My original message to the group didn't bring a deluge of "I  
> agree" responses, so perhaps you should stick with the default.
>
> My next suggestion was that the test in the configure code for  
> Fortran-C linking could use a subroutine name with an underscore  
> (given that the f2c name-mangling convention behaves differently  
> for names with and without underscores, and all the names in the  
> netCDF-3 Fortran interface have underscores).
>>
>> At the moment configure automatically sets -Df2cFortran for g95, and
>> everything seems to work. What's wrong with that?
>>
> Well, when you say "automatically" you mean that it works OK  
> because of a lot of special-case code. Just like all the other  
> packages that cope with g77's and g95's perverse name mangling.
>
> But, I guess the sensible approach for you to take is "if it ain't  
> broke don't fix it".
>
> -- 
> Mark Hadfield          "Ka puwaha te tai nei, Hoea tahi tatou"
> m.hadfield at niwa.co.nz
> National Institute for Water and Atmospheric Research (NIWA)
>
>
>
> ====================================================================== 
> ========
> To unsubscribe netcdfgroup, visit:
> http://www.unidata.ucar.edu/mailing-list-delete-form.html
> ====================================================================== 
> ========
>

**********************
"The contents of this message do not reflect any position of the U.S.  
Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division	
Southwest Fisheries Science Center
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

e-mail: Roy.Mendelssohn at noaa.gov (Note new e-mail address)
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."



==============================================================================
To unsubscribe netcdfgroup, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================



More information about the netcdfgroup mailing list