HP Fortran Programmer Guide (766160-001, March 2014)

Line 8 is the command line thatf90 passes to the linker (ld). If you use the ld command to link
hello.f90, the command line should be similar to the one shown here.
As noted in the comments on lines 7 and 8, compiling and linking hello.f90successfully using
both the f90and ldcommands requires three command lines:
$ f90 -c hello.f90 # compile
$ export LPATH=/opt/fortran90/lib/pa1.1:/usr/lib/pa1.1:\
/opt/fortran90/lib:/usr/lib:/opt/langtools/lib# set LPATH
$ ld -x /opt/langtools/lib/crt0.o hello.o \ /opt/fortran90/lib/libF90.a
-lcl -lc -lisamstub # link
The command line to setLPATH in the csh is:
$ setenv LPATH /opt/fortran90/lib/pa1.1:/usr/lib/pa1.1:\
/opt/fortran90/lib:/usr/lib:/opt/langtools/lib# set LPATH
For more information about the linker, see the ld(1) man page. For a list of f90 options that you
can use to control the linker, see Table on page 14. To pass linker options from the f90 command
line to the linker, use the-Wl option (for an example, see “Linking to shared libraries” (page 53)).
The HP Fortran Programmer’s Reference, fully describes the -Wl option.
Linking to libraries
When you use the f90 command to create an executable program, the linker looks in the libraries
listed in Table 2-14 to resolve references. By default, the linker uses the shared libraries, if available.
For information about shared libraries, see “Linking to shared libraries” (page 53).
The libisamstublibrary is provided as a tool for migrating HP FORTRAN77™ programs that
call ISAM routines. The ISAM library is not available with HP Fortran, but the stub library allows
the linker to resolve references to ISAM routines in HP FORTRAN 77 programs.
Table 22 Libraries linked by default on PA-RISC
ContentsLibrary
Archive version of HP Fortran runtime library/usr/lib/libcl.a
Shared version of HP Fortran runtime library/usr/lib/libcl.sl
Archive library of array intrinsic procedures/opt/fortran90/lib/libF90.a
Shared library of intrinsic procedures and system routines,/usr/lib/libc.sl
Archive libraries of stubs to satisfy ISAM references/opt/fortran90/lib/libisamstub.a
/opt/fortran90/lib/libisamstubs.a
Shared library of stubs to satisfy ISAM references/usr/lib/libisamstub.sl
Table 23 Libraries linked by default on Itanium
ContentsLibrary
Archive version of HP Fortran runtime library/usr/lib/hpux[32|64]/libIO77.a
Shared version of HP Fortran runtime library/usr/lib/hpux[32|64]/libIO77.so
Archive library of array intrinsic procedures/usr/lib/hpux[32|64]/libF90.a
Shared library for Fortran intrinsic procedures/usr/lib/hpux[32|64]/libF90.so
Archive library for Fortran intrinsic procedures on parallel
mode
/usr/lib/hpux[32|64]/libF90_paral lel.a
Shared library for Fortran intrinsic procedures on parallel
mode
/usr/lib/hpux[32|64]/libF90_paral lel.so
Linking HP Fortran programs 51