The binder is a program activated by the compiler option -bd, which scans an FCE to generate the list of objects required to build the program. It then presents the list to ld(1) for linking. The figure below shows how the binder relates to the rest of the FCE.
Intel Fortran Compilation Environment with the Binder |
|
The format of the option -bd is the following:
-bd,mainprogramname
where mainprogramname is the name specified in the PROGRAM statement of the main program, or is MAIN.PROGRAM if no PROGRAM statement is present.
A command line invoking ifc (IA-32 compiler) or efc (Itanium(TM) compiler) to compile Fortran source can also include a -bd option to invoke the binder; in this case, the results of the compilation are available to the binder.
The binder assumes that all objects belonging to the program are in the FCE defined by the program unit catalog list file specified by option -cl or by work.pc if the option -cl is not specified. Any other objects, for example non-Fortran objects, that are required in the linking stage, must be specified explicitly through the compiler.
The binder provides three principal advantages:
It automatically defines the objects to be included in a large scale project.
It detects and flags stale modules, as described in the preceding section.
It searches program unit catalogs in the order specified in the program unit catalog list file, so enabling the user to distinguish between identically named program units in different catalogs.
The use of the binder is not mandatory. Objects may be specified explicitly on the compiler command invocation line if desired.