28.11.2012 Views

LF Fortran Express User's Guide - Lahey Computer Systems, Inc.

LF Fortran Express User's Guide - Lahey Computer Systems, Inc.

LF Fortran Express User's Guide - Lahey Computer Systems, Inc.

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2 Developing with <strong>LF</strong> <strong>Fortran</strong><br />

How the Driver Works<br />

The driver (<strong>LF</strong>95.EXE) controls the two main processes—compilation and linking—used to<br />

create an executable program. Supplemental processes, like creating static libraries, DLL’s,<br />

import libraries and processing Windows resources, are sometimes used depending on<br />

whether you are creating a DLL or a 32-bit Windows program. These processes are performed<br />

by the following programs under control of the driver:<br />

Compiler. The compiler compiles source files into object files and creates files required for<br />

using <strong>Fortran</strong> 90 modules and files needed by the linker for creating DLLs.<br />

Library Manager. LIB.EXE is the library manager. It can be invoked from the driver or<br />

from the command prompt to create or change static libraries.<br />

Linker. LINK.EXE is the linker. The linker combines object files and libraries into a single<br />

executable program or dynamic link library. The linker also adds Windows resources, like<br />

icons and cursors, into Windows executables, and creates import libraries for use with <strong>LF</strong><br />

<strong>Fortran</strong> dynamic link libraries (DLLs).<br />

Resource Compiler. RC.EXE is the resource compiler. It converts Windows resource files<br />

(.RC files) to.RES files. .RES files can be sent to the linker, or can be converted by<br />

CVTRES.EXE into object files.<br />

Running <strong>LF</strong> <strong>Fortran</strong><br />

By default, the <strong>LF</strong> <strong>Fortran</strong> driver program will compile any specified source files and link<br />

them along with any specified object files and libraries into an executable program.<br />

To run the driver, type <strong>LF</strong>95 followed by a list of one or more file names and optional command-line<br />

options:<br />

22 <strong>LF</strong> <strong>Fortran</strong> <strong>Express</strong> User’s <strong>Guide</strong><br />

<strong>LF</strong>95 filenames [options]<br />

The driver searches for the various tools (the compiler, library manager, linker, and resource<br />

compiler) first in the directory the driver is located and then, if not found, on the DOS path.<br />

To display the <strong>LF</strong> <strong>Fortran</strong> version number and a summary of valid command-line options,<br />

type <strong>LF</strong>95 without any command-line options or filenames.<br />

The command line options are discussed later in this chapter.<br />

Filenames<br />

Depending on the extension(s) of the filename(s) specified, the driver will invoke the necessary<br />

tools. The extensions.F95,.F90,.FOR, and.F, for example, cause the compiler to be<br />

invoked. The extension .OBJ causes the linker to be invoked; the extension .RC causes the<br />

resource compiler to be invoked.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!