fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |



%LIBRARY <file> <file> : : %END [OF] LIBRARY


The commands %LIBRARY and %END OF LIBRARY are written in specification (fsp) files to indicate lists of primary files which are to be treated as components of a library. The library files are read and analysed in the same way as standard Fortran input files, but they are written to the output directories only if they are needed to build the program or programs which are being processed. If none of the sub-programs in a file are called in the main call trees, the file is not output.

The commands allow fpt to be used to bring together components of a large program into a single build directory. fpt selects all and only those files required for the program to be built. fpt is run on the code, which is then built with commands of the form, for example:

$ gfortran -c *.f90

The %LIBRARY - %END OF LIBRARY commands may not be nested. An %END OF LIBRARY command terminates library processing, irrespective of the number of %LIBRARY statements which have been encountered. The presence of two or more %LIBRARY or %END OF LIBRARY commands is not considered to be an error, and no check is made that every %LIBRARY command is followed by an %END OF LIBRARY command.

The commands apply only to primary files. All INCLUDE files are always written.

Where to Use this Command

Operating system command line No
Configuration file, config.fsp No
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt No
Interactive command files No
Embedded in the Fortran code No


Files are not assumed to be library files by default.


In the list of files between the LIBRARY and END OF LIBRARY directives only those which contain sub-programs in the main call tree will be output by fpt.

! basin.fsp % input directory: ../source drill.f refract.f reflect.f scatter.f basinip.f basinop.f % input directory: /usr/people/shared/matlib/source % library vecmat.f matmul.f invert1.f invert2.f simplex.f polygon.f func1.f func2.f func3.f func4.f ixdel.f % end of library ! End of basin.fsp

See Also


Copyright ©1995 to 2022 Software Validation Ltd. All rights reserved.