File: README.fortran

package info (click to toggle)
glut 3.7-25
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, sarge, squeeze
  • size: 13,036 kB
  • ctags: 47,177
  • sloc: ansic: 148,716; makefile: 44,180; ada: 2,062; yacc: 473; fortran: 290; lex: 131; csh: 52; sed: 49
file content (169 lines) | stat: -rw-r--r-- 6,872 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
GLUT Fortran users,

BUILD INSTRUCTIONS
===================

To build the GLUT Fortran API, do the following:

  1)  Make sure you are running IRIX 5.3, 6.1, or 6.2 or higher.

  2)  Make sure you have Fortran compilers and OpenGL Fortran
      libraries installed (make sure you have the right support
      installed for the "object style" you wish to build).

      The following Fortran subsystems are particularly important
      to have installed:

        ftn77_dev.sw.util  -- utiles for building Fortran to C bindings
	gl_dev.sw.fortran  -- OpenGL Fortran binding libraries

  3)  Run "mkmkfiles.sgi" in this directory.

  4)  Make sure you have built the "lib/glut" and "lib/fglut"
      directories:

      (cd lib/glut; make)
      (cd lib/fglut; make)

  5)  Change to one of the GLUT Fortran library directories,
      depending on what "object style" you wish to build:

      O32 (old 32-bit ABI) - "cd lib/fglut"
      N64 (new 64-bit ABI) - "cd lib/fglut.n64"   (IRIX 6.1 & 6.2 only)
      N32 (new 32-bit ABI) - "cd lib/fglut.n32"   (IRIX 6.2 only)

      (If you are building a given "object style", make sure you
      build the accompanying GLUT library implementation.  See
      README.irix6)

  6)  Execute "make" in the directory.

NOTES
======

All GLUT functionality is available through the GLUT Fortran API.

A number of example GLUT Fortran examples are built in the directory as
examples of how to write GLUT Fortran programs.

There are a number of caveats to using the GLUT Fortran API:

  o  The GLUT Fortran API is not built by default.

     See the build instructions above.  You will need the IRIX Fortran
     development option installed.

  o  The implementation of the GLUT Fortran API is probably only useful
     to IRIX users because the generation of Fortran-to-C wrappers is
     inherently dependent on vendor-dependent calling convention
     dependencies.

  o  The IRIX GLUT Fortran API is implemented as a set of wrappers to
     to the GLUT C implementation.  As such, there is a very slight
     overhead to calling OpenGL routine through the GLUT Fortran
     binding (this applies to the OpenGL Fortran wrapper routines as
     well).

  o  The ARB's official OpenGL Fortran API prefixes every routine and
     constant with the letter F.  The justification was to avoid name
     space collisions with the C names.  Nearly all modern Fortran
     compilers avoid these name space clashes via other means (underbar
     suffixing of Fortran routines is used by most Unix Fortran
     compilers).

     The GLUT Fortran API does _not_ use such prefixing conventions
     because of the documentation and coding confusion introduced by
     such prefixes.  Bending over backwards to support anachronistic
     compliers does not justify this confusion.

     While the official OpenGL Fortran API, prefixes both routine and
     constant names, there is no technical justification for prefixing
     constant names.  In practice, it creates a reasonable amount of
     coding and documentation confusion (the confusion is heightened by
     Fortran's default implicit variable initialization so you don't
     realize the lack of a constant prefix until run-time) and pushes
     names one character towards identifier limits.

     The GLUT distribution supplies its own version of "GL/fgl.h" and
     "GL/fglu.h" which does not F-prefix constants.  GLUT users are
     encouraged to not use the F-prefixed constants.  (The GLUT
     supplied "GL/fgl.h" also works around problems discussed in the
     next bullet.)

     Perhaps the OpenGL ARB will reconsider the F-prefix or (as an
     unfortunate compromise) support both F prefixed and non F prefixed
     constant names.

  o  A OpenGL Fortran API implementation was released with IRIX 5.3
     (it was not previously available in IRIX).  While the Fortran
     wrappers work, there are a number of difficulties with using the
     IRIX 5.3 OpenGL Fortran bindings:

       +  Make sure you have the "Fortran 77 OpenGL Graphic Library"
	  subsystem installed.  Its name is:  ftn_dev.sw.opengl

       +  The OpenGL Fortran man pages incorrectly document a number of
	  calls taking REAL*4 (real) parameters when they in fact
	  require REAL*8 (double precision) parameters.  An example is
	  fglviewport.  Any OpenGL (or GLU) routine that takes double's
	  as parameters in the C API, takes REAL*8's in the Fortran
	  API.  Be very careful to use the dble intrinsic whenever
	  passing non-REAL*8 values to such routines!

       +  The OpenGL Fortran man pages also do not add the F-prefixes
	  to constants discussed in the man pages.  Because GLUT
	  supplies a "GL/fgl.h" without F-prefixes, this should be a
	  "good thing."

       +  The "GL/fgl.h" header file describing the OpenGL Fortran API
	  contains identifiers over 32 characters long.  While the MIPS
	  Fortran compiler should treat this as a soft warning and
	  truncate the identifiers to 32 characters, the compiler
	  generates a fatal error.  For this reason, the "GL/fgl.h" in
	  this distribution has truncated by hand the "GL/fgl.h"
	  identifiers over 32 characters to 32 characters.

  o  IRIX 6.2's OpenGL Fortran binding was quite bungled and is
     basically unusable.
     
     A workaround for this problem is to compile your OpenGL Fortran
     programs with the compiler option "-Wl,-ignore_unresolved".  This
     tells the compiler to ignore unresolved symbols.

     Then, when you run the OpenGL Fortran binaries, tell the run-time
     linker (rld) to ignore unresolved symbols like this:

       setenv _RLD_ARGS -ignore_unresolved

     SGI patches 1892 (IRIX 6.3 and 6.4 OpenGL Fortran bindings) and
     2360 (IRIX 6.2 OpenGL Fortran bindings) should fix problems in the
     OpenGL Fortran binding library.

  o  Because GLUT fonts are compiled into programs and programs
     should only have the fonts compiled into them that they use,
     GLUT font names like GLUT_BITMAP_TIMES_ROMAN_24 are really
     symbols so the linker should only pull in used fonts.
     Unfortunately, if a data symbol is declared EXTERNAL, the
     IRIX Fortran compiler pulls in the symbol whether the symbol
     is used or not.  For this reason, "GL/fglut.h" does not
     explictly declare EXTERNAL the GLUT font symbols.  GLUT
     Fortran programmers should explicitly declare EXTERNAL
     the GLUT fonts they use.

  o  Neither the MicroUI (mui) or Tubing and Extrusion library (gle)
     have Fortran bindings.

INSTALLATION
=============

If you want to install the resulting archives into the right system
library directories, do the following:

     FOR N32:  cp lib/fglut.n32/libfglut.a /usr/lib32

     FOR N64:  cp lib/fglut.n64/libfglut.a /usr/lib64

Also, make sure to install the GLUT library implementation versions for
the given object style too.

- Mark Kilgard