Several compile-line options control
how the compiler treats external names and how the linker (ld)
searches files and directories. The LPATH
environment variable provides another way to specify the library
search path. Other options provide ways to control how ld
formats the executable it produces.
For complete information about all compile-line options, see
Chapter 13, "Compile-line options".
The
link phase can be suppressed entirely by using the -c
option. When -c
is specified on the compile line, the f90
driver does not call ld
and instead generates a .o
file for the source code. The .o
file can later be linked to generate an executable program.
Library searching options |
 |
By default the linker searches the /opt/fortran90/lib
and /usr/lib
directories (in that order) in its attempt to map external names
to library routines. The following options and the LPATH
environment variable can be used to specify different paths and
files that will be searched.
- -L directory
Force
ld to search
for libraries in directory before searching
the default directories. May be specified multiple times.
- -lx
Force
ld to search
in the libx.sl
(or libx.a)
library. May be specified multiple times. The libraries are searched
in the order they are specified.
The LPATH environment variable
The LPATH
environment variable specifies which directory or set of directories
ld searches.
If LPATH is set,
ld searches the
directories specified by it and any specified by the -L
option.
When LPATH
is set, you must include the default directories in addition to
any others if you want ld
to include the default directories in its search.
If LPATH
is not set, ld
searches the default directories (/opt/fortran90/lib
and /usr/lib)
and any specified by the -L
option.
Name mapping options |
 |
The compiler normally does not properly map libU77
routine names, and it converts external names to lowercase. The
following options can be used to override these default behaviors.
- +ppu
Forces the compiler to append underscores
to all external names, including subroutines, functions, and common
blocks.
- +U77
Force the compiler to map libU77
routine names to /opt/fortran90/lib/libU77.a.
When +U77 is
specified and (+ppu
is not) the compiler adds a trailing underscore to names from the
libU77 library.
- +uppercase
Force the compiler to convert external
names to uppercase. (The default is to convert external names to
lowercase.)
Output file options |
 |
These options determine the format of the output file (executable)
written by ld.
- +demand_load
Causes ld
to mark the output file with demand load.
Demand-loadable process' pages are brought into physical
memory only when they are accessed.
(By default, or by the +nodemand_load
option, the ld
output file is not marked as such.)
- +k
Generates
code for programs that reference a very large number of shared data
items. ld issues
a message if this option is needed.
- +noshared
Causes ld
to mark the output file with unshared.
A shared executable's text segment is shareable by multiple
processes.
(The default, +shared,
marks the output file with shared.)
- +strip
Causes ld
to strip symbol table information before writing the output file.
(The default is +nostrip.)