4. Embedded SQL for Fortran : Preprocessor Operation : Command Line Operations : The Fortran Compiler
 
Share this page                  
The Fortran Compiler
The preprocessor generates Fortran code. The code generated is in tab format, in which each Fortran statement follows an initial tab. For information on the Embedded SQL format acceptable as input to the preprocessor, see Embedded SQL Statement Syntax for Fortran (see page Embedded SQL Statement Syntax for Fortran).
The preprocessor uses "structure and record" syntax by default. If the ‑f90 flag is used, the preprocessor declares structures and records using the "type" syntax from the f90 standard as used by gfortran.
UNIX
Use the UNIX f77 command to compile this code. You can use most of the f77 command line options. If you use the -i2 compiler flag to interpret integer and logical declarations as 2-byte objects, you must have run the Fortran preprocessor with the -i2 preprocessor flag.
As mentioned in The SQL Communications Area (see page The SQL Communications Area) in this chapter, you may want to use the -u compiler flag to verify that the SQLCA has been declared correctly with an include sqlca statement in all program units containing Embedded SQL statements.
The following example preprocesses and compiles the file "test1." The Embedded SQL preprocessor assumes the default extension:
esqlf test1
f77 test1.f
VMS
Use the VMS fortran command to compile this code. Most of the fortran command line options can be used. If you use the noi4 qualifier to interpret integer and logical declarations as 2-byte objects, you must have run the Fortran preprocessor with the -i2 flag. You must not use the g_floating qualifier if floating-point values in the file are interacting with Ingres floating-point objects. Note, too, that many of the statements that the Embedded SQL preprocessor generates are nonstandard extensions provided by VAX/VMS. Consequently, you should not attempt to compile with the nof77 qualifier.
As mentioned in The SQL Communications Area (see page The SQL Communications Area) in this chapter, you may want to use the warnings=declarations qualifier to verify that the SQLCA has been declared correctly with an include sqlca statement in all program units containing Embedded SQL statements.
As of Ingres II 2.0/0011 (axm.vms/00) Ingres uses member alignment and IEEE floating-point formats. Embedded programs must be compiled with member alignment turned on. In addition, embedded programs accessing floating-point data (including the MONEY data type) must be compiled to recognize IEEE floating-point formats.
The VMS default qualifier /g_float is not a standard and should not be used.
On Alpha systems, hardware support for D_float is only partial, the default has changed to G_float, and support for IEEE (IEEE 754-1985 standard for floating point arithmetic) has been added. Because of this, and because IEEE is available on other platforms and is recognized as an industry standard, Ingres for OpenVMS Alpha uses the IEEE format.
All programs and libraries should be compiled using the IEEE qualifier. Do not mix programs or libraries compiled with different qualifiers.
For example:
esqlf prog.sf
fortran /float=ieee prog
Failure to use the /float=ieee qualifier or the use of non-IEEE float numbers will result in unpredictable results when non-IEEE floats are used as keys or in restrictions. For details, see Sample Application Compiled with /float=ieee Flag (VMS) (see page Sample Application Compiled with /float=ieee Flag (VMS)).
The following example preprocesses and compiles the file "test1." The Embedded SQL preprocessor assumes the default extension:
esqlf test1
fortran/list test1 
Windows
Use the Windows df command to compile this code. The following compile options are required for Windows:
/name:as_is
Treat uppercase and lowercase letters as different.
/iface:nomixed_str_len_arg
Requests that the hidden lengths be placed in sequential order at the end of the argument list.
/iface:cref
Names are not decorated, the caller cleans the call stack, and var args are supported.
If you use the /integer_size:16 qualifier to interpret integer and logical declarations as 2-byte objects, you must have run the Fortran preprocessor with the -i2 flag.
As mentioned in the chapter "The SQL Communications Area," you may want to use the warnings=declarations qualifier to verify that the SQLCA has been declared correctly with an include sqlca statement in all program units containing Embedded SQL statements.
The following example preprocesses and compiles the file "test1." The Embedded SQL preprocessor assumes the default extension:
esqlf test1
df /compile_only /name:as_is /iface:nomixed_str_len_arg /iface:cref test1 
Note:  For any operating system specific information on compiling and linking ESQL/Fortran programs, see the Readme file.