84
IRIS WORKSTATION GUIDE
4.
If the file is a C file containing routines to be called from FORTRAN,
the comments for extcentry(1) must be placed in the C source, and
the .o file placed in the target list. In addition, the dependency of
the .o file on the .fc file must be placed in the makefile in the same
way as callf.o depends on callf.fc in the example above (line seven).
The programs mkc2f, mkf2c, and extcentry are found in the directory /usr/bin on
the IRIS Workstation.
D.3 Interfacing to the IRIS Graphics Library
The IRIS Graphics Library is written in C. As described in the previous
sections, its routines cannot be called directly from FORTRAN. The wrappers
for these routines have been written, and are contained in the library
/usr/lib/libfgl.a. This library is searched automatically by f77(1) if the -Zg switch
(discussed below) is used.
In addition, the FORTRAN equivalent of the standard graphics include files
have been written. The first, /usr/lib/include/fgl.h is the equivalent of the C include
file gl.h. It contains the types and declarations of the graphics routines for
FORTRAN, and the declaration of a common block named GL containing the
most commonly used constants in the IRIS Graphics Library.
NOTE: This include file must be included by each
FORTRAN routine that must use the IRIS Graphics Library.
The second include file, /usr/include/fdevice.h, is the equivalent of device.h for
FORTRAN routines. It contains the definition of a common block named
DEVICE, that contains such constants as colors, mouse buttons, etc. It must be
included by each FORTRAN routine that needs these constants. As an
example, a FORTRAN routine that is to use the IRIS Graphics Library would
contain the line
$INCLUDE /usr/include/fgl.h
in its declaration section. The '$' of $INCLUDE is in column 1.
The FORTRAN 77 compiler on the IRIS Workstation supports the special
switch -Zg, that should be used whenever an executable file using graphics is
created. This switch causes the program to be loaded with the IRIS Graphics
Library -lgl, the graphics FORTRAN interface library -lfgl, and the math library,
-lm. Additionally, the program is loaded with the essential FORTRAN binary
/usr/bin/fgldat.j, which is a block data routine (named GLDATA) that initializes
the common blocks GL and DEVICE. (The -Zg switch also does the appropriate
things for C programs that use the IRIS Graphics Library. In this case, only the
C version of the IRIS Graphics Library (libgl.a) and the math library (libm.a) are
searched.)
FORTRAN binary files (referred to as files in the FORTRAN Reference Manual),
are named with .j suffixes on the IRIS Workstation. If you expect to make these files and
Appendix D:
Version 1.0
Need help?
Do you have a question about the IRIS Workstation and is the answer not in the manual?