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 />

Example<br />

<strong>LF</strong>95 MYPROG.F90 -win<br />

Creating a 32-bit Windows DLL<br />

To create a 32-bit Windows DLL, use the -dll option.<br />

Example<br />

<strong>LF</strong>95 myprog.f90 -dll -win -ml msvc<br />

In this example, the source file MYPROG.F90 contains procedures with DLL_EXPORT statements.<br />

The following takes place:<br />

1. MYPROG.F90 is compiled to create MYPROG.OBJ.<br />

2. MYPROG.OBJ is automatically linked with the <strong>LF</strong> <strong>Fortran</strong> runtime library to create<br />

MYPROG.DLL and MYPROG.LIB, the corresponding import library. Calling conventions<br />

in this case are those expected by Microsoft Visual C/C++.<br />

For more information on DLLs, see ”Dynamically linked applications” on page 54.<br />

Creating a static library<br />

To create a static library, specify the library name using the -out option.<br />

Example<br />

<strong>LF</strong>95 mysub.f90 -out mylib.lib<br />

<strong>LF</strong> <strong>Fortran</strong> recognizes that a library is requested because of the .lib extension for the output<br />

file. This causes <strong>LF</strong> <strong>Fortran</strong> to invoke the library manager rather than the linker. If the library<br />

specified with -out does not exist, it is created; if it already exists, it is updated.<br />

OpenGL Graphics Programs<br />

OpenGL is a software interface for applications to generate interactive 2D and 3D computer<br />

graphics independent of operating system and hardware operations. It is essentially a 2D/3D<br />

graphics library which was originally developed by Silicon Graphics with the goal of creating<br />

an efficient, platform-independent interface for graphical applications (Note: OpenGL is a<br />

trademark of Silicon Graphics <strong>Inc</strong>.). It is available on many Win32 and Unix systems, and<br />

is strong on 3D visualization and animation.<br />

f90gl is a public domain implementation of the official <strong>Fortran</strong> 90 bindings for OpenGL, consisting<br />

of a set of libraries and modules that define the function interfaces. The f90gl<br />

interface was developed by William F. Mitchell of the Mathematical and Computational Sciences<br />

Division, National Institute of Standards and Technology, Gaithersburg, in the USA.<br />

For information on f90gl, see the f90gl web page at:<br />

http://math.nist.gov/f90gl<br />

26 <strong>LF</strong> <strong>Fortran</strong> <strong>Express</strong> User’s <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!