HP Fortran Programmer's Guide (March 2010)
Compiling and linking
Linking HP Fortran programs
Chapter 2 85
If your program calls routines in a library but the linker is unable to resolve the references,
compile with the -Wl,-v option. The f90 command passes -v to the linker, causing it to
process in verbose mode. The verbose information includes:
• The names of the libraries that the linker is searching. This information can confirm that
the linker is searching the correct libraries.
• The names of the object files selected by the linker to resolve the references. The linker
may have found the same name in another library and resolved the reference there.
Many library-related problems are owing to a misplaced -l on the command line. The -L
option (discussed in “Library search rules” on page 87) is also order-sensitive and can cause
similar problems.
Linking HP Fortran 90 routines
When calling HP Fortran 90 routines on the HP 9000 Series 800, you must include the
appropriate run-time libraries by adding certain arguments to the aCC command when
linking your program. These arguments depend on how the Fortran 90 routines were
compiled:
32-bit PA-RISC 1.1 code
-L/opt/fortran90/lib/ -lF90 -lisamstub
32-bit PA-RISC 2.0 code
-L/opt/fortran90/lib/pa2.0/ -lF90 -lisamstub
64-bit PA-RISC 2.0 code
-L/opt/fortran90/lib/pa20_64/ -lF90 -lisamstub
NOTE For more information on Itanium library paths corresponding to the above
examples, see “Libraries linked by default on Itanium” on page 83 .
Additional HP Fortran libraries
HP Fortran provides the following two libraries you can link with Fortran programs:
• /opt/fortran90/lib/libU77.a on PA-RISC or /usr/lib/hpux[32|64]/libU77.a On
Itanium: The BSD 3f (libU77) library, which provides a Fortran interface to some of the
libc system routines. Programs that reference routines in this library must be compiled
with the +U77 option. For information about porting Fortran programs that reference
libU77 routines, see “Migrating to HP Fortran” on page 219.