f77(1)
f77, fort77 - Invokes the MIPSpro FORTRAN 77 compiler
Showing MIPSpro 7.4.3m.
NAME f77, fort77 - Invokes the MIPSpro FORTRAN 77 compiler SYNOPSIS f77 [options] file.[suffix] MAN PAGE ORGANIZATION This man page describes each option to the f77 compiler command. The man page is divided into the following subsections: * DESCRIPTION, which provides a general overview about the compiler. * ISA/ABI COMMAND LINE OPTIONS, which describes the specific command line options needed to select a specific Application Binary Interface (ABI) or Instruction Set Architecture (ISA). * OPTION DESCRIPTIONS, which provides a complete description of each compiler option. The options are described in alphabetical order. * OPTIONS FOR DEVELOPMENT, which lists several options used to aid compiler development and which are not generally used. The information for the -o32 ABI is no longer included on this man page. See the o32(5) man page for details. All optimization information has also been moved from this man page and is now on separate man pages. See the LNO(5) man page and the OPT(5) man page for information about the -LNO and the -OPT options. DESCRIPTION The SGI Fortran 77 compiler supports three different Application Binary Interfaces (ABI) controlled by the -o32, -n32, and -64 options (see abi(5) for information about the Application Binary Interface). The -o32 options are described on the o32(5) man page. The compiler produces files in the following formats: * SGI object code in elf format (the normal result) * binary intermediate files * symbolic assembly language * binary ucode files (-o32 only) f77 accepts several types of arguments: * Arguments with names ending with .f or .F are assumed to be FORTRAN 77 source programs. The programs are compiled, and each object program is left in a file named with the last component of the source, with .o substituted for the .f or .F extensions. The .o file is deleted only when a single source program is compiled and loaded at one time. * Arguments with names ending with .s are assumed to be symbolic assembly language source programs. When these programs are assembled, they produce a .o file. * Arguments with names ending with .i are assumed to be f77 source after being processed by the C preprocessor. They are compiled without predefining any symbols. The -nocpp option is ignored when compiling .i files. The following are the predefined symbols used by f77 for .f or .F files: LANGUAGE_FORTRAN _LANGUAGE_FORTRAN MIPSEB _MIPSEB mips host_mips __host_mips sgi __sgi _SGI_SOURCE _SYSTYPE_SVR4 _SVR4_SOURCE unix __unix f77 defines the LANGUAGE_ASSEMBLY and _LANGUAGE_ASSEMBLY preprocessor symbols when a .s file is being compiled. Use the f77 -show command to check the definitions that are in use. Option groups Many f77 options can be divided into option groups of related options; for example, those that specify optimization choices, or that specify target machine attributes. The following is the command line format for group options: -groupname:option[=value][:opt2[=val2]]... The group name is followed by a colon-separated list of options. These options are composed of an option name which can be followed by an equal sign and a value. The option name can be abbreviated by truncating it to a unique prefix; note that the abbreviation may change when new options are added to the group. Some options are specified with a setting that will enable or disable the feature. To enable a feature, specify the option alone or with =1, =ON, or =TRUE; to disable the feature, specify the option with =0, =OFF, or =FALSE. This man page only shows the ON or OFF settings, but the other settings are equally valid. These option groups are available only when compiling with -n32 or -64. The options described on this man page are interpreted by f77. See ld (1) for load-time options. ISA/ABI COMMAND LINE OPTIONS The following options control the choice of ABI and Instruction Set Architecture (ISA). -o32 or -32 Generate a 32-bit object. This defaults to -mips2 if -mips1 is not specified. This is the default when compiling on any non-R8000 based system, if no default specification file is present. See the o32(5) man page for details. -64 Generate a 64-bit object. This defaults to -mips4 if -mips3 is not specified. This is the default when compiling on any R8000 based system, if no default specification file is present. See the Defaults Specification Files subsection at the end of this man page for details. -n32 Generate an n32 object. This defaults to -mips3 if -mips4 is not specified. -mipsn Determine architecture type. n can be one of the following values: 1 Generate code using the instruction set of the R2000/R3000 RISC architecture, and search for mips1 libraries/objects at link time. This defaults to -o32. 2 Generate code using the MIPS II instruction set (MIPS I + R4000 specific extensions), and search for mips2 libraries/objects at link time. This defaults to -o32. 3 Generate code using the full MIPS III (e.g. R4000) instruction set, and search for mips3 libraries/objects at link time. This defaults to -n32 if -64 has not been specified. On R8000- based systems this defaults to -64. 4 Generate code using the full MIPS IV instruction set which is supported on R12000, R10000, R5000 and R8000 systems. Also search for mips4 libraries/objects at link time. This is the default on R8000 systems. This defaults to -n32 if -64 is not specified. On R8000-based systems it defaults to -64. OPTION DESCRIPTIONS -- Specify the first option to be discarded. In XPG4 mode, standard utilities that do not accept options but do accept operands recognize -- as the first argument to be discarded. This is used by portable applications as a way to shield their operands from any arbitrary options that the implementation may provide as an extension. For example, if the standard utility foo is listed as taking no options, and the application must give it a pathname with a leading hyphen, it could safely do it as the following: foo -- -myfile This avoids any problems with -m used as an extension. -alignn Determine object alignment. Valid for all ABIs. n can be one of the following values: 8 Permits objects larger than 8 bits to be aligned on 8-bit boundaries. Using this option has the largest impact on performance. 16 Permits objects larger than 16 bits to be aligned on 16-bit boundaries. 16-bit objects must still be aligned on 16-bit boundaries as per MC68000-like alignment rules. 32 Permits objects larger than 32 bits to be aligned on 32-bit boundaries. 16-bit objects must still be aligned on 16-bit boundaries, and 32-bit objects must still be aligned on 32-bit boundaries. This is the default for MIPS 1 code. 64 Enforces alignment on 64-bit boundaries for 64-bit and larger objects; all smaller objects must still be aligned on the corresponding boundaries. This is the default for programs compiled with the -mips2 option. 128 Enforces alignment on 128-bit boundaries for 128- bit objects; all smaller objects must still be aligned on the corresponding boundaries. This is the default for programs compiled with the -n32 or -64 options. -ansi[arg] Determine diagnostic messages. Using -ansi without any argument causes the compiler to diagnose any use of extensions which are not defined in the ANSI FORTRAN 77 standard. Valid for all ABIs. This option is ignored if -o32 is used. Using -ansiE causes the compiler to issue error messages for the use of extensions which are not defined in the ANSI FORTRAN 77 standard. Using -ansiW causes the compiler to issue warning messages for the use of extensions which are not defined in the ANSI FORTRAN 77 standard. If the SGI_CC environment variable is set to -ansi, then -ansi becomes the default behavior. ansiW is the default. -apo[arg] Run the automatic parallelization pass (-n32 or -64 only) to automatically discover parallelism in the source code. This also enables the multiprocessing directives. This option is ignored unless you are licensed for the MIPSpro Auto-Parallelizing Option. arg can be either list or keep. -apo list runs the automatic parallelization option when used with -n32 or -64. This also produces a listing file with a .anl suffix explaining which loops were parallelized, and if not, why not. -apo keep runs the automatic parallelization option when used with -n32 or -64 and produces the listing file, and also keeps the transformed multiprocessed Fortran intermediate file in a file with suffix .m. -backslash Treat the backslash character as a normal character instead of as an escape sequence character. Valid for all ABIs. For example, when this is used the sequence "\t" is treated as two separate characters instead of as a single TAB character. -bigp_off Disables the use of large pages within your program. This is the default for all optimization levels except -Ofast. -bigp_on Enables the use of large pages within your program. Once your program is compiled with this flag, you must also set the PAGESIZE_DATA, PAGESIZE_STACK, and PAGESIZE_TEXT environment variables to be one of the values 16, 256, 1024, 4096, 16384 (representing the size in kilobytes of the pages you want to use). If these environment variables are not set, then by default your program will use 16KB pages. This flag is turned on when -Ofast is specified. -bytereclen Causes the MIPSpro Fortran 77 compiler to interpret all record lengths in bytes. -c Suppress the loading phase of the compilation and force an object file to be produced even if only one program is compiled. -chararg1 Count arguments on the argument stack. Used with -n32 or -64 only. For subroutines accepting a variable number of arguments, the default is to count all arguments on the argument stack. Therefore, for each character argument, the count will be 2 because both the address of the character argument and its length are put on the argument stack. The -chararg1 option is provided to count each character argument as only one argument. -C, -check_bounds Performs runtime subscript range checking. Subscripts that are out of range cause fatal run time errors. If you set the F90_BOUNDS_CHECK_ABORT environment variable to YES, the program aborts. These options are equivalent to the -DEBUG:subscript_check option. For more information about that option, see debug_group(5). -chunk=integer Cause the same effect as putting a C$CHUNK=integer directive at the beginning of the file. -coln Determine the source statement format. n can be one of the following: 72 Sets the source statement format to the following: Column Contents 1-5 Statement label 6 Continuation indicator 7-72 Statement body 73-end Ignored 120 Sets the source statement format to the following: Column Contents 1-5 Statement label 6 Continuation indicator 7-120 Statement body 121-end Ignored -cord Run the procedure rearranger. See the cord(1) man page for details. -cpp Run the C macro preprocessor on the files before compiling. This is the default. -craylibs Uses the f90/f95 I/O library. See the description under -f90libs for information. -Dname=[def] or -Dname Define the name to the C macro preprocessor, as if by #define. If no definition is given, the name is defined as 1. -DEBUG:... Use the debugging features. This option controls compiler features related to debugging; for example, checking for possible errors (at compile time or execution time), or controlling the treatment of warning messages. See the DEBUG_group(5) man page for more information, including the individual options in this group. Also see the -g option for controlling information produced for the debugger. -dn Set double precision variable size. Valid for all ABIs. n can be one of the following values: 8 Use REAL*8 for any variables declared as DOUBLE PRECISION, and COMPLEX*16 for any variables declared as DOUBLE COMPLEX. This is the default. 16 Use REAL*16 for any variables declared as DOUBLE PRECISION, and COMPLEX*32 for any variables declared as DOUBLE COMPLEX. 16const Use REAL*16 and COMPLEX*32 as the defaults for DOUBLE PRECISION and DOUBLE COMPLEX constants, respectively, except when used as actual arguments. Used with -n32 or -64 only. -d_lines Specify that lines with a D in column 1 are to be compiled and not to be treated as comment lines. Valid for all ABIs. The default is to treat lines with a D in column 1 as comment lines. -dump_input Generate the Fortran listing file to stderr. Used with -n32 or -64 only. -E Run only the C macro preprocessor files (without considering suffixes), and send the result to the standard output. The resultant output will contain line directives. This overrides the -nocpp option. -expand_include Expand all include statements in the Fortran listing file. Used with -n32 or -64 only. This option is only applicable when used with the -listing option. -extend_source Pad each source line (if necessary) to make it 132 bytes long and give a warning if it exceeds 132 bytes. Valid for all ABIs. -f90libs Uses the f90/f95 I/O library. This option allows I/O interoperability with other Fortran subroutines. A subroutine compiled with this option can be linked with subroutines compiled with SGI Fortran 90/95 compilers, and the subroutines will use the same I/O units. In addition, this option supports the assign(1) command, which allows use of the Flexible File I/O library and other data conversion options. See the assign(1) man page and the INTRO_FFIO(3F) man page for information. -fb file Specify the feedback file to be used. Used with -n32 or -64 only. This file (with the suffix .cfb) can be produced by prof(1) with its -feedback option from one or more .Counts files generated by the execution of the instrumented program produced by pixie(1). -fb_create path Generates an instrumented executable program. Such an executable is suitable for producing one or more .instr files for subsequent feedback compilation. When the -c option is used to produce an object file that is eventually linked to form an instrumented executable, the -fb_create option should also be specified. The executable is instrumented with special instructions that generate information that the compiler can use to better optimize your program. When this instrumented executable is run (usually with a representative training inputset) that information is stored in a file called a.out.instr.pid in the directory that you specified by path. The path should be a complete path that also includes the name of the executable. For example, /tmp/fbdir/a.out produces a file called /tmp/fbdir/a.out.instr.pid, where pid is the process id of the invocation of your intrumented program run with a training input. -fb_opt path Specifies the directory that contains the instrumentation output generated by compiling with -fb_create and then running your program with a training inputset. Directs the compiler to use this information to better optimize the program. When the -c option is used to produce an object file that is eventually linked to form an instrumented executable, the -fb_opt option should also be specified. -flist Invokes the Fortran listing control group. This is equivalent to -FLIST:=ON. See the description of -FLIST for full details about using the listing control group. -FLIST: ... Invoke the Fortran listing control group, (which controls production of the compiler's internal program representation back into Fortran code), after IPA inlining and loop-nest transformations. This is used primarily as a diagnostic tool, and the generated Fortran code may not always compile. This option may be discontinued in future compiler releases. The following are the individual controls in this group: =flag Enable or disable the listing. flag can be either ON or OFF. This option is implied by any of the others, but may be used to enable the listing when no other options are required, as in this example: -FLIST:=ON ansi_format=flag Set the ANSI format. flag can be either ON or OFF. This uses a space (instead of tab) indentation and a maximum of 72 characters per line. The default is OFF. emit_omp=flag Use OpenMP directives. flag can be either ON or OFF. When FLIST:emit_omp is set to ON, generated files use OpenMP directives. This is the default. When set to OFF, generated files use MIPS multiprocessing directives, which are outmoded. emit_pfetch=flag Indicate prefetch information as comments in the transformed source. flag can be either ON or OFF. In the listing, the upper case PREFETCH denotes a prefetch and includes the variable reference (with an offset in bytes), an indication of read/write, a stride for each dimension, and a number in the range from 1 (low) to 3 (high) reflecting the confidence in the prefetch analysis. The lower case prefetch comments identify the reference(s) being prefetched by the PREFETCH descriptor above. The comments occur after a read/write to a variable, and give the identifier of the PREFETCH-spec for each level of the cache. The default is OFF. ftn_file=filename Specify the file where the program will be stored. This defaults to the source file name with extension .w2f.f. linelength=n Set the maximum line length to n characters. show=flag Print the input and output filenames to stderr. flag can be either ON or OFF. The default is ON. -fe Stop compilation immediately after the front-end is run. Used with -n32 or -64 only. -feedback Specify the feedback file to use. See the cc(1) man page for details. -fullwarn Requests that the compiler generate comment-level messages. These messages are suppressed by default. Specifying this option can be useful during software development. -Gnum Specify the maximum size, in bytes, of a data item that is to be accessed from the global pointer. num must a decimal number. If num is 0, no data is accessed. The default value for num is 8 bytes. Data stored relative to the global pointer can be accessed by the program quickly, but this space is limited. Large programs may overflow the space accessed by the global pointer at load time. If the loader gives the Bad -G num value error message, recompile the program with -G0. Use the same value for this option or for compiling all files that comprise a program executable or DSO. A preferred alternative is to use the -TENV short_lits and -TENV short_data options from the -TENV: option group (see the description for -TENV for details). The -TENV options provide better control. Either of those options override -G. -glevel Set debugging level. level can have one of the following values: 0 Produce no debugging information for symbolic debugging. This is the default. -g or 2 Produce additional debugging information for full symbolic debugging and not do optimizations that limit full symbolic debugging. These values override the -O, -O1, -O2, -O3 optimization options. 3 Produce additional debugging information for symbolic debugging of fully optimized code. This option makes the debugger inaccurate. This option can be used with the -O, -O1, -O2, -O3 optimization options. -help List all available options; this does not invoke the compiler. Used with -n32 or -64 only. -I[dir] Determine searching options for include files. Using -I without an argument disables searching for #include files in the standard directory ( /usr/include ). This option will be phased out in a future release; -nostdinc should be used in its place. Using -I dir allows you to specify a directory for searching. #include files whose names do not begin with / are always sought first in the directory of the file argument, then in directories specified in -I options, and finally in the standard directory (/usr/include). -in Set size for integer values. Valid for all ABIs. n can be one of the following values: 2 Make the default integer constants and variables short (2 bytes). All logical quantities will also be short. 4 Make the default integer constants and variables long (4 bytes). All logical quantities will also be long. This is the default. 8 Make the default integer constants and variables 64 bits (8 bytes). All logical quantities will also be 64 bits. -INLINE: ... Invoke the standalone inliner option group, which controls application of intra-file subprogram inlining when interprocedural analysis is not enabled. See the description of -IPA for details. See the ipa(5) man page for more information, including the individual options in this group. -ipa Invoke the Inter-Procedural Analyzer option group. This option is equivalent to -IPA:=ON. See the description under -IPA for complete details about the Inter-Procedural Analyzer option group. -IPA: ... Invoke the Inter-Procedural Analyzer option group which controls application of inter-procedural analysis and optimization, including inlining, common block array padding, constant propagation, dead function elimination, alias analysis and others. Use -IPA by itself to invoke the interprocedural analysis phase with default options. If you compile the program and link it in distinct steps, you must use at least -IPA for the compile step, and specify -IPA and the individual options in the group for the link step. See the ipa(5) man page for more information, including the individual options in this group. -keep Build intermediate compilation files named after the corresponding source files, with the suffix replaced by one that is appropriate for the type of intermediate file (e.g. the front end generates a binary intermediate .B file). These intermediate files are never removed even when a compilation pass encounters a fatal error. -keepdollar Treat $ as a normal last character. Used with -n32 or -64 only. -KPIC Generate position-independent code (PIC). This is the default and is needed for programs linking with dynamic shared libraries. -L directory Change the algorithm of searching for libraries in XPG4 mode. directory is the path to a directory that should be searched before using the default system libraries. Directories named are searched in the specified order. You can specify multiple -L options on the command line. -l library Search the library named lib.IRlibrary.a (XPG4 mode). A library is searched when its name is encountered, so the placement of this option is significant. -LANG: recursive=flag Invoke the language option control group to control recursion support. flag can be either ON or OFF. In either mode, the compiler supports a recursive, stack- based calling sequence. The difference lies in the optimization of statically allocated local variables. With -LANG:recursive=ON, a statically allocated local variable could be referenced or modified by a recursive procedure call, and therefore must be stored into memory before making a call and reloaded afterwards. With -LANG:recursive=OFF, the compiler can safely assume a statically allocated local variable will not be referenced or modified by a procedure call and will be able to optimize more aggressively. The default is -LANG:recursive=OFF. -LANG: short_circuit_conditionals=flag Implement .AND. as a short-circuit operation; that is, do not evaluate the right operand until the left operand evaluates .TRUE.. flag can be either ON or OFF. The default is OFF. -LIST: ... Invoke the listing option flag, which controls information that is written to a listing (.l) file and to the assembly listing file if the f77 -S option is used. The following are the individual controls in this group: =flag Enable or disable writing the listing file. flag can be either ON or OFF. The default is -LIST=ON if any -LIST: group options are enabled. By default, the listing file contains a list of options enabled. all_options=flag Enable or disable listing of most supported options. flag can be either ON or OFF. The default is -LIST:all_options=OFF. notes=flag Enable or disable comment notes. If an assembly listing is generated (for example, when using f77 -S) parts of the compiler such as software pipelining can place notes into the program as comments describing what has been done. Setting this option to -LIST:notes=OFF suppresses the notes. The default is -LIST:notes=ON. options=flag Enable or disable listing of the options modified (directly in the command line, or indirectly as a side effect of other options). flag can be either ON or OFF. The default is -LIST:options=OFF. symbols=flag Enable or disable listing of information about the symbols (variables) managed by the compiler. flag can be either ON or OFF. -listing Produce the listing file which has the source listing (with line type code), compilation flags, and error codes. The listing file has a .L extension. -LNO Invoke the loop nest optimizer. See the LNO(5) man page for details about the options available with -LNO. -lscs Loads the SCSL Scientific Library. -lscs_mp Loads the multi-processor version of the SCSL Scientific Library. -M Run only the macro preprocessor on the named C programs, requesting it to generate make dependencies and send the result to the standard output. Used with -n32 or -64 only. -MDupdate filename While compiling, update filename to contain header, library, and runtime make(1) dependencies for the f77 output file. f77 -MDupdate updates only lines that end with a distinctive make comment and begin with the name of the output file followed by a colon. Used with -n32 or -64 only. -MP: ... Specifies individual multiprocessing options that provide fine control over certain optimizations. You must also specify -mp on the command line. This enables all of the -MP options. The following are the individual controls in this group: check_reshape=flag Enable or disable generation of the runtime consistency checks across procedure boundaries when passing reshaped arrays (or portions thereof) as parameters. flag can be either ON or OFF. The default is -MP:check_reshape=OFF. clone=flag Enable or disable auto-cloning. flag can be either ON or OFF. The compiler automatically clones procedures that are called with reshaped arrays as parameters for the incoming distribution. However, if you have explicitly specified the distribution on all relevant formal parameters, you can disable auto-cloning with -MP:clone=OFF. The consistency checking of the distribution between actual and formal parameters is not affected by this flag, and is always enabled. dsm=flag Enable or disable data distribution. flag can be either ON or OFF. The default is -MP:dsm=ON. old_mp=flag Enable or disable recognition of the Silicon Graphics multiprocessing directives and the PCF directives. These directives are outmoded; their preferred alternatives are the OpenMP directives, which are described in the MIPSpro Fortran 77 Programmer's Guide. flag can be either ON or OFF. open_mp=flag Enable or disable compiler to use OpenMP directives. flag can be either ON or OFF. The default is -MP:open_mp=ON. When debugging a multiprocessed program with dbx, issue the following command: ignore TERM When debugging a multiprocessed program with cvd, select the Views/Signal panel, and select disable SIGTERM. Debugging is possible without these commands, but the program may not terminate gracefully after execution. mipsn See the ISA/ABI COMMAND LINE OPTIONS section for details. -mp Generates multiprocessing code for the files being compiled. This option causes the compiler to recognize all multiprocessing directives. If you are licensed for APO, specify the -apo option which invokes APO and sets the -mp option. See the APO(5) man page for details. -mp_keep Keep the compiler generated temporary file and generate correct line numbers for debugging multiprocessed DO loops. Valid for all ABIs. This option should be used with either the -mp or the -apo options. The saved file name has the following form: $TMPDIR/Puser_subroutine_namemachine_namepid If the TMPDIR environment variable is not set, the file is stored in /tmp. -mp_list Generates .w2f.f files. -mpio Allow Fortran I/O to be executed from multiple threads. Valid for all ABIs. See FTN_MPIO(5) for details. -mp_schedtype= type Causes the same effect as putting a C$MP_SCHEDTYPE=type directive at the beginning of the file. The following are the supported values for type: simple interleave dynamic gss runtime -NCnnn Set the maximum number of continuation lines. The default is 99. Used with -n32 or -64 only. -noappend Do not append an underbar to externally-visible names (appending an unbar is the default behavior). Used with -n32 or -64 only. -nocpp Do not run the C macro preprocessor on C and assembly source files before compiling. -noexpopt Do not optimize exponential operation. Used with -n32 or -64 only. This option is used to obtain the same precision as releases prior to 4D1-4.0 without using the exponentiation optimization. The new optimization might give some precision differences in double precision exponential operations. -noextend_source Restrict the range of source text from column 1 through column 72. Valid for all ABIs. -nof77 Cause some statements to behave like Fortran 66. Used with -n32 or -64 only. -noi4 Make integers and logicals 2 bytes. Used with -n32 or -64 only. -nostdinc Disable searching for #include files in the standard directory (/usr/include). -onetrip or -1 Compile DO loops that execute at least once if reached. (FORTRAN 77 DO loops are not executed if the upper limit is smaller than the lower limit.) Valid for all ABIs. -o output Name the final output file output. If this option is used, the file a.out is undisturbed. -Olevel Specify the basic level of optimization desired. level can be one of the following values: level Action 0 Turn off all optimizations. This is the default for -n32 and -64 compilations. 1 Turn on local optimizations that can be done quickly. This is the default for -o32 compilations. -O or -O2 Turn on extensive optimization. The optimizations at this level are generally conservative; they are usually beneficial, provide improvements commensurate to the compile time spent to achieve them, and avoid changes which affect such things as floating-point accuracy. Under -o32 in XPG4 mode, -O is not accepted, and the optimization level should follow the -O flag. 3 Turn on aggressive optimization. The optimizations at this level are distinguished from 2 by their aggressiveness, generally seeking highest-quality generated code even if it requires extensive compile time. They may include optimizations which are generally beneficial but occasionally hurt performance. Under -n32 or -64 this level also enables the -OPT:roundoff=2 option which does aggressive rearrangement of floating- point calculations with potential effects on accuracy. See the OPT(5) man page for details about the use of the -OPT option. fast[=ipxx] Maximizes performance for the target platform specified by ipxx. Used with -n32 or -64 only. The optimizations may differ between releases of the compiler, and among the supported platforms. The optimizations will always enable the full instruction set of the target platform (for example, -mips4 for an R10000). The optimizations may affect floating point accuracy due to operator reassociation. For more information, see the opt(5) man page and the roundoff=3 and div_split options described on that page. Typical optimizations selected include the following: -O3 -IPA -TARG:platform=ipxx -n32 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed See the description of -TARG:platform=ipxx for valid values for ipxx. To determine precisely what options are set by -Ofast, use the -LIST:options command. The default is an Origin 3000, ip35, or what -DEFAULT:platform=ipxx specifies. When this option is in effect, the order of operations may be different from that described in the Fortran standard. The ordering is different because -OPT:roundoff=3 is put into effect when -Ofast is specified. Ofast inlines the computation of abs (and related abs routines) and may result in underflow of small arguments and overflow for large arguments. If -O is not specified on the command line, the default action is the same as -O0. If -O is specified without a value for n, the default action is the same as -O2. -OPT Invoke the optimization control group. See the OPT(5) man page for details about this optimization group. -pfa Invoke Power Fortran 77 option, if it is purchased and installed. This option is no longer supported with the -o32 option but is still supported with older Makefiles compiled with -n32 and -64. It is provided for backward compatibility. -apo, which invokes the Auto- Parallelizing Option (APO), is the preferred option; see the MIPSpro Fortran 77 Programmer's Guide for information about using APO. -P Run only the C macro preprocessor and put the result for each source file (e.g., .f, .F and .s) in a corresponding .i file. The .i file has no # lines in it. -rn Set value for real numbers. Valid for all ABIs. n can be one of the following values: 4 Use REAL*4 and COMPLEX*8 as the defaults for real and complex variables when they are not explicitly declared with a length. This is the default. 8 Use REAL*8 and COMPLEX*16 as the defaults for real and complex variables when they are not explicitly declared with a length. This option is often needed when the porting of programs from 64-bit machines may result in convergence problems (and very long execution time) if the floating-point accuracy is inadequate. 8const Use REAL*8 and COMPLEX*16 as the defaults for real and complex constants, respectively, except when used as actual arguments. Used with -n32 or -64 only. -r5000 Schedule code for the R5000 and add -L/usr/lib{32,64}/mips{3,4}/r5000 to the head of the library search path depending on which ABI and ISA is specified or implied. -r8000 Schedule code for the R8000 and add -L/usr/lib{32,64}/mips{3,4}/r8000 to the head of the library search path depending on which ABI and ISA is specified or implied. -r10000 Schedule code for the R10000 and add -L/usr/lib{32,64}/mips{3,4}/r10000 to the head of the library search path depending on which ABI and ISA is specified or implied. -r12000 Schedule code for the R12000. -r14000 Schedule code for the R14000. -r16000 Schedule code for the R16000. -S Compile the specified source programs and leave the symbolic assembly language output in corresponding files suffixed with .s. See the MIPSpro Assembly Language Programmer's Guide for details about the file produced by this option. -show Print the passes as they execute with their arguments and their input and output files. -show_defaults List all defaults used in the compiler environment. This option does not compile the program. -static Cause all local variables to be statically allocated. Valid for all ABIs. Statically allocated local variables are initialized to zero and exist for the life of the program. This option is usually needed for programs ported from older systems (for example, VMS) where all variables are statically allocated. -static_threadprivate Makes all static variables private to each thread. This option can be specified in conjunction with the -static option, which statically allocates all local variables. -TARG: ... Invoke the target option group, which controls the target architecture and machine for which code is generated. The following are the individual controls in this group: dismiss_mem_faults = flag Forces the kernel to dismiss any memory faults (such as SIGSEGV or SIGBUS) which occur during execution of the program (not just the code being compiled). flag can be ON or OFF. This option allows optimizations which might cause extra faults and can slow down execution if extra faults occur. It also prevents recognition of legitimate faults. Default is OFF. exc_max= value Specifies the maximum set of IEEE-754 floating point exceptions for which traps may be enabled at runtime for the program (not just the code being compiled). value can be I, U, O, Z, V. Zero or more of the five letters specify inexact (I), underflow (U), overflow (O), divide-by-zero (Z), and invalid operation (V) exceptions. This option allows optimizations which might cause extra exceptions, and it may prevent recognition of legitimate faults. It does not affect explicit setting of exception enable flags by the program, and should be avoided if the program does this. See also the -TARG:exc_min description. Default is IUOZV, affected by the -TENV:X option. exc_min=value Specifies the minimum set of IEEE-754 floating point exceptions for which traps must be enabled at runtime for the program (not just the code being compiled). value can be I, U, O, Z, V. Zero or more of the five letters specify inexact (I), underflow (U), overflow (O), divide-by-zero (Z), and invalid operation (V) exceptions. This option does not affect explicit setting of exception enable flags by the program, and should be avoided if the program does this. See also the -TARG:exc_max option. The -TARG:exc_max and -TARG:exc_min options specified for the various files that comprise a program must be consistent; for example, none of the -TARG:exc_min values may require exceptions disabled by -TARG:exc_max values. Default is none. fp_precise=flag Force the target processor into precise floating-point mode at execution time. flag can be either ON or OFF. If you use this option to compile any of the component source files of a program, this feature is invoked in the resulting program. This option is only meaningful for R8000 target processors, and can cause significant performance degradation for programs with heavy floating-point usage. See the fpmode(1) command for more information. isa=value Identifies the target instruction set architecture for compilation, such as the set of instructions that are generated. value can be mips3 or mips4. Specify -TARG:isa=mips3 for code that must run on R4000 processors. This option is equivalent to specifying -mips3 or -mips4 (see those options for defaults). madd=flag Enable or disable transformations to use multiply/add instructions. flag can be either ON or OFF. These instructions perform a multiply and an add with a single round- off. They are, therefore, more accurate than the usual discrete operations, and may cause results to not match baselines from other targets. Use this option to determine whether observed differences are due to madds. The default is -TARG:madd=ON for a MIPS IV target; it is ignored for others. platform[=ipxx] Identify the target SGI platform for compilation, choosing the appropriate internal parameters (such as cache sizes). The following are the currently supported values: ip19 ip20 ip21 ip22_4k ip22_5k ip24 ip25 ip26 ip27 ip28 ip30 ip32_5k ip32_10k ip35 Determine the appropriate selection for your platform by using the following command: hinv -c processor The first line of the output identifies the proper IP number, and for those cases where a processor suffix (for example, '_4k') is required, the next line identifies the processor (e.g. R4000)..TP processor=type Select the processor for which to schedule code. type can be either r4000, r5000, r8000, r10000, r12000, r14000 or r16000. The chosen processor must support the ISA specified (or implied by the ABI). r4krev22=flag Generate code to work around bugs in the R4000 rev 2.2 chip. flag can be either ON or OFF. This currently means simulating 64-bit variable shifts in the software. sync=flag Enable or disable use of SYNC instructions. flag can be ON or OFF. Default is ON. -TENV: ... Invoke the target environment option group, which controls the target environment assumed and/or produced by the compiler. The following are the individual controls in this group: align_aggregate=bytes Control alignment of allocated aggregates, i.e. arrays and records. The value for bytes specifies that any aggregate object at least that large is to be given at least that alignment. By default (or if no value is provided), aggregates are aligned to the integer register size (for example, 8 bytes for 64-bit programs and 4 bytes for 32-bit programs). The value 0 specifies that the minimum alignment consistent with the ABI is to be used. Otherwise, the value given must be a power of two no greater than 16. check_div=N Inserts checks for divide by zero operations and overflow conditions on integer divide operations. check_div=0 inhibits checking. check_div=1 checks for division by zero. check_div=2 checks for overflow. check_div=3 checks for both division by zero and overflow. large_GOT=flag Assume that the Global Offset Table (for shared code) is more than 64K bytes, that is, generate large offsets for references to it. flag can be either ON or OFF. The default is -TENV:large_GOT=OFF. small_GOT=flag Assume that the Global Offset Table (for shared code) is less than 64K bytes, i.e. assume small offsets for references to it. flag can be either ON or OFF. X=level Specify the level of enabled exceptions that will be assumed for purposes of performing speculative code motion. level can be a number between 0 and 4. The default level is 1 when the -O0, -O2 options are used; the default is 2 when the -O3 option is used. In general, an instruction is not speculated (that is, moved above a branch by the optimizer) unless any exceptions it might cause are disabled by this option. * At level 0, no speculative code motion may be performed. * At level 1, safe speculative code motion may be performed, with IEEE-754 underflow and inexact exceptions disabled. * At level 2, all IEEE-754 exceptions are disabled except divide by zero. * At level 3, all IEEE-754 exceptions are disabled including divide by zero. * At level 4, memory exceptions may be disabled or ignored. NOTE: At levels above the default level 1, various hardware exceptions which are normally useful for debugging, or which are trapped and repaired by the hardware, may be disabled or ignored, with the potential of hiding obscure bugs. The program should not explicitly manipulate the IEEE floating-point trap-enable flags in the hardware if this option is used. -u Makes the default type of a variable undefined, rather than using default rules. -U name Remove any initial definition of name. -use_readwrite_const or -use_readonly_const Control the use of constants put in writable sections. Used with -n32 or -64 only. By default, they are writable and thus changeable. However, if you want constants to be not writable, then in addition to -use_readonly_const you must also specify -G0 -rdata_shared because by default the linker will make .rodata and gp-relative sections be on writable pages. -version Display the version number of the compiler. Note: The compiler will not be run if this flag is used. -woff number Specify number list for warnings. In SGI Fortran, warnings can be suppressed. All warnings have been given a number, which appears in parentheses immediately after the word ``warning'' in the warning text. Fortran-specific message have numbers greater than 2000 (to make warning numbers distinct from those of other front ends), while cpp- related warnings have the same warning number as in the C front ends. The number is a comma-separated set of 1 or more numbersets. A numberset is either a simple integer or a pair of integers separated by a hyphen. Examples: -woff C2026 This suppresses warning 2026. -woff 2026-2352 This suppresses warnings 2026 through 2352. -woff 2026-2352,2400-2500 This suppresses numbers 2026 through 2352 and 2400 through 2500. file.suffix File or files to be processed. By default, the compiler looks at the suffix of a file to determine how to compile it. For example, f77 a.f b.s will treat a.f as a f77 file, and b.s as an assembly file. But there are also several options that can be used to control how suffixes are interpreted. These options are: -ignore_suffix Determines the language of the source file being compiled by the command used to invoke the compiler. By default, the language is determined by the file suffixes. When the -ignore_suffix option is specified, those suffixes are ignored. For example, f77 -ignore_suffix a.cxx b.foo will treat a.cxx and b.foo as f77 source. -use_command Use the command name to determine which compiler to invoke for recognized source files. For example, f77 -use_command a.cxx b.foo will treat a.cxx as f77 source, b.foo as object. -use_suffix Use the file suffix to determine which compiler to invoke. For example, f77 -use_suffix a.cxx b.foo will treat a.cxx as C++ source, b.foo as object. -x <lang> The following files are assumed to be of the specified language, regardless of suffix. The valid values for lang are c, c++, f, f90, assembler, object, or none. The none value means that we revert back to the default suffix rules for determining how to compile the file. Options for Development The following options aid compiler development and are not generally used: -W c,arg[,arg...] Pass the argument[s] specified by arg to the compiler pass c. c is one of the following values, which correspond to the following compiler passes: Compiler pass Value cpp p mfef77 f be b asm a ld l Sets of these phase names can be used to select any combination of phases. In the following example, the option -o foo is passed to the b and a phases: -Wba,-o,foo -Y c,path Sets the path in which to find the associated phase, using the same phase names as given in the -W option. Also, the letter I can be used to specify where to search for include files; the letter S can be used to specify where to search for startup files (crt*.o); and the letter L can be used to specify where to search for libraries. Defaults Specification Files The compiler provides a method by which you can customize the Application Binary Interface (ABI), Instruction Set Architecture (ISA) and processor type used in compilations where they are not explicitly specified. Under this method, the COMPILER_DEFAULTS_PATH environment variable can be set to a colon-separated list of paths where the compiler will look for a compiler.defaults file. If no compiler.defaults file is found or if the environment variable is not set, the compiler looks for /etc/compiler.defaults file. If that file is not found, the compiler uses the built-in defaults. The compiler.defaults file contains a -DEFAULT: option group specifier that can be used to specify the default ABI, ISA, processor, and optimization level. A warning is issued if anything other than a -DEFAULT: option is given in the compiler.defaults file. The format of the -DEFAULT: option group specifier is as follows: -DEFAULT:[abi=abitype][:isa=isatype] [:proc=rtype] [:opt=level][:arith=number] The following values are valid for the arguments: abitype ABI selections: o32 32-bit n32 high performance, n32 64 64-bit isatype ISA selections: mips1 R3000 and above mips2 R4000 and above mips3 R4000 and above mips4 R5000, R8000 and R10000 rtype proc selections indicate which processor schedules instructions by default and which paths will be added to the head of the library search path: r4k r5k r8k r10k level opt selections indicate which optimization level to use as the default: 0 1 2 3 If this is not specified, the compiler defaults to -O0. The arith number selection indicates which -OPT:IEEE_arith= value to use as the default. Choose a number between 1 and 3. The -show_defaults option can be used to print the compiler.defaults file being used and their values. This option is for diagnostic purposes only; it does not compile your program. The SGI_ABI environment variable overrides the ABI default in the compiler.defaults file. In addition, explicit command line options can override all the defaults. For example, the following command: f77 -64 foo.c overrides a compiler.defaults file containing the following: -DEFAULT:abi=n32:isa=mips4:proc=r10k The command also performs the following compilation: -64 -mips4 -r10000 If you used the following in the above example: f77 -o32 foo.c it will not only override the ABI and use -o32, but it also overrides the ISA to use -mips2, because -o32 supports only -mips2 and -mips1 compilations. The processor type is ignored by -o32 compilations. LOADER OPTIONS Other arguments are assumed to be either loader options or C -compatible object files, typically produced by an earlier f77 run, or libraries of C -compatible routines. These files, together with the results of any compilations specified, are loaded in the order given, producing an executable program with the default name a.out. ENVIRONMENT VARIABLES For information about environment variables, see the pe_environ(5) man page. BUGS The compiler attempts to continue after finding semantic errors. These errors may result in compiler internal errors. NOTES The standard library, /usr/lib/libc.so.1, is loaded by using the -lc loader option and not a full path name. If libc.so.1 is specified explicitly, the wrong version could be loaded if there are files with the name libc.so.1 in the directories specified with the -L loader option or in the default directories searched by the loader. When using the Graphics Library (-lgl), you must also specify the Fortran Graphics Library Interface (-lfgl) on the link line. For example: f77 file.f -lfgl -lgl Applications which provide their own exit function will not work with profiling (no profile data will be written out). EXAMPLES The following example compiles 64-bit MIPS IV (R8000, R10000, R5000) code, which does not run on R4000/R4400 processors. f77 -64 -mips4 other options The following example compiles 64-bit ABI (MIPS 3) code, scheduled for best performance on the R8000 processor but not using R8000-specific (MIPS IV) instructions so that it will be executable on R4000/R4400 processors. f77 -64 -mips3 -TARG:proc=r8000 <other options> The following example compiles code with extensive optimization enabled, allowing transformations which affect floating-point round- off and overflow, assuming strict ANSI C aliasing rules. f77 ... -O2 -OPT:roundoff=2:alias=typed .... The following example compiles code with aggressive optimization (including software pipelining) enabled, allowing transformations with arbitrary effects on floating-point round-off and overflow. f77 ... -O3 -OPT:roundoff=3 FILES file.f input file file.o object file file.l listing file a.out loaded output /tmp/ctm* temporaries /usr/lib/cpp C macro preprocessor /usr/bin/cord procedure rearranger /usr/lib32/cmplrs/mfef77 fortran front-end (-n32 and -64) /usr/lib32/cmplrs/be code generator (-n32 and -64) /usr/lib32/cmplrs/asm assembler (-n32 and -64) /usr/lib*/mcrt1.o startup for profiling /usr/lib*/crt1.o runtime startup /usr/lib*/crtn.o runtime startup /usr/lib*/libc.a standard library, see intro(3) /usr/lib*/libc.so.1 shared standard library /usr/lib*/libfpe.a floating-point exception handler library, see sigfpe(3c) /usr/lib*/libftn.so fortran runtime library /usr/lib*/libgl.so IRIS-4D shared graphics library /usr/lib*/libm.a math library /usr/lib*/libm.so shared math library /usr/include standard directory for `#include' files /usr/bin/ld SGI loader /usr/bin/ratfor rational FORTRAN dialect preprocessor mon.out file produced for analysis by prof(1) SEE ALSO as(1), cc(1), CC(1), collide(1), cpp(1), dbx(1), dis(1), fopt(1), ftoc(1), ld(1), nm(1), elfdump(1), pixie(1), pfa(1), prof(1), ratfor(1), speedshop(1), what(1), getabi(3c), sigfpe(3c). lno(5), opt(5) MIPSpro Fortran 77 Language Reference Manual MIPSpro Fortran 77 Programmer's Guide MIPSpro Fortran 90 Commands and Directives Reference Manual MIPSpro Assembly Language Programmer's Guide