FORTRAN Reference Manual
Compiler Directives
FORTRAN Reference Manual—528615-001
10-45
LIBRARY Compiler Directive
LIBRARY Compiler Directive
The LIBRARY directive establishes the default user library for the object file. When you 
run your program, the system consults the user library file specified in the LIBRARY 
directive for any unsatisfied external procedure references in the object file, before it 
consults the system library code space.
file-name
is a Guardian file name that specifies an object file to use as the default user 
library file for the object file. It cannot be a DEFINE name. Compile-time defaults 
are supplied for any missing qualifiers in file-name. file-name must be a 
Binder object file.
Considerations
•
The LIBRARY directive must appear on the FORTRAN command line following the 
semicolon after the object file name, or in the source input file before the first 
FORTRAN source statement.
•
If you specify a LIBRARY directive after the first FORTRAN statement, the 
compiler issues an error message and ignores the directive.
•
If you specify two or more properly placed LIBRARY directives, the compiler uses 
the first one, and issues a warning message for each of the others.
•
If you want the FORTRAN compiler to consult the user library file for calling 
sequences, you must specify that user library file in a CONSULT directive and in 
the LIBRARY directive.
•
If the RUN command includes a LIB file-name run-option, that file is used 
instead of the file named in the LIBRARY directive. That is, the run-time 
specification overrides the compile-time specification.
•
You can include TAL subprograms in the user library object file. You can also 
include subprograms written in FORTRAN, provided they don’t: 
°
Directly reference data items declared in COMMON, DATA, or SAVE 
statements, or data items that are declared equivalent to such items.
°
Directly reference data items allocated in the extended data segment as a 
result of any LARGEDATA directives.
For more information about libraries, see Section 9, Program Compilation and 
Section 11, Running and Debugging Programs.
Example
?LIBRARY mylib
LIBRARY file-name










