NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
The f2c one/two-underscore behaviour is rather difficult to handle, as I found out when trying to build the MITgcm ocean model, see here:
http://forge.csail.mit.edu/pipermail/mitgcm-support/2006-October/004374.htmlSo I have decided to become 100% second-underscore-free. To do this I had to rebuild netCDF. Here is the necessary configure statement (used successfully with 3.6.2-beta4 on Linux, Cygwin and MSYS+MinGW):
CC=gcc FC=g95 CPPFLAGS=-DpgiFortran FFLAGS=-fno-second-underscore FCFLAGS=-fno-second-underscore ./configure
If you get it wrong, "make" completes OK, but "make test" fails when testing the Fortran code.
Why am I sharing this with the group? Partly for posterity (AKA Google searches). But I have three questions/comments:
1. Perhaps this could be made the default? It would break G77 compatibility and cause a bit of confusion in the short term, but in the long term I think we would all be better off.
2. I have to set both FFLAGS and FCFLAGS? Why? Surely one would do.3. I note that the configure script reports (for example): "checking for C-equivalent to Fortran routine SUB... sub_". I haven't looked at the configure code, but I assume it is trying different C names (sub, sub_, SUB, etc) until it gets the right one. The subroutine/function names in the netCDF-3 F77 interface all have underscores. So why not do the test with a name that includes an underscore? Then the f2c name-mangling could be handled automagically?
-- Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou" m.hadfield@xxxxxxxxxx National Institute for Water and Atmospheric Research (NIWA) ============================================================================== To unsubscribe netcdfgroup, visit: http://www.unidata.ucar.edu/mailing-list-delete-form.html ==============================================================================
netcdfgroup
archives: