I am compiling a Fortran function for a Windows executable using the -Munix option which causes function names to be converted to lower case with an underscore appended.
Somehow this is causing a problem with the C 3F function “hostnm”.
I read the "C 3F Functions"section in the pgf77.htm document which I quote here:
The implementation of many of the routines uses functions which reside in the C library. If a C library does not contain the necessary functions, undefined symbol errors will occur at link-time. For example, if PGI 's C library is the C library available on the system, the following 3F routines exist in the Fortran run-time library but use of these routines will result in errors at link-time:
The ‘hostnm’ function is in the list that follows this quotation in the manual.
I don’t understand this statment, since in the line that immediately preceeds this quotation in the manual says:
These functions and subroutines are automatically loaded from the PGI 's Fortran run-time library if referenced by a pgf77 program.
What is the trick to use the ‘hostnm’ function??
I am familiar with doing one of the following from a previous problem I had with undefined references: use a special interface to the function; use a ‘C$PRAGMA C()’ in the fortran routine to redefine the name of the function; use a special ‘#define’ statement for ‘hostnm’; or rename the function somehow?
All other undefined references were resolved but the ‘hostnm’ is still problematic.