Sun Fortran Compiler Options

3


This chapter details the command-line options for the f77 and f90 compilers running under Solaris 2.x. Features unique to one or more platforms are identified as "(SPARC)", "(Intel)", and/or "(PowerPC)". Features unique to one or the other compiler are marked "f77 only" or "f90 only". See the description of this multi-platform release in the Preface.


Command Syntax

The general syntax of the compiler command line is:

f77 [options] list_of_files  [-lx]
f90 [options] list_of_files  [-lx]

Items in square brackets indicate optional parameters. The brackets are not part of the command. The options are a list of option keywords prefixed by dash (-). Some keyword options take the next item in the list as an argument. The list_of_files is a list of source, object, or library file names separated by blanks.


Options Syntax

Typical compiler option formats are:

Table  3-1 Options Syntax

Syntax Format
Example
-flag
-g
-flagvalue
-Dnostep
-flag=value
-xunroll=4
-flag value
-align _comvarx

The following typographical conventions are also used in this section of the manual when describing the individual options:

Table  3-2 Typographic Notations for Options  

Notation
Meaning
Example: Text/Instance
    [ ] Square brackets contain arguments that are optional.
 -O[n]
 -O4
    { } Curly brackets contain a set of choices for a required option.
 -d{y|n}
 -dy
    | The "pipe" or "bar" symbol separates arguments, only one of which may be chosen.
 -B{dynamic|static}
 -Bstatic
    : The colon, like the comma, is sometimes used to separate arguments.
 -Rdir[:dir]
 -R/local/libs:/U/a
    ... The ellipsis indicates omission in a series.
 -xinline=f1[,...fn]
 -xinline=alpha,dos

 

Brackets, pipe, and ellipsis are meta characters used in the descriptions of the options and are not part of the options themselves.

Some general guidelines for options are:

Source files, object files, and libraries are compiled and linked in the order in which they appear on the command line.


Options Summaries

In this section, the compiler options are grouped by function to provide an easy reference. The details will be found on the pages in the following sections, as indicated.

Commonly Used Options

The Sun Fortran compilers have many features that are selectable by optional command-line parameters. The short list below of commonly used options is a good place to start.

Table  3-3 Commonly Used Options 

Action
Option
Details
Debug--global program checking across routines for consistency of arguments, commons, and so on. -Xlist page 94
Debug--produce additional symbol table information for the runtime debugger. -g page 57
Performance--invoke the optimizer to produce faster running programs. -O[n] page 68
Performance--produce reasonably efficient compilation and run times using a set of predetermined options -fast page 50
Bind as dynamic (or static) any library listed later in the command: -Bdynamic, -Bstatic -Bx page 42
Library--Allow or disallow dynamic libraries for the entire executable: -dy, -dn -dx page 47
Compile only--Suppress linking; make a .o file for each source file. -c page 43
Output file--Name the executable output file nm instead of a.out. -o nm page 70
Profile--Profile by procedure for gprof. -pg page 73

Debugging Options

For the following debugging options, the most useful are listed first.

Table  3-4 Debugging Options 

Action
Option
Details
Compile for use with the debugger. -g page 57
Global program checking (GPC)--arguments, commons, .... -Xlist page 94
Check for subscripts out of range. -C page 42
Undeclared variables--show a warning message. -u page 82
Version ID--show ID along with name of each compiler pass. -V page 82
Specify VMS extensions. -vax=v page 83
Allow debugging by dbx without .o files. -xs page 99

Floating-Point Options

For the following floating-point options, the most significant are listed first.

Table  3-5 Floating-Point Options

Action
Option
Details
Turn on SPARC nonstandard floating-point (SPARC) -fns page 50
Set IEEE rounding mode in effect at startup -fround=r page 54
Set IEEE trapping mode in effect at startup -ftrap=t page 56
Set floating-point optimization preferences -fsimple=n page 55
Se floating-point precision -fprecision=p page 54

Library Options

For the following library linking options, the most useful are listed first.

Table  3-6 Library Options 

Action
Option
Details
Bind as dynamic or static next library listed on command. -Bx page 42
Allow or disallow dynamic libraries for executable. -dx page 47
Build a dynamic shared library. -G page 57
Search for libraries in this directory first. -Ldir page 61
Link with library libx. -lx page 62
Multithread safe libraries, low level threads. -mt page 65
No automatic libraries. -nolib page 66
No inline templates. -nolibmil page 67
No run path in executable. -norunpath page 68
Library--do not make library if relocations remain. -ztext page 107

Licensing Options

The following options are for licensing.

Table  3-7 Licensing Options 

Action
Option
Details
Do not queue the license request. -noqueue page 67
Show license server user IDs. -xlicinfo page 93

Performance Options

For the following performance options, those with the greatest significance are listed first.

Table  3-8 Performance Options 

Action
Option
Details
Faster execution and compilation using a set of options . -fast page 50
Optimize runtime performance--set optimization level to n. -O[n] page 68
Specify target hardware system. -xtarget=t page 100
Collect or use data for a profile to optimize (SPARC). -xprofile=p page 97
Double load--allow compiler to generate double load/store instructions in compiled code. -dalign page 45
Arithmetic--use simple arithmetic model. -fsimple page 55
Arithmetic--use SPARC non-standard floating point (SPARC). -fns page 53
Use inline library -libmil page 62
Traps--assume no memory-based traps (SPARC). -xsafe=mem page 99
Unroll loops--advise optimizer to unroll loops n times. -unroll=n page 82
Fast math--use special fast math routines (SPARC). -xlibmopt page 93
Architecture--specify target instruction set. -xarch=a page 85
Chip--specify target processor. -xchip=c page 89
Check data dependencies--analyze loops (SPARC). -depend page 47
Inline the listed user routines to optimize for speed. -inline=rlst page 60
Optimize across all source files on command line -xcrossfile page 90
Do no optimizations that increase code size. -xspace page 100
386--generate code for 80386 (Intel). -386 page 39
486--generate code for 80486 (Intel). -486 page 39
Pentium--generate code for pentium (Intel). -pentium page 73

Parallelization Options

For the following parallelization options, those with the greatest impact in most situations are listed first.Parallelization options require a WorkShop license. See the Fortran README files for details

Table  3-9 Parallelization Options (SPARC

Action
Option
Details
Parallelize with -autopar -explicitpar -depend. -parallel page 72
Parallelize explicitly marked loops. -explicitpar page 72
Parallelize "reduction" loops. -reduction page 77
Parallelize loops automatically. -autopar page 64
Specify the style for MP directives (cray or sun). -mp=x page 64
Prepare loops for profiling parallelization. -Zlp page 107
List which loops are successfully parallelized. -loopinfo page 63
Enable thread performance analysis by tha. -Ztha page 108
Stack local variables to optimize for parallelization. -stackvar page 79
Show warnings about parallelization. -vpara page 84
Disable automatic parallelization. -noautopar page 66
Disable -depend. -nodepend page 66
Disable explicit parallelization. -noexplicitpar page 66
Disable reduction loop analysis. -noreduction page 68

Profiling Options

The following options enable runtime profiling in the compiled program. Depending on the options, profiling is done at either the basic block, procedure, or loop level.

Table  3-10 Profiling Options 

Action--Enable Profiling by:
Option
Details
Basic block (using tcov, old style). -a page 39
Procedure (using gprof). -pg page 73
Procedure (using prof). -p page 71
Loops with parallelization (SPARC). -loopinfo page 63
Basic block (using tcov, new style) (SPARC). -xprofile=tcov page 97

Alignment Options

The following options are for specifying data alignment strategies.

Table  3-11 Alignment Options 

Action
Option
Details
Align on 8-byte boundaries (SPARC). -f page 50
Force 8-byte alignment on all data. -dbl_align_all=yes page 46
Align and use double-word load/store. -dalign page 45
Allow for misaligned data (SPARC). -misalign page 64
Specify what VMS alignment features to use -vax=v page 83

Backward Compatibility and Legacy Options

The following options are provided for backward compatibility with earlier compiler releases, and certain Fortran legacy capabilities.

Table  3-12 Backward Compatibility Options 

Action
Option
Details
Allow assignment to constant arguments. -copyargs page 43
External names--make external names without underscores. -ext_names=e page 49
Nonstandard arithmetic--allow nonstandard arithmetic. -fnonstd page 52
Optimize performance for the host system. -native page 65
Output--use old style list-directed output. -oldldo page 70
DO loops--use one trip DO loops. -onetrip page 70

Obsolescent Options

The following options are no longer functional in the current release of the f77 and f90 compilers. Their appearance on a compiler command does not cause an error, and no action is taken; they are ignored.

Table  3-13 Obsolescent Options 

Original Intention
Option
Align Common block on page boundaries. -align _b_
Use faster malloc -bsdmalloc
Reduce size of executable file -nocx
Set internal compiler table sizes -N[cdlnqsx]k

All Options List

The following table lists all the Fortran 77 and Fortran 90 compiler options, and indicates any platform restrictions. The SPARC, PPC, and Intel columns indicate availability of an option on SPARC, PowerPC, and Intel Solaris 2.x systems, respectively:

77 indicates the option is only available with f77 on that platform
90 indicates the option is only available with f90 on that platform
77/90 indicates the option is available with both f77 and f90 on that platform
- indicates the option is not available on that platform

Note that f90 1.2 is only available on SPARC systems.

Options that are not available for a compiler on a particular platform will still be accepted silently by the compiler. That is, the compiler will accept the option on the command-line on that platform without issuing a warning, but the option does nothing.

The options reference section that follows gives full details and examples for each option. (Obsolescent options are not listed; see page 32.)

Table  3-14 Options Index 

Option
SPARC
PPC
Intel
Action
Details
-386 - - 77 Compile for Intel 80386. page 39
-486 - - 77 Compile for Intel 80486. page 39
-a 77 77 77 Profile by basic block using tcov, old style. page 39
-ansi 77/90 77 77 Identify many non-ANSI extensions. page 40
-arg=local 77 77 77 Preserve actual arguments over ENTRY statements. page 40
-autopar 77 - - Enable automatic loop parallelization. page 41
-Bx 77/90 77 77 Allow dynamic or require static library linking. page 42
-C 77 77 77 Check array references for out of range subscripts. page 42
-c 77/90 77 77 Compile only; produce object .o files, but suppress linking. page 43
-cg89 77/90 - - Compile for generic SPARC architecture. page 43
-cg92 77/90 - - Compile for SPARC V8 architecture. page 43
-copyargs 77 77 77 Allow assignment to constant arguments. page 43
-Dname 77/90 77 77 Define symbol name for the preprocessor. page 44
-dalign 77/90 - - Force 8-byte alignment and enable double word load/stores. page 45
-db 90 - - Generate a compiler information file (CIF). page 45
-dbl 77 77 77 Double the default size for REAL, INTEGER, DOUBLE, and COMPLEX. page 45
-dbl_align_all 77 77 77 Force alignment of all data on 8-byte boundaries. page 46
-depend 77 - - Analyze loops for data dependencies. page 47
-dryrun 77/90 77 77 Show commands built by driver, but do not compile. page 47
-d{y|n} 77/90 77 77 Allow or disallow dynamic libraries for the entire executable page 47
-e 77/90 77 77 Accept extended length input source line. page 47
-erroff=taglist 77 77 77 Suppress warning messages listed by tag name. page 48
-errtags 77 77 77 Display the message tag with each warning message. page 48
-explicitpar 77/90 - - Parallelize loops explicitly marked by directives. page 48
-ext_names=e 77 77 77 Create external names with or without trailing underscore. page 49
-F 77/90 77 77 Invoke the source file preprocessor, but do not compile. page 49
-f 77/90 - - Align data on 8-byte boundaries. page 50
-fast 77/90 77 77 Optimize for speed of execution using a selection of options. page 50
-fixed 90 - - Specify fixed-format source input files. page 52
-flags 77/90 77 77 Synonym for -help. page 52
-fnonstd 77/90 77 77 Initialize floating-point hardware to non-standard preferences. page 52
-fnonstop 90 - - Disable floating-point exception trapping. page 53
-fns 77/90 - - Select the SPARC nonstandard floating-point mode. page 53
-fprecision=p - - 77 Initialize floating-point precision mode on Intel. page 54
-free 90 - - Specify free-format source input files. page 54
-fround=r 77/90 77 77 Set the IEEE rounding mode in effect at startup. page 54
-fsimple 77 77 77 Select floating-point optimization preferences. page 55
-fstore - - 77 Force precision of floating-point expressions. page 56
-ftrap=t 77/90 77 77 Set floating-point trapping mode in effect at startup. page 56
-G 77/90 77 77 Build a dynamic shared library instead of an executable file. page 57
-g 77/90 77 77 Compile for debugging. page 57
-hname 77/90 77 77 Specify the name of the generated dynamic shared library. page 58
-help 77/90 77 77 Display a summary list of compiler options. page 58
-Idir 77/90 77 77 Add dir to the INCLUDE file search path. page 58
-i2 77 77 77 Set the default integer size to two bytes. page 59
-i4 77/90 77 77 Set the default integer size to four bytes. page 59
-inline=rlst 77 77 77 Inline specified routines. page 60
-Kpic 77 77 77 Synonym for -pic. page 61
-KPIC 77 77 77 Synonym for -PIC. page 61
-Ldir 77/90 77 77 Add dir to list of directories to search for libraries. page 61
-lx 77/90 77 77 Add library libx.a to linker's list of search libraries. page 62
-libmil 77 77 77 Inline selected libm library routines for optimization. page 62
-loopinfo 77 - - Show parallelization results. page 63
-Mdir 90 - - Add dir to directories searched for Fortran 90 modules. page 63
-misalign 77 77 - Allow misaligned data. page 64
-mp=x 77 - - Select the style for parallelization directives. page 64
-mt 77/90 77 77 Require multithread-safe libraries. page 65
-native 77/90 77 77 Optimize performance for the host system. page 65
-noautopar 77 - - Disable automatic parallelization. page 66
-nodepend 77 - - Cancel -depend in command line. page 66
-noexplicitpar 77 - - Disable explicit parallelization. page 66
-nofstore - - 77 Disable forcing precision of expression. page 66
-nolib 77/90 77 77 Disable linking with system libraries. page 66
-nolibmil 77 77 77 Cancel -libmil on command line. page 67
-noqueue 77 77 77 Disable license queueing. page 67
-noreduction 77/90 - - Cancel -reduction on command line. page 68
-norunpath 77/90 77 77 Do not build a runtime shared library search path into the executable. page 68
-O[n] 77/90 77 77 Specify optimization level. page 68
-o outfil 77/90 77 77 Specify the name of the executable file to be written. page 70
-oldldo 77 77 77 Select "old" list-directed output style. page 70
-onetrip 77/90 77 77 Enable one trip DO loops. page 70
-p 77/90 77 77 Compile for profiling with the prof profiler. page 71
-pad[=p] 77 - - Insert padding for efficient use of cache. page 71
-parallel 77/90 - - Parallelize loops with: -autopar, -explicitpar, -depend page 72
-pentium - - 77 Compile for Intel Pentium. page 73
-pg 77/90 77 77 Compile for profiling with the prof profiler. page 73
-pic 77/90 77 77 Compile position-independent code for shared library. page 73
-PIC 77/90 77 77 Compile position-independent code, but with 32-bit addresses. page 74
-Qoption pro op 77/90 77 77 Pass options to compilation phase pr. page 75
-qp 77/90 77 77 Synonym for -p. page 75
-R list 77/90 77 77 Build dynamic library search paths into the executable file. page 75
-r8 77 77 77 Double default byte size for REAL,INTEGER, DOUBLE and COMPLEX. page 76
-reduction 77/90 - - Recognize reduction operations in loops. page 77
-S 77/90 77 77 Compile and only generate assembly code. page 78
-s 77/90 77 77 Strip the symbol table out of the executable file. page 78
-sb 77 77 77 Produce table information for the WorkShop source code browser. page 78
-sbfast 77 77 77 Produce only source code browser tables. page 78
-silent 77 77 77 Suppress compiler messages. page 78
-stackvar 77/90 77 77 Force all local variables to be allocated on the memory stack. page 79
-stop_status 77 77 77 Permit STOP statement to return an integer status value. page 80
-temp=dir 77/90 77 77 Define directory for temporary files. page 81
-time 77/90 77 77 Time each compilation phase. page 81
-U 77 77 77 Recognize upper and lower case in source files. page 81
-u 77 77 77 Report undeclared variables. page 82
-unroll=n 77 77 77 Enable unrolling of DO loops where possible. page 82
-V 77/90 77 77 Show name and version of each compiler pass. page 82
-v 77/90 77 77 Verbose mode - show details of each compiler pass. page 83
-vax=v 77 77 77 Specify choice of VMS Fortran extensions enabled. page 83
-vpara 77 - - Show verbose parallelization messages. page 84
-w 77/90 77 77 Suppress warning messages. page 84
-xa 77 77 77 Synonym for -a. page 84
-xarch=a 77 77 77 Specify target architecture instruction set. page 85
-xautopar 77 - - Synonym for -autopar. page 87
-xcache=c 77 - - Define cache properties for the optimizer. page 87
-xcg89 77 - - Synonym for -cg89. page 88
-xcg92 77 - - Synonym for -cg92. page 88
-xchip=c 77 77 77 Specify target processor for the optimizer. page 89
-xcrossfile 77 - - Enable optimization and inlining across source files. page 90
-xdepend 77 - - Synonym for -depend. page 90
-xexplicitpar 77 - - Synonym for -explicitpar. page 90
-xF 77 77 77 Allow function-level reordering by WorkShop Analyzer. page 90
-xhelp=h 77 77 77 Show summary help information on options or README file. page 91
-xildoff 77/90 - - Turn off the Incremental Linker. page 91
-xildon 77/90 - - Turn on the Incremental Linker. page 91
-xinline=rlst 77 77 77 Synonym for -inline=f1[,...,fn]. page 92
-xl[d] 77 77 77 Enable more VMS Fortran extensions. page 92
-xlibmil 77 77 77 Synonym for -libmil. page 93
-xlibmopt 77/90 - - Use library of optimized math routines. page 93
-xlic_lib=libs 77/90 77 77 Link with the specified Sun licensed libraries. page 93
-xlicinfo 77/90 77 77 Show license server information. page 93
-Xlist 77/90 77 77 Produce listings and do global program checking. page 94
-xloopinfo 77 - - Synonym for -loopinfo. page 95
-xnolib 77/90 77 77 Synonym for -nolib. page 96
-xnolibmil 77/90 77 77 Synonym for -nolibmil. page 96
-xnolibmopt 77/90 77 77 Do not use fast math library. page 96
-xO[n] 77/90 77 77 Synonym for -O[n]. page 96
-xpad=p 77 - - Synonym for -pad. page 96
-xparallel 77/90 - - Synonym for -parallel. page 96
-xpg 77/90 77 77 Synonym for -pg. page 96
-xpp={fpp|cpp} 77/90 77 77 Select source file preprocessor. page 96
-xprofile=p 77 - 77 Collect or optimize with runtime profiling data. page 97
-xreduction 77/90 - - Synonym for -reduction. page 77
-xregs=r 77 - - Specify register usage. page 98
-xs 77 77 77 Allow debugging by dbx without object (.o) files . page 99
-xsafe=mem 77 - - Assume no memory-based traps. page 99
-xsb 77 77 77 Synonym for -sb. page 100
-xsbfast 77 77 77 Synonym for -sbfast. page 100
-xspace 77 - - Do not allow optimizations to increase code size. page 100
-xtarget=t 77 77 77 Specify system for optimization. page 100
-xtime 77/90 77 77 Synonym for -time. page 105
-xtypemap=spec 77 77 77 Specify default data mappings. page 106
-xunroll=n 77 77 77 Synonym for -unroll=n. page 107
-xvpara 77 - - Synonym for -vpara. page 107
-Zlp 77 - - Compile for loop performance profiling by looptool. page 107
-ztext 77 - - Generate only pure libraries with no relocations. page 107
-Ztha 77 - - Compile for performance profiling with Thread Analyzer. page 108

Options Reference

This section shows all f77 and f90 compiler command-line option flags, including various risks, restrictions, caveats, interactions, examples, and other details. Each description indicates platform availability of the option, using the same legend as in the summary list, page 33.


-386

Compile for Intel 80386.

   SPARC: - PPC: - Intel:77

Generate code that exploits features available on Intel 80386 compatible processors. The default is -386.


-486

Compile for Intel 80486.

   SPARC: - PPC: - Intel:77

Generate code that exploits features available on Intel 80486 compatible processors. The default is -386. Code compiled with -486 does run on 80386 hardware, but it may run slightly slower.


-a

Profile by basic block using tcov, old style.

   SPARC:77 PPC:77 Intel:77

This is the old style of basic block profiling for tcov. See -xprofile=tcov for information on the new style of profiling and the tcov(1) man page for more details. Also see the manual, Performance Profiling Tools.

Insert code to count the times each basic block of statements is executed. This invokes a runtime recording mechanism that creates one .d file for every .f file at normal program termination. The .d file accumulates execution data for the corresponding source file. The tcov(1) utility can then be run on the source file(s) to generate statistics about the program. The summary output produced by tcov is written to file.tcov for each source file. -pg and gprof are complementary to -a and tcov.

If set at compile-time, the TCOVDIR environment variable specifies the directory where the .d and .tcov files are located. If this variable is not set, then the .d files remain in the same directory as the .f files.

The -xprofile=tcov and the -a options are compatible in a single executable. That is, you can link a program that contains some files which have been compiled with -xprofile=tcov, and others with -a. You cannot compile a single file with both options.

If you compile and link in separate steps, and you compile with -a, then be sure to link with -a. You can mix -a with -On; in some earlier versions -a overrode -On.

For details, see the chapter Performance Profiling in the Fortran Programmer's Guide.


-ansi

Identify many non-ANSI extensions.

   SPARC: 77/90 PPC:77 Intel:77

Warning messages are issued for any uses of non-standard Fortran 77 or Fortran 90 extensions in the source code.


-arg=local

Preserve actual arguments over ENTRY statements.

   SPARC:77 PPC:77 Intel:77

When you compile a subprogram with alternate entry points with this option, f77 uses copy restore to preserve the association of dummy and actual arguments. For example, the following program would require compilation with -arg=local to insure proper execution:

         A = SETUP(ALPHA,BETA,GAMMA)
         ZORK = FXGAMMA(GCONST)
         ...
         FUNCTION SETUP(A1,A2,A3)
         ...
         ENTRY FXGAMMA(F)
         FXGAMMA = F*GAMMA
         ...
         RETURN
         END

Without this option, there is no guarantee that the correct values of the actual arguments from the SETUP call will be referenced when the routine is entered through FXGAMMA. Code that relies on -arg=local is non-standard.


-autopar

Enable automatic loop parallelization.

   SPARC:77 PPC: - Intel: -

Finds and parallelizes appropriate loops for running in parallel on multiple processors. Analyzes loops for inter-iteration data dependencies and loop restructuring. If the optimization level is not specified -O3 or higher, it will automatically be raised to -O3.

-g cancels -autopar. Debugging is facilitated by specifying -g without any optimization or parallelization options since not all debugging features are available when these options are invoked. See the dbx documentation for details.

To improve performance, also specify the -stackvar option when using any of the parallelization options, including -autopar.

Avoid -autopar if the program already contains explicit calls to the libthread threads library. See note with -mt on page 65.

The -autopar option is not appropriate on a single-processor system, and the compiled code will generally run slower.

To run a parallelized program on a multiprocessor system, you must set the PARALLEL environment variable prior to execution. The default is 1. However, do not request more processors than are available.

If you use -autopar and compile and link in one step, the microtasking library and the threads-safe Fortran runtime library will automatically be linked. If you use -autopar and compile and link in separate steps, then you must also link with -autopar to insure linking the appropriate libraries.

Other parallelization options are -parallel and -explicitpar. While
-autopar is not supported with the f90 compiler, both -parallel and
-explicitpar are. Also, the -reduction option may be used with
-autopar.

Refer to the Fortran: Programmer's Guide for more information on parallelization.


-B{static|dynamic}

Allow dynamic or require static library linking.

   SPARC: 77/90 PPC:77 Intel:77

No space is allowed between -B and dynamic or static. The default, without -B specified, is -Bdynamic.

Also note:

You can toggle -Bstatic and -Bdynamic on the command line. That is, you can link some libraries statically and some dynamically by specifying -Bstatic and -Bdynamic any number of times on the command line.

These are loader and linker options. Compiling and linking in separate steps with -Bx on the compile command will require it in the link step as well.


-C

Check array references for out of range subscripts.

   SPARC:77 PPC:77 Intel:77

Subscripting arrays beyond their declared sizes may result in unexpected results, including segmentation faults. The -C option checks for possible array subscript violations in the source code and during execution.

Specifying -C may make the executable file larger.

If the -C option is used, array subscript violations are treated as an error. If an array subscript range violation is detected in the source code during compilation, it is treated as a compilation error.

If an array subscript violation can only be determined at runtime, the compiler generates range-checking code into the executable program. This may cause an increase in execution time. As a result, it is appropriate to enable full array subscript checking while developing and debugging a program, then recompiling the final production executable without subscript checking.


-c

Compile only; produce object .o files, but suppress linking.

   SPARC: 77/90 PPC:77 Intel:77

Suppress linking. Compile a .o file for each source file. If only a single source file is being compiled, the -o option can be used to specify the name of the .o file written.


-cg89

Compile for generic SPARC architecture.

   SPARC: 77/90 PPC: - Intel: -

This option is a macro for: -xarch=v7 -xchip=old -xcache=64/32/1 which is equivalent to -xtarget=ss2 .


-cg92

Compile for SPARC V8 architecture.

   SPARC: 77/90 PPC: - Intel: -

This option is a macro for:
-xarch=v8 -xchip=super -xcache=16/32/4:1024/32/1 which is equivalent to -xtarget=ss1000 .


-copyargs

Allow assignment to constant arguments.

   SPARC:77 PPC:77 Intel:77

Allow a subprogram to change a dummy argument that is a constant. This option is provided only to allow legacy code to compile and execute without a runtime error.

Code that aborts unless compiled with -copyargs is, of course, not FORTRAN standard compliant. Also, such code is often unpredictable.


-Dname[=def]

Define symbol name for the preprocessor.

   SPARC: 77/90 PPC:77 Intel:77

-Dname=def

Define name to be def

-Dname

Define name to be 1

With .F and .F90 (f90 only) source files, define name to the source-code preprocessor as if:

#define name[=def]

had appears in the source file. If no =def specified, the name name is defined as the value 1.

Following are the predefined values:

Example: For Fortran 4.2, _ _SUNPRO_F77=0x42
_ _sparc, _ _unix, _ _sun, _ _i386, _ _SVR4, _ _SunOS_5_3
For instance, the value _ _i386 is defined on systems compatible with the 80386 (including the 80486), and it is not defined on SPARC systems. You can use these values in such preprocessor conditionals as the following.
#ifdef _ _sparc
sparc, unix, sun, i386

The compilers use the fpp(1) preprocessor by default. Like the C preprocessor cpp(1), fpp expands source code macros and enables conditional compilation of code. Unlike cpp, fpp understand Fortran syntax, and is preferred as a Fortran preprocessor. Use the -xpp=cpp flag to force the compiler to specifically use cpp rather than fpp.


-dalign

Force 8-byte alignment and enable double word load/stores.

   SPARC: 77/90 PPC: - Intel: -

Wherever profitable, the compiler will generate double-word load/store instructions for faster execution of double and quad precision computations.

Using this option automatically triggers the -f option, which causes all double-precision and quadruple-precision data types (both real and complex) to be aligned on 8-byte boundaries.

Using both -dbl and -dalign also causes 64-bit integer data type to be 8-byte aligned.


Caution - -dalign may result in non-ANSI standard alignment of data, which could cause problems with variables in EQUIVALENCE or COMMON.


If you compile one subprogram with -dalign, compile all subprograms of the program with -dalign.


-db

Generate a compiler information file (CIF).

   SPARC:90 PPC: - Intel: -

The CIF is used by f90browse. See the f90browse manual.


-dbl

Double the default size for REAL, INTEGER, DOUBLE, and COMPLEX.

   SPARC:77 PPC:77 Intel:77

-dbl promotes the default byte size for REAL, INTEGER,DOUBLE,and COMPLEX variables declared without an explicit byte size as follows:

Table  3-15 Default Data Sizes and -dbl (Bytes)

Without -dbl option
With -dbl option
Data Type
default
SPARC
Intel
PowerPC
INTEGER 4 8 8 8
REAL 4 8 8 8
DOUBLE 8 16 8 16

This option applies to variables, parameters, constants, and functions.

Also, LOGICAL is treated as INTEGER, COMPLEX as two REALs, and DOUBLE COMPLEX as two DOUBLEs.

Compare -dbl with -r8:

-dbl and -r8 can be expressed in terms of the more general -xtypemap= option:

On SPARC and PowerPC:
-dbl same as: -xtypemap=real:64,double:128,integer:64
-r8 same as: -xtypemap=real:64,double:128,integer:mixed
On Intel:
-dbl same as: -xtypemap=real:64,double:64,integer:64
-r8 same as: -xtypemap=real:64,double:64,integer:mixed

In general, if you compile one subprogram with -dbl, then be sure to compile all subprograms of that program with -dbl. This is particularly important with programs communicating through files with unformatted I/O -- if one program is compiled with -dbl, then the other program must similarly be compiled. Be also aware that this option alters the default data size of function names, including calls to library functions, unless the function name is typed explicitly with a data size.


-dbl_align_all=y

Force alignment of all data on 8-byte boundaries.

   SPARC:77 PPC:77 Intel:77

y is either yes or no. If y is yes, all variables will be aligned on 8-byte boundaries. Default is -dbl_align_all=no.


-depend

Analyze loops for data dependencies.

   SPARC:77 PPC: - Intel: -

Analyze loops for inter-iteration data dependencies and do loop restructuring. This option will raise the optimization level to O3 if no optimization level is specified, or if it is specified less than O3. Dependence analysis is also included with -autopar or -parallel. The dependence analysis is done at compile time. (See the Fortran Programmer's Guide.)

-g cancels -depend.


-dryrun

Show commands built by driver, but do not compile.

   SPARC: 77/90 PPC:77 Intel:77

Useful when debugging, this option displays the commands it will run to perform the compilation.


-d{y|n}

Allow or disallow dynamic libraries for the entire executable

   SPARC: 77/90 PPC:77 Intel:77

The default, if not specified, is -dy.

Unlike -Bx, this option applies to the whole executable and need appear only once on the command line.

-dy|-dn are loader and linker options. If you compile and link in separate steps with these options, then you need the same option in the link step.


-e

Accept extended length input source line.

   SPARC: 77/90 PPC:77 Intel:77

Accept source lines up to 132 characters long. The compiler pads on the right with trailing blanks to column 132. If you use continuation lines while compiling with -e, then do not split character constants across lines, otherwise, unnecessary blanks may be inserted in the constants.


-erroff=taglist

Suppress warning messages listed by tag name.

   SPARC:77 PPC:77 Intel:77

Suppress displaying the warning messages specified in the comma-separated list of tag names taglist. If taglist consists of %none, no warnings are suppressed. If taglist consists of %all, all warnings are suppressed (this is equivalent to the -w option.)


-errtags

Display the message tag with each warning message.

   SPARC:77 PPC:77 Intel:77

With this option, the compiler's internal error tag name will appear along with warning messages. The default is not to display the tag.

demo% f77 -errtags ink.f
ink.f:
 MAIN:
"ink.f", line 11: Warning: local variable "i" never used 
(WDECL_LOCAL_NOTUSED)  <- The warning message's tag name

-explicitpar

Parallelize loops explicitly marked by directives.

   SPARC: 77/90 PPC: - Intel: -

This option turns on explicit parallelization. DO loops immediately preceded by DOALL directives will have threaded, parallel code compiled for them. Parallelization is only appropriate on multiprocessor systems. This option should not be used to compile programs that already do their own multithreading with calls to the libthread library.

If the optimization level is not -O3 or higher, it is raised to -O3 automatically.

The compiler will generate parallel code even if there are data dependencies in the DO loop that would cause the loop to generate incorrect results when run in parallel. With explicit parallelization, it is the user's responsibility to correctly analyze loops for data dependency problems before marking them with parallelization directives.

For details, see the Parallelization chapter in the Fortran Programmer's Guide.

To improve performance, also specify the -stackvar option when using any of the parallelization options, including -explicitpar.

-g cancels -explicitpar. Debugging is facilitated by specifying -g without any optimization or parallelization options since not all debugging features are available when these options are invoked. See the dbx documentation for details.

If you use -explicitpar and compile and link in one step, then linking automatically includes the microtasking library and the threads-safe FORTRAN runtime library. If you use -explicitpar and compile and link in separate steps, then you must also link with -explicitpar.


-ext_names=e

Create external names with or without trailing underscore.

   SPARC:77 PPC:77 Intel:77

e must be either plain or underscore. The default is underscore.

-ext_names=plain: Do not add trailing underscore.

-ext_names=underscore: Add trailing underscore.

An external name is a name of a subroutine, function, block data subprogram, or labeled common. This option affects both the name of the routine's entry point and the name used in calls to it. This option may be used to allow Fortran 77 routines to call and be called by other language routines.


-F

Invoke the source file preprocessor, but do not compile.

   SPARC: 77/90 PPC:77 Intel:77

Apply the fpp preprocessor to .F files (and .F90 files with f90) and write the processed result on a file with the same name but with suffix changed to .f (or .f90), but do not compile.

Example:
f77 -F source.F
writes to source.f

fpp is the default preprocessor for Fortran. The C preprocessor, cpp, can be selected instead by specifying -xpp=cpp.


-f

Align data on 8-byte boundaries.

   SPARC: 77/90 PPC: - Intel: -

Align all COMMON blocks and all double-precision and quadruple-precision local data on 8-byte boundaries. This applies to complex data as well.

Using -dbl with -f aligns all 64-bit integer data on 8-byte boundaries as well.

A program requiring -f may not be standard and may not be portable.

Compiling any part of a program with -f requires compiling all subprograms of that program with -f.

By itself, this option does not enable the compiler to generate faster double word fetch/store instructions on double and quad precision data.
See -dalign,
page 45


-fast

Optimize for speed of execution using a selection of options.

   SPARC: 77/90 PPC:77 Intel:77

Select options that optimize for speed of execution without excessive compilation time. This option provides close-to-the-maximum performance for many applications.

If you compile and link in separate steps, and you compile with -fast, then be sure to link with -fast.


Note - This option is defined as a particular selection of other options that is subject to change from one release to another, and between compilers. Also, some of the options selected by -fast may not be available on some platforms.


-fast selects the following options:

If the program is intended to run on a different target than the compilation machine, follow the -fast with a code-generator option. For example:
f77 -fast xtarget=ultra ...
For C functions that depend on exception handling, follow -fast by -nolibmil: -fast -nolibmil. With -libmil, exceptions cannot be detected with errno or matherr(3m).
-fsimple is unsuitable if strict IEEE 754 standards compliance is required.
Using this option may generate non-ANSI standard Fortran data alignment.

The set of options selected by -fast differ across platforms:

Table  3-16 -fast selections across platforms

Option
SPARC
Intel
PowerPC
-dalign X -- --
-depend X -- --
-fns X X X
-fsimple=1 X -- --
-ftrap=%none X X X
-libmil X (see note) X X
-native X X X
-nofstore -- X --
-O4 X X X
-xlibmopt X X --

Note - With f90, the -f option is substituted for -libmil on SPARC.


It is possible to add or subtract from this list by following the -fast option with other options, as in:

f77 -fast -fsimple=2 -xnolibmopt ...

which overrides the -fsimple=1 option and disables the -xlibmopt selected by -fast.


-fixed

Specify fixed-format source input files.

   SPARC:90 PPC: - Intel: -

All source files on the command-line will be interpreted as f77 fixed format regardless of filename extension. Normally, f90 interprets only .f files as fixed format, .f90 as free format.


-flags

Synonym for -help.

   SPARC: 77/90 PPC:77 Intel:77

-fnonstd

Initialize floating-point hardware to non-standard preferences.

   SPARC: 77/90 PPC:77 Intel:77

This option is a synonym for the combination -fns -ftrap=common on SPARC, -ftrap=common on Intel and PowerPC.

Specifying -fnonstd is approximately equivalent to the following two calls at the beginning of a Fortran main program.

i=ieee_handler("set", "common", SIGFPE_ABORT)
call nonstandard_arithmetic() 

The nonstandard_arithmetic() routine replaces the obsolete abrupt_underflow() routine of earlier releases.

To be effective, the main program must be compiled with this option.

On some floating-point hardware, the nonstandard_arithmetic() call causes all underflows to produce zero rather than a possibly subnormal number, as the IEEE standard requires. This may be a performance improvement. See ieee_functions(3m).

The -fnonstd option allows hardware traps to be enabled for floating-point overflow, division by zero, and invalid operation exceptions. These are converted into SIGFPE signals, and if the program has no SIGFPE handler, it terminates with a dump of memory to a core file. See ieee_handler(3m).


-fnonstop

Disable floating-point exception trapping.

   SPARC:90 PPC: - Intel: -

Default behavior of f90 is to trap on invalid, overflow, and divide by zero floating-point exceptions. Specifying -fnonstop disables exception trapping; execution continues without stopping.


-fns

Select the SPARC nonstandard floating-point mode.

   SPARC: 77/90 PPC: - Intel: -

The default is the SPARC standard floating-point mode. (See the Floating-Point chapter of the Fortran Programmer's Guide.)

Floating-point arithmetic is initialized to nonstandard preferences on program startup:

Where x does not cause total underflow, x is a denormalized number if and only if |x| is in one of the ranges indicated:

Data Type
Range
REAL 0.0 < |x| < 1.17549435e-38
DOUBLE PRECISION 0.0 < |x| < 2.22507385072014e-308

See the Numerical Computation Guide for details on denormalized numbers, and the Fortran Programmer's Guide chapter Floating-Point for more information about this and similar options.

The standard initialization of floating-point preferences is the default:

To be effective, the main program must be compiled with this option.


-fprecision=p

Initialize floating-point precision mode on Intel.

   SPARC: - PPC: - Intel:77

p is either single, double, or extended.

Initialize the floating-point hardware precision mode to single, double, or extended. Compile the main program with this option. (See the Floating-Point chapter of the Fortran Programmer's Guide.)


-free

Specify free-format source input files.

   SPARC:90 PPC: - Intel: -

All source files on the command-line will be interpreted as f90 free format regardless of filename extension. Normally, f90 interprets .f files as fixed format, .f90 as free format.


-fround=r

Set the IEEE rounding mode in effect at startup.

   SPARC: 77/90 PPC:77 Intel:77

r must be one of: nearest, tozero, negative, positive.

The default is -fround=nearest.

This option sets the IEEE 754 rounding mode that:

The meanings are the same as those for the ieee_flags function. (See the Floating-Point chapter of the Fortran Programmer's Guide.)

To be effective, compile the main program with this option.


-fsimple[=n]

Select floating-point optimization preferences.

   SPARC:77 PPC:77 Intel:77

Allow the optimizer to make simplifying assumptions concerning floating-point arithmetic. (See the Floating-Point chapter of the Fortran Programmer's Guide.)

For consistent results, compile all units of a program with the same -fsimple option.

If n is present, it must be 0, 1, or 2. The defaults are:

-fsimple=0

Permit no simplifying assumptions. Preserve strict IEEE 754 conformance.

-fsimple=1

Allow conservative simplifications. The resulting code does not strictly conform to IEEE 754, but numeric results of most programs are unchanged.
With -fsimple=1, the optimizer can assume the following:
With -fsimple=1, the optimizer is not allowed to optimize completely without regard to roundoff or exceptions. In particular, a floating-point computation cannot be replaced by one that produces different results with rounding modes held constant at run time. -fast implies -fsimple=1.

-fsimple=2

Permit aggressive floating point optimizations that may cause many programs to produce different numeric results due to changes in rounding.
For example, in a given loop, permit the optimizer to replace all computations of x/y with x*z, where z=1/y, x/y is guaranteed to be evaluated at least once in the loop, and the values of y and z are known to have constant values during execution of the loop.

Even with -fsimple=2, the optimizer still is not permitted to introduce a floating point exception in a program that otherwise produces none.


-fstore

Force precision of floating-point expressions.

   SPARC: - PPC: - Intel:77

Use the precision of destination variable to determine the precision of the right-hand-side expression on assignment statements. The default is -fstore. (The -fast option sets -nofstore to disable this option.)


-ftrap=t

Set floating-point trapping mode in effect at startup.

   SPARC: 77/90 PPC:77 Intel:77

t is a comma-separated list that consists of one or more of the following:

%all, %none, common, [no%]invalid, [no%]overflow, [no%]underflow, [no%]division, [no%]inexact.

The default is -ftrap=%none. Where the % is shown, it is a required character.

This option sets the IEEE 754 trapping modes that are established at program initialization. Processing is left-to-right. The common exceptions, by definition, are invalid, division by zero, and overflow. For example: -ftrap=overflow.

Example: -ftrap=%all,no%inexact means set all traps, except inexact.

The meanings for -ftrap=t are the same as for ieee_flags(), except that:

To be effective, compile the main program with this option.

For further information, see the Floating-Point chapter in the Fortran Programmer's Guide.


-G

Build a dynamic shared library instead of an executable file.

   SPARC: 77/90 PPC:77 Intel:77

Direct the linker to build a shared dynamic library. Without -G, the linker builds an executable file. With -G, it builds a dynamic library. Use -o with -G to specify the name of the file to be written. See the Fortran Programmer's Guide chapter Libraries for details.


-g

Compile for debugging.

   SPARC: 77/90 PPC:77 Intel:77

Produce additional symbol table information for the debugging with dbx(1) and the Sun WorkShop debugging utility.

Although a some debugging is possible without specifying -g, the full capabilities of dbx and debugger are only available to those compilation units compiled with -g.

Some capabilities of other options specified along with -g may be limited. The -g option suppresses the automatic inlining usually obtained with -O4, but it does not suppress -On optimizations.

-g cancels any parallelization option (-autopar, -explicitpar,
-parallel
) as well as -depend and -reduction. Debugging is facilitated by specifying -g without any optimization or parallelization options since not all debugging features are available when these options are invoked. See the dbx documentation for details.

For Intel and PowerPC: -g is ignored when specified with a -On option or
-fast.

For SPARC: The -g option makes -xildon the default incremental linker option (see "-xildon" on page 91). That is, with -g, the compiler default behavior is to automatically invoke ild in place of ld, unless the -G option is present, or any source file is named on the command line.


-hnm

Specify the name of the generated dynamic shared library.

   SPARC: 77/90 PPC:77 Intel:77

This option is passed on to the linker. For details, see the Linker and Libraries Guide, and the Fortran Programmer's Guide chapter Libraries.

The -hnm option records the name nm to the shared dynamic library being created as the internal name of the library. A space between -h and nm is optional. In general, nm must be the same as what follows the -o. Use of this option is meaningless without also specifying -G.

Without the -hnm option, no internal name is recorded in the library file.

If the library has an internal name, whenever an executable program referencing the library is run the runtime linker will search for a library with the same internal name in any path the linker is searching. With an internal name specified, searching for the library at runtime linking is more flexible. This option can also be used to specify versions of shared libraries.

If there is no internal name of a shared library, then the linker uses a specific path for the shared library file instead.


-help

Display a summary list of compiler options.

   SPARC: 77/90 PPC:77 Intel:77

Displays a list of option summaries and indicates how to send feedback comments to Sun. See also -xhelp=h on page 91.


-Idir

Add dir to the INCLUDE file search path.

   SPARC: 77/90 PPC:77 Intel:77

Insert the directory dir at the start of the INCLUDE file search path. No space is allowed between -I and dir. Invalid directories are ignored with no warning message.

The include file search path is the list of directories searched for INCLUDE files: file names appearing on preprocessor #include directives, or Fortran INCLUDE statements.

Example: Search for INCLUDE files in /usr/app/include:

demo% f77 -I/usr/app/include growth.F

Multiple -Idir options may appear on the command line. Each adds to the top of the search path list (first path searched).

The search order for relative path on INCLUDE or #include is:

1. The directory that contains the source file
2. The directories that are named in the -Idir options
3. The directories in the default list

The default list for -Idir depends on the installation directory for the compiler. In a standard install, compiler software packages reside in the /opt directory; however, systems administrators may decide to install packages in other locations. If an environment variable, INSTALL_HOME say, points at the installation path (e.g. /opt, or /some/place), the default search paths for INCLUDE files are:

for f77: $INSTALL_HOME/SUNWspro/SC4.2/include/f77  /usr/include
for f90: $INSTALL_HOME/SUNWspro/SC4.2/include/f90  /usr/include

-i2

Set the default integer size to two bytes.

   SPARC:77 PPC:77 Intel:77

Set the default size to 2 bytes for integer and logical constants and variables declared without an explicit size. ( INTEGER*n Y still declares Y to be n bytes regardless of the -i2.) This option may degrade performance. It is generally recommended to declare specific variables INTEGER*2 rather than use -i2.


-i4

Set the default integer size to four bytes.

   SPARC: 77/90 PPC:77 Intel:77

Set the default size to 4 bytes for integer and logical constants and variables declared without an explicit size. ( INTEGER*n Y still declares Y to be n bytes regardless of the -i4.).

Although 4 bytes is the default size for INTEGER and LOGICAL, this option can be used for overriding settings made by options like -dbl and -r8, which set these defaults to 8:

demo% f77 -dbl -i4 *.f
Command line warning: -i4 overrides integer part of -dbl
...

-inline=f1[,...fn]

Inline specified routines.

   SPARC:77 PPC:77 Intel:77

Request that the optimizer inline the user-written routines named in the f1,...,fn list. Inlining is an optimization technique whereby the compiler effectively replaces a subprogram reference such as a CALL or function call with the actual subprogram code itself. Inlining often provides the optimizer more opportunities to produce efficient code.

The list is a comma-separated list of functions and subroutines.

Example: Inline the routines xbar, zbar, vpoint:

demo% f77 -O3 -inline=xbar,zbar,vpoint *.f

Following are the restrictions; no warnings are issued:

Note that with -O4, f77 normally tries to inline all appropriate user-written subroutines and functions. Adding -inline with -O4 actually degrades performance by restricting the optimizer's inlining to only those routines in the list.


-Kpic

Synonym for -pic.

   SPARC:77 PPC:77 Intel:77

-KPIC

Synonym for -PIC.

   SPARC:77 PPC:77 Intel:77

-Ldir

Add dir to list of directories to search for libraries.

   SPARC: 77/90 PPC:77 Intel:77

Add dir at the start of the list of object-library search directories. A space between -L and dir is optional. This option is passed to the linker. See also -lx on page 62.

While building the executable file,ld(1) searches dir for archive libraries (.a files) and shared libraries (.so files). ld searches dir before searching the default directories. (See the Fortran Programmer's Guide chapter Libraries for information on library search order.) For the relative order between LD_LIBRARY_PATH and -Ldir, see ld(1).

Example: Use -Ldir to specify a library search directory:

demo% f77 -Ldir1 any.f

Example: Use -Ldir again to add more directories:

demo% f77 -Ldir1  -Ldir2  any.f

Note - Specifying /usr/lib or /usr/ccs/lib with -Ldir may prevent linking the unbundled libm. These directories are searched by default.



-lx

Add library libx.a to linker's list of search libraries.

   SPARC: 77/90 PPC:77 Intel:77

Pass -lx to the linker to specify additional libraries for ld to search for unresolved references. ld links with object library libx. If shared library libx.so is available (and -Bstatic or -dn are not specified), ld uses it, otherwise, ld uses static library libx.a. If it uses a shared library, the name is built in to a.out. No space is allowed between -l and x character strings.

Example: Link with the library libV77:

demo% f77 any.f -lV77

Use -lx again to link with more libraries.

Example: Link with the libraries liby and libz:

demo% f77 any.f -ly -lz 

See also the Libraries chapter in the Fortran Programmer's Guide for information on library search paths and search order.


-libmil

Inline selected libm library routines for optimization.

   SPARC:77 PPC:77 Intel:77

There are inline templates for some of the libm library routines. This option selects those inline templates that produce the fastest executables for the floating-point options and platform currently being used. The routines include the following:

d_infinity, d_max_normal, d_max_subnormal, d_min_normal, 
d_min_subnormal, d_quiet_nan, d_signaling_nan, d_sqrt, ir_finite, 
ir_fp_class, ir_isinf, ir_isnan, ir_isnormal, ir_issubnormal, 
ir_iszero, ir_signbit, r_copysign, r_fabs, r_hypot, r_infinity, 
r_max_normal, r_max_subnormal, r_min_normal, r_min_subnormal, 
r_quiet_nan, r_signalling_nan, r_sqrt

This list of routines may change with subsequent compiler releases. For more information, see the man pages libm_single(3F) and libm_double(3F)


-loopinfo

Show parallelization results.

   SPARC:77 PPC: - Intel: -

Show which loops parallelized and which did not with the -parallel,
-autopar, or -explicitpar options.

-loopinfo generates a list of messages on standard error:

demo% f77 -o shalow -fast -parallel -loopinfo shalow.f
shalow.f:
 MAIN shalow:
	inital:
	calc1:
...etc
"shalow.f", line 78: not parallelized, call may be unsafe
"shalow.f", line 172: PARALLELIZED
"shalow.f", line 173: not parallelized, not profitable
"shalow.f", line 181: PARALLELIZED, fused
"shalow.f", line 182: not parallelized, not profitable
"shalow.f", line 226: PARALLELIZED, and serial version generated
"shalow.f", line 227: not parallelized, not profitable
...etc

Use the error(1) utility to merge this list with the source file to produce an annotated source listing with each loop tagged as parallelized or not.

Example: -loopinfo, in sh, pass standard error to the error utility:

demo$ f77 -autopar -loopinfo any.f 2>&1 | error options

Be aware that error rewrites the input source file. For details on error, see the error man page and the Fortran Programmer's Guide chapter on debugging.


-Mdir

Add dir to directories searched for Fortran 90 modules.

   SPARC:90 PPC: - Intel: -

Add dir to the list of directories to be searched for module files. No space appears between the -M and dir.

The directories listed with -M are searched after the current directory. Compiling a source file containing a module generates a .M module file in addition to the .o file. See Appendix C, "Module Files" on page 149 for more information about modules in Fortran 90.


-misalign

Allow misaligned data.

   SPARC:77 PPC:77 Intel: -

The -misalign option permits misaligned data in memory that would otherwise produce an error. Particular uses of COMMON and EQUIVALENCE statements cause data to be misaligned. Using this option may degrade performance; recoding to eliminate the cause of data misalignment is recommended instead.

Example: The following creates misaligned variables.

	INTEGER*2   I(4)
	REAL        R1, R2
	EQUIVALENCE (R1, I(1)), (R2, I(2))
	END

Two-byte elements of integer array I are equivalenced to the 4-byte reals, contradicting the natural alignment of elements in an INTEGER*2 array . The following error message is issued:

"misalign.f", line 4: Error: bad alignment for "r2" forced by 
equivalence

Compiling with -misalign eliminates the compilation error, but sub-optimal code is generated. If you compile and link in separate steps, compiling with the -misalign option requires the option on the link step as well.


-mp={sun|cray}

Select the style for parallelization directives.

   SPARC:77 PPC: - Intel: -

The default without specifying -mp is sun. Do not combine use in a single application.

-mp=sun: Accept only the Sun-style directives: C$PAR or !$PAR prefix.

-mp=cray: Accept only the Cray-style directives: CMIC$ or !MIC$ prefix.

See the Fortran Programmer's Guide chapter on Parallelization for details.


-mt

Require multithread-safe libraries.

   SPARC: 77/90 PPC:77 Intel:77

Require linking to multithread-safe libraries. If you do your own low-level thread management (e.g. calls to the libthread library), compiling with -mt prevents conflicts.

Use -mt if you mix C and Fortran, and you manage multithread C coding using the libthread primitives. Before you use your own multi-threaded coding, read the Solaris manual, Multithreaded Programming Guide.

The equivalent of -mt is included automatically with the -autopar, -explicitpar, or -parallel options.

Note the following:


-native

Optimize performance for the host system.

   SPARC: 77/90 PPC:77 Intel:77

This option is a synonym for -xtarget=native. This is one of the options included in the expansion of the -fast option .


-noautopar

Disable automatic parallelization.

   SPARC:77 PPC: - Intel: -

Disables automatic parallelization invoked by -autopar earlier on the command line.


-nodepend

Cancel -depend in command line.

   SPARC:77 PPC: - Intel: -

Cancel any -depend appearing earlier on the command line.


-noexplicitpar

Disable explicit parallelization.

   SPARC:77 PPC: - Intel: -

Disables explicit parallelization invoked by -explicitpar earlier on the command line.


-nofstore

Disable forcing precision of expression.

   SPARC: - PPC: - Intel:77

Disables forcing precision of expressions in assignment statements invoked by -fstore earlier on the command line (Intel only). -nofstore is invoked if -fast is specified.


-nolib

Disable linking with system libraries.

   SPARC: 77/90 PPC:77 Intel:77

Do not automatically link with any system or language library; that is do not pass any default -lx options on to ld. The normal behavior is to link system libraries into the executables automatically, without the user specifying them on the command line.

The -nolib option makes it easier to link one of these libraries statically. The system and language libraries are required for final execution. It is your responsibility to link them in manually. This option provides you with complete control.

For example, consider a program linked dynamically with libF77 that fails on a remote system because has no libF77. With this option you can link the library into your program statically.

Link libF77 statically and link libc dynamically with f77:

demo% f77 -nolib any.f -Bstatic -lF77 -Bdynamic -lm -lc

Link libm statically and libc dynamically with f90:

demo% f90 -nolib any.f90 -lf90 -Bstatic -lm -Bdynamic -lc

libf90 is always linked statically.

The order for the -lx options is important. Follow the order shown in the examples.


-nolibmil

Cancel -libmil on command line.

   SPARC:77 PPC:77 Intel:77

Use this option after the -fast option to disable inlining of libm math routines:

demo% f77 -fast -nolibmil ...

-noqueue

Disable license queueing.

   SPARC:77 PPC:77 Intel:77

With this option, if no software license is available to run the compiler, it returns without queueing your request and without compiling. A nonzero environment status is returned for testing in make files.


-noreduction

Cancel -reduction on command line.

   SPARC: 77/90 PPC: - Intel: -

-reduction is used with other parallelization options. This option cancels
-reduction.


-norunpath

Do not build a runtime shared library search path into the executable.

   SPARC: 77/90 PPC:77 Intel:77

The compiler normally builds into an executable a path that tells the runtime linker where to find the shared libraries it will need. The path is installation dependent. The -norunpath option prevents that path from being built in to the executable.

This option is helpful when libraries have been installed in some nonstandard location, and you do not wish to make the loader search down those paths when the executable is run at another site. Compare with -Rpaths.

See the Fortran Programmer's Guide chapter on Libraries for more information.


-O[n]

Specify optimization level.

   SPARC: 77/90 PPC:77 Intel:77

n can be 1, 2, 3, 4, or 5. No space is allowed between -O and n.

If -O[n] is not specified, only a very basic level of optimization limited to local common subexpression elimination and dead code analysis is performed. A program's performance may be significantly improved when compiled with an optimization level than without optimization. Use of -O (which implies -O3) or -fast (which implies -O4) is recommended for most programs.

Each -On level includes the optimizations performed at the levels below it. Generally, the higher the level of optimization a program is compiled with, the better runtime performance obtained. However, higher optimization levels may result in increased compilation time and larger executable files.

Debugging with -g does not suppress -On, but -On limits -g in certain ways; this is described on page 57.

The-O3 and -O4 options reduce the utility of debugging such that you cannot display variables from dbx, but you can still use the dbx where command to get a symbolic traceback.

For SPARC: If the optimizer runs out of memory, it attempts to proceed over again at a lower level of optimization, resuming compilation of subsequent routines at the original level.

For details on optimization, see the Fortran Programmer's Guide chapters Performance Profiling, and Performance and Optimization.


-O

This is equivalent to -O3.


-O1

Provides a minimum of statement-level optimizations.

Use if higher levels result in excessive compilation time, or exceed available swap space.


-O2

Enables basic block level optimizations.

This level usually gives the smallest code size. (See also -xspace.)

-O3 is preferred over -O2 unless -O3 results in unreasonably long compilation time, exceeds swap space, or generates excessively large executable files.


-O3

Adds loop unrolling and global optimizations at the function level.

Usually -O3 generates larger executable files.


-O4

Adds automatic inlining of routines contained in the same file.

Usually -O4 generates larger executable files due to inlining. (f77 only; for f90, -O4 is equivalent to -O3)

The -g option suppresses the -O4 automatic inlining described above.
-xcrossfile increases the scope of inlining with -O4.


-O5

Attempt aggressive optimizations. (f77 only).

Suitable only for that small fraction of a program that uses the largest fraction of compute time. -O5's optimization algorithms take more compilation time, and may also degrade performance when applied to too large a fraction of the source program.

Optimization at this level is more likely to improve performance if done with profile feedback. See -xprofile=p.


-o nm

Specify the name of the executable file to be written.

   SPARC: 77/90 PPC:77 Intel:77

There must be a blank between -o and nm. Without this option, the default is to write the executable file to a.out. When used with -c, -o specifies the target .o object file; with -G it specifies the target .so library file.


-oldldo

Select "old" list-directed output style.

   SPARC:77 PPC:77 Intel:77

Omit the blank that starts each record for list-directed output. This is a change from f77 releases 1.4 and earlier. The default behavior is to provide that blank, since the Fortran Standard requires it. Note also the FORM='PRINT' option of OPEN. You can compile parts of a program with -oldldo and other parts without it.


-onetrip

Enable one trip DO loops.

   SPARC: 77/90 PPC:77 Intel:77

Compile DO loops such that they are executed at least once. DO loops in standard Fortran are not performed at all if the upper limit is smaller than the lower limit, unlike some legacy implementations of Fortran.


-p

Compile for profiling with the prof profiler.

   SPARC: 77/90 PPC:77 Intel:77

Prepare object files for profiling, see prof (1). If you compile and link in separate steps, and if you compile with the -p option, then be sure to link with the -p option. -p with prof is provided mostly for compatibility with older systems. -pg profiling with gprof is possibly a better alternative. See the Fortran Programmer's Guide chapter on Performance Profiling for details.


-pad[=p]

Insert padding for efficient use of cache.

   SPARC:77 PPC: - Intel: -

This option inserts padding between arrays or character variables if they are static local and not initialized, or in common blocks. The extra padding positions the data to make better use of cache. In either case, the arrays or character variables can not be equivalenced.

For -pad[=p], if p is present, it must be either (or both):

local Put padding between adjacent local variables
common Put padding between variables in common blocks

Defaults for -pad:

The following are equivalent:

The -pad[=p] option applies to items that satisfy the following criteria:

For a definition of local or static variables, see -stackvar, page 79.

Restrictions on -pad=common:


-parallel

Parallelize loops with: -autopar, -explicitpar, -depend

   SPARC: 77/90 PPC: - Intel: -

Parallelize loops chosen automatically by the compiler and explicitly specified by user supplied directives. Optimization level is automatically raised to -O3 if it is lower.

-g cancels -parallel. Debugging is facilitated by specifying -g without any optimization or parallelization options since not all debugging features are available when these options are invoked. See the dbx documentation for details.

To improve performance, also specify the -stackvar option when using any of the parallelization options, including -autopar.

Avoid -parallel if you do your own thread management. See the discussion of -mt on page 65.

Parallelization options like -parallel are intended to produce executables programs to be run on multiprocessor systems. On a single-processor system, parallelization generally degrades performance.

If you compile and link in separate steps, if -parallel appears on the compile command it must also appear on the ld link command.

See the Fortran Programmer's Guide chapter Parallelization for further information.


-pentium

Compile for Intel Pentium.

   SPARC: - PPC: - Intel:77

Generate code that exploits features available on Intel Pentium compatible computers. The default on Intel is -386. Code compiled with -pentium does run on 80386 and 80486 hardware, but it may be slower. Use of the option
-xtarget=pentium is preferred over -pentium.


-pg

Compile for profiling with the gprof profiler.

   SPARC: 77/90 PPC:77 Intel:77

Compile self-profiling code in the manner of -p, but invoke a runtime recording mechanism that keeps more extensive statistics and produces a gmon.out file when the program terminates normally. Generate an execution profile by running gprof (1).

Library options must be after the .f and .o files (-pg libraries are static).

If you compile and link in separate steps, and you compile with -pg, then be sure to link with -pg.


-pic

Compile position-independent code for shared library.

   SPARC: 77/90 PPC:77 Intel:77

This kind of code is for dynamic shared libraries. Each reference to a global datum is generated as a dereference of a pointer in the global offset table. Each function call is generated in program-counter-relative addressing mode through a procedure linkage table.

There are two nominal performance costs with -pic and -PIC:

When considering the above costs, remember that the use of -pic and
-PIC can significantly reduce system memory requirements, due to the effect of library code sharing. Every page of code in a shared library compiled
-pic or -PIC can be shared by every process that uses the library. If a page of code in a shared library contains even a single non-pic (that is, absolute) memory reference, the page becomes nonsharable, and a copy of the page must be created each time a program using the library is executed.

The easiest way to tell whether or not a .o file has been compiled with -pic or -PIC is with the nm command:

% nm  file.o | grep _GLOBAL_OFFSET_TABLE_ 

U _GLOBAL_OFFSET_TABLE_

A .o file containing position-independent code contains an unresolved external reference to _GLOBAL_OFFSET_TABLE_, as indicated by the letter U.

To determine whether to use -pic or -PIC, use nm to identify the number of distinct global and static variables used or defined in the library. If the size of _GLOBAL_OFFSET_TABLE_ is under 8,192 bytes, you can use -pic. Otherwise, you must use -PIC.


-PIC

Compile position-independent code, but with 32-bit addresses.

   SPARC: 77/90 PPC:77 Intel:77

This option is similar to -pic, but it allows the global offset table to span the range of 32-bit addresses. Use it in those rare cases where there are too many global data objects for -pic. Do not mix -pic and -PIC.

On PowerPC, the size of the global offset table is unlimited. On Intel, -PIC is identical to -pic.


-Qoption pr ls

Pass options to compilation phase pr.

   SPARC: 77/90 PPC:77 Intel:77

Pass the suboption list ls to the compilation phase pr. There must be blanks separating Qoption, pr, and ls. The Q can be uppercase or lowercase. The list is a comma-delimited list of suboptions, with no blanks within the list. Each suboption must be appropriate for that program phase, and can begin with a minus sign.

pr can be one of the following: as, cg, cpp, fbe, fpp, f77pass0, f77pass1, iropt, ld, or ratfor. This option is provided primarily for internal debugging.

Example: Pass the -s and -m options to the linker ld:

demo%  f77 -Qoption ld -s,-m src.f

-qp

Synonym for -p.

   SPARC: 77/90 PPC:77 Intel:77

-R ls

Build dynamic library search paths into the executable file.

   SPARC: 77/90 PPC:77 Intel:77

With this option, the linker, ld(1), stores a list of dynamic library search paths into the executable file.

ls is a colon-separated list of directories for library search paths. The blank between -R and ls is optional.

Multiple instances of this option are concatenated together, with each list separated by a colon.

The list is used at runtime by the runtime linker, ld.so. At runtime, dynamic libraries in the listed paths are scanned to satisfy any unresolved references.

Use this option to let users run shippable executables without a special path option to find needed dynamic libraries.

Building an executable file using -Rpaths adds directory paths to a default path that is always searched last:

Standard Install: /opt/SUNWspro/lib
Non-standard Install: installpath/lib

For more information, see the Libraries chapter in the Fortran Programmer's Guide, and the Solaris Linker and Libraries Guide.


-r8

Double default byte size for REAL,INTEGER, DOUBLE and COMPLEX.

   SPARC:77 PPC:77 Intel:77

-r8 promotes the default byte size for REAL, INTEGER, DOUBLE, and COMPLEX variables declared without an explicit byte size as follows:

Table  3-17 Default Data Sizes and -r8 (Bytes)

Without -r8 option
With -r8 option
Data Type
default
SPARC
Intel
PowerPC
INTEGER 4 8 8 8
REAL 4 8 8 8
DOUBLE 8 16 8 16

This option applies to variables, parameters, constants, and functions.

Also, LOGICAL is treated as INTEGER, COMPLEX as two REALs, and DOUBLE COMPLEX as two DOUBLEs.

Compare -r8 with -dbl:

-dbl and -r8 can be expressed in terms of the more general -xtypemap= option:

On SPARC and PowerPC:
-dbl same as: -xtypemap=real:64,double:128,integer:64
-r8 same as: -xtypemap=real:64,double:128,integer:mixed
On Intel:
-dbl same as: -xtypemap=real:64,double:64,integer:64
-r8 same as: -xtypemap=real:64,double:64,integer:mixed

For all of the floating point data types, -dbl works the same as -r8; using both -r8 and -dbl produces the same results as using only -dbl.

In general, if you compile one subprogram with -r8, then be sure to compile all subprograms of that program with -r8. This also important with programs communicating through unformatted I/O files -- if one program is compiled with -r8, then the other program must be similarly compiled. Be also aware that this option alters the default data size of function names, including calls to library functions, unless the function name is typed explicitly with a data size.

The impact on runtime performance may be great. With -r8, an expression like float = 15.0d0*float is evaluated in quadruple precision due to the declaration of the constant.

If you select both -r8 and -i2, the results are unpredictable.


-reduction

Recognize reduction operations in loops.

   SPARC: 77/90 PPC: - Intel: -

Analyze loops for reduction operations during automatic parallelization. There is potential for roundoff error with the reduction.

A loop that transforms the elements of an array into a single scalar value is called a reduction operation. For example, summing the elements of a vector is a typical reduction operation. Although these operations violate the criteria for parallelizability, the compiler can recognize them and parallelize them as special cases when -reduction is specified. See the Fortran Programmer's Guide chapter Parallelization for information on reduction operations recognized by the compilers.

This option applies only with the automatic parallelization options -autopar or -parallel. It is ignored otherwise. Explicitly parallelized loops are not analyzed for reduction operations.

Example: Automatically parallelize with reduction:

demo% f77 -parallel -reduction any.f

-S

Compile and only generate assembly code.

   SPARC: 77/90 PPC:77 Intel:77

Compile the named programs and leave the assembly-language output on corresponding files suffixed with .s. No .o file is created.


-s

Strip the symbol table out of the executable file.

   SPARC: 77/90 PPC:77 Intel:77

This option makes the executable file smaller and more difficult to reverse engineer. However, this option inhibits debugging with dbx or other tools, and overrides -g.


-sb

Produce table information for the WorkShop source code browser.

   SPARC:77 PPC:77 Intel:77

See WorkShop: Getting Started for more information.


-sbfast

Produce only source code browser tables.

   SPARC:77 PPC:77 Intel:77

Produce only table information for the WorkShop source code browser and stop. Do not assemble, link, or make object files.


-silent

Suppress compiler messages.

   SPARC:77 PPC:77 Intel:77

Use this option to suppress non-essential messages from the compiler; error and warning messages are still issued. The default is to show file and entry names as they are reached during the compilation.


-stackvar

Force all local variables to be allocated on the memory stack.

   SPARC: 77/90 PPC:77 Intel:77

Allocate all the local variables and arrays in a routine onto the memory stack, unless otherwise specified. This option makes them automatic, rather than static, and provides more freedom to the optimizer for parallelizing a CALL in a loop.

Use of -stackvar is recommended with any of the parallelization options.

Variables and arrays are local, unless they are:

Initializing a local variable in a DATA statement after an executable reference to that variable is flagged as an error when -stackvar is used:

demo% cat stak.f
        real x
        x =  1.
        t = 0.
        print*, t
        data x/3.0/
        print *,x+t
        end
demo% f77 -o stak -stackvar stak.f
stak.f:
 MAIN:
"stak.f", line 5: Error: attempt to initialize an automati
 variable: x

Putting large arrays onto the stack with -stackvar can overflow the stack causing segmentation faults. Increasing the stack size may be required.

There are two stacks:

The default stack size is about 8 Megabytes for the main stack and 256 KBytes for each thread stack. The limit command (with no parameters) shows the current main stack size. If you get a segmentation fault using -stackvar, you might try doubling the main stack size at least once.

Example: Show the current main stack size:

demo% limit
cputime         unlimited
filesize        unlimited
datasize        523256 kbytes
stacksize       8192 kbytes      <---
coredumpsize    unlimited
descriptors     64 
memorysize      unlimited
demo%

Example: Set the main stack size to 64 Megabytes:

demo% limit stacksize 65536

Example: Set each thread stack size to 8 Megabytes:

demo% setenv STACKSIZE 8192

For further information of the use of -stackvar with parallelization, see the Parallelization chapter in the Fortran Programmer's Guide. See csh(1) for details on the limit command.


-stop_status=yn

Permit STOP statement to return an integer status value.

   SPARC:77 PPC:77 Intel:77

yn is either yes or no. The default is no.

With -stop_status=yes, a STOP statement may contain an integer constant. That value will be passed to the environment as the program terminates:

STOP 123

The value must be in the range 0 to 255. Larger values are truncated and a run-time message issued. Note that

STOP `stop string'

is still accepted and returns a status value of 0 to the environment, although a compiler warning message will be issued.

The environment status variable is $status for the C shell csh, and $? for the Bourne and Korn shells, sh and ksh.


-temp=dir

Define directory for temporary files.

   SPARC: 77/90 PPC:77 Intel:77

Set directory for temporary files used by the compiler to be dir. No space is allowed within this option string. Without this option, the files are placed in the /tmp directory.


-time

Time each compilation phase.

   SPARC: 77/90 PPC:77 Intel:77

The time spent and resources used in each compiler pass is displayed.


-U

Recognize upper and lower case in source files.

   SPARC:77 PPC:77 Intel:77

Do not treat uppercase letters as equivalent to lowercase. The default is to treat uppercase as lowercase except within character-string constants. With this option, the compiler treats Delta, DELTA, and delta as different symbols.

Portability and mixing Fortran with other languages may require use of -U. These are discussed in the Fortran Programmer's Guide. (Note that f90 does not have this option, always treating upper and lower case as equivalent.)


-u

Report undeclared variables.

   SPARC:77 PPC:77 Intel:77

Make the default type for all variables be undeclared rather than using Fortran implicit typing. This option warns of undeclared variables, and does not override any IMPLICIT statements or explicit type statements.


-unroll=n

Enable unrolling of DO loops where possible.

   SPARC:77 PPC:77 Intel:77

n is a positive integer. The choices are:

Loop unrolling generally improves performance, but will increase the size of the executable file. For more information on this and other compiler optimizations, see the Performance and Optimization chapter in the Fortran Programmer's Guide. See also the discussion of the UNROLL directive on page 16.


-V

Show name and version of each compiler pass.

   SPARC: 77/90 PPC:77 Intel:77

This option prints the name and version of each pass as the compiler executes:

demo% f77 -o scalc -fast -autopar -V scalc.f
f77: WorkShop Compilers 4.2 dev 01 May 1996 FORTRAN 77 4.2
f77pass1: WorkShop Compilers 4.2 dev 01 May 1996 FORTRAN 77 4.2
scalc.f:
 MAIN scalc:
	initial:
	calc1:
	calc2:
	calc3:
iropt: WorkShop Compilers 4.2 dev 01 May 1996
cg: WorkShop Compilers 4.2 dev 01 May 1996
ld: Software Generation Utilities (SGU) SunOS/ELF (LK-1.4 (S/I))

This information will be helpful when discussing problems with Sun service engineers.


-v

Verbose mode - show details of each compiler pass.

   SPARC: 77/90 PPC:77 Intel:77

Like -V, shows the name of each pass as the compiler executes, and details the options and environment variables used by the driver.


-vax=v

Specify choice of VMS Fortran extensions enabled.

   SPARC:77 PPC:77 Intel:77

v must be a comma-separated list of at least one suboption. Negatives may be constructed by prefixing each suboption keyword by no% (as in no%logical_name).

The primary options are -vax=align and -vax=misalign.

-vax=align selects all the suboptions without allowing misaligned data. This is the behavior of the -xl option prior to f77 release 3.0.1.

-vax=misalign selects all the suboptions and allows misaligned data. This is the behavior of the -xl option with f77 release 3.0.1 and later.



Table  3-18 -vax= Suboptions

-vax=
Affect
 bslash
Allow backslash (`\') in character constants.
 debug
Allow VMS Fortran `D' debugging statements.
 logical_name
Allow VMS Fortran style logical file names.
 oct_const
Allow double quote character to signify octal constants.
 param
Allow non-standard form of PARAMETER statement.
 rsize
Allow unformatted record size in words rather than bytes.
 struct_align
Align structures as in VMS Fortran.

Table 3-18 lists suboptions that can be individually selected.

%all and %none can also be used to select all or none of these suboptions.

Sub- options accumulate from left to right. For example, to enable all but one feature: -vax=%all,no%rsize

See also -xl and -misalign.


-vpara

Show verbose parallelization messages.

   SPARC:77 PPC: - Intel: -

As the compiler analyzes loops explicitly marked for parallelization with directives, it issues a warning message about certain data dependencies it detects; but the loop will still be parallelized.

Example: -vpara for verbose parallelization warnings:

demo% f77 -explicitpar -vpara any.f
any.f:
 MAIN any:
"any.f", line 11: Warning: the loop may have parallelization 
inhibiting reference

-w

Suppress warning messages.

   SPARC: 77/90 PPC:77 Intel:77

This option suppresses most warning messages. However, if one option overrides all or part of an option earlier on the command line, you do get a warning.

Example: -w still allows some warnings to get through:

demo% f77  -w -fast  -silent -O4  any.f
f77: Warning: -O4 overwrites previously set optimization           
level of -O3
demo%

For f90: Individual levels from 0 to 4 can be specified: -w0 suppresses the least messages while -w4 suppresses most warning. -w is equivalent to -w0.


-xa

Synonym for -a.

   SPARC:77 PPC:77 Intel:77

-xarch=a

Specify target architecture instruction set.

   SPARC:77 PPC:77 Intel:77

Target architectures specified by keyword a are:

Table  3-19 -xarch Architecture Keywords

On SPARC:
generic, v7, v8a, v8, v8plus, v8plusa
On PowerPC:
generic, ppc, ppc_nofma
On Intel:
generic, 386, pentium_pro

Although this option can be used alone, it is part of the expansion of the
-xtarget option; it is provided to allow overriding the -xarch value implied by a specific -xtarget option.

This option limits the instructions generated to those of the specified architecture, and allows the specified set of instructions. It does not guarantee that target-specific instructions are used.

If this option is used with optimization, the appropriate choice can provide good performance of the executable on the specified architecture. An inappropriate choice can result in serious degradation of performance.

For SPARC:

SPARC architectures v7, v8, and v8a are all binary compatible. v8plus and v8plusa are binary compatible with each other and forward, but not backward.
For any particular choice, the generated executable may run much more slowly on earlier architectures.
generic: Get good performance on most systems.
This is the default. This option uses the best instruction set for good performance on most processors without major performance degradation on any of them. With each new release, the definition of "best" instruction set may be adjusted, if appropriate.
v7: Limit the instruction set to V7 architecture.
This option uses the best instruction set for good performance on the V7 architecture, but without the quad-precision floating-point instructions.
This is equivalent to using the best instruction set for good performance on the V8 architecture, but without:
- The quad-precision floating-point instructions
- The integer mul and div instructions
- The fsmuld instruction
Examples: SPARCstation 1, SPARCstation 2
v8a: Limit the instruction set to the V8a version of the V8 architecture.
By definition, V8a means the V8 architecture, but without:
- The quad-precision floating-point instructions
- The fsmuld instruction
This option uses the best instruction set for good performance on the V8a architecture.
Example: Any machine based on the MicroSPARC I chip architecture
v8: Limit the instruction set to V8 architecture.
This option uses the best instruction set for good performance on the V8 architecture, but without quad-precision floating-point instructions.
Example: SPARCstation 10
v8plus: Limit instructions to the V8plus version of the V9 architecture.
By definition, V8plus means the V9 architecture, except:
- Without the quad-precision floating-point instructions
- Limited to the 32-bit subset defined by the V8plus specification
- Without the VIS instructions
This option uses the best instruction set for good performance on the V8plus chip architecture. In V8plus, a system with the 64-bit registers of V9 runs in 32-bit addressing mode, but the upper 32 bits of the ix and lx registers must not affect program results.
Example: Any machine based on the UltraSPARC chip architecture
Use of -xarch=v8plus causes the .o file to be marked as a V8+ binary.
Such binaries will not run on a V7 or V8 machine.
v8plusa: Limit the instruction set to the V8plusa architecture variation.
By definition, V8plusa, means the V8plus architecture, plus:
- The UltraSPARC-specific instructions
- The VIS instructions
This option uses the best instruction set for good performance on the UltraSPARCTM architecture, but limited to the 32-bit subset defined by the V8plus specification.
Example: Any machine based on the UltraSPARC chip architecture
Use of -xarch=v8plusa also causes the .o file to be marked as a Sun-specific V8plus binary. Such binaries will not run on a V7 or V8 machine.

For PowerPC:

generic and ppc are equivalent in this release and direct the compiler to produce code for the PowerPC 603 and 604 instruction set.
ppc_nofma is the same as ppc except that the compiler will not issue the "fused multiply-add" instruction.

For Intel:

generic and 386 are equivalent in this release.
pentium_pro directs the compiler to issue instructions for the Intel PentiumPro chip.

-xautopar

Synonym for -autopar.

   SPARC:77 PPC: - Intel: -

-xcache=c

Define cache properties for the optimizer.

   SPARC:77 PPC: - Intel: -

c must be one of the following:

The si/li/ai are defined as follows:

si The size of the data cache at level i, in kilobytes
li The line size of the data cache at level i, in bytes
ai The associativity of the data cache at level i

This option specifies the cache properties that the optimizer can use. It does not guarantee that any particular cache property is used.

Although this option can be used alone, it is part of the expansion of the
-xtarget option; it is provided to allow overriding an -xcache value impled by a specific -xtarget option.



Table  3-20 -xcache Values 

Value
Meaning
generic Define the cache properties for good performance on most SPARC processors without any major performance degradation. This is the default.
s1/l1/a1 Define level 1 cache properties.
s1/l1/a1:s2/l2/a2 Define levels 1 and 2 cache properties.
s1/l1/a1:s2/l2/a2:s3/l3/a3 Define levels 1, 2, and 3 cache properties

Example: -xcache=16/32/4:1024/32/1 specifies the following:

Level 1 cache has:

16K bytes

32 bytes line size

4-way associativity

Level 2 cache has:

1024K bytes

32 bytes line size

Direct mapping associativity


-xcg89

Synonym for -cg89.

   SPARC:77 PPC: - Intel: -

-xcg92

Synonym for -cg92.

   SPARC:77 PPC: - Intel: -

-xchip=c

Specify target processor for the optimizer.

   SPARC:77 PPC:77 Intel:77

This option specifies timing properties by specifying the target processor.

Although this option can be used alone, it is part of the expansion of the
-xtarget option; it is provided to allow overriding a -xchip value implied by the a specific -xtarget option.

Some effects of -xchip=c are:

Table 3-21 lists the valid -xchip values:

Table  3-21 Valid -xchip Values 


Value
Optimize for:
SPARC:
generic good performance on most SPARC processors.
  old pre-SuperSPARCTM processors.
  super the SuperSPARC chip.
  super2 the SuperSPARC II chip.
  micro the MicroSPARCTM chip.
  micro2 the MicroSPARC II chip.
  hyper the HyperSPARCTM chip.
  hyper2 the HyperSPARC II chip.
  powerup the Weitek® PowerUpTM chip.
  ultra the UltraSPARC chip.
PowerPC:
generic good performance on most PowerPC processors
  603 PowerPC 603
  604 PowerPC 604
Intel:
generic good performance on most Intel processors
  386 Intel 386
  486 Intel 486
  pentium Intel Pentium
  pentium_pro Intel Pentium Pro

-xcrossfile

Enable optimization and inlining across source files.

   SPARC:77 PPC: - Intel: -

Normally, the scope of the compiler's analysis is limited to each separate file on the command line. For example, -O4's automatic inlining is limited to subprograms defined and referenced within the same source file.

With -xcrossfile, the compiler analyzes all the files named on the command line as if they had been concatenated into a single source file.

-xcrossfile is only effective when used with -O4 or -O5.

Cross-file inlining creates a possible source file interdependence that would not normally be there. If any file in a set of files compiled together with
-xcrossfile is changed, then all files must be recompiled to insure that the new code is properly inlined. See the discussion of inlining on
page 60.


-xdepend

Synonym for -depend.

   SPARC:77 PPC: - Intel: -

-xexplicitpar

Synonym for -explicitpar.

   SPARC:77 PPC: - Intel: -

-xF

Allow function-level reordering by WorkShop Analyzer.

   SPARC:77 PPC:77 Intel:77

Allow the reordering of functions (subprograms) in the core image using the compiler, the Analyzer and the linker. If you compile with the -xF option, then run the Analyzer, you can generate a map file that optimizes the ordering of the functions in memory depending on how they are used together. A subsequent link to build the executable file can be directed to use that map by using the linker -Mmapfile option. It places each function from the executable file into a separate section.

Reordering the subprograms in memory is useful only when the application text page fault time is consuming a large percentage of the application time. Otherwise, reordering may not improve the overall performance of the application. The Analyzer is part of the Sun WorkShop. See WorkShop: Getting Started and Beyond the Basics for further information on the Analyzer.


-xhelp=h

Show summary help information on options or README file.

   SPARC:77 PPC:77 Intel:77

The h is either readme or flags.

readme: Show the online README file for this release of the compiler.
flags: Show the compiler flags (options).

-xhelp=flags is a synonym for -help.


-xildoff

Turn off the Incremental Linker.

   SPARC: 77/90 PPC: - Intel: -

This forces the use of the standard linker, ld.

This option is the default if you do not use the -g option. It is also the default if you use -G or name any source file on the command line.

Override this default by using the -xildon option.


-xildon

Turn on the Incremental Linker.

   SPARC: 77/90 PPC: - Intel: -

Turn on the Incremental Linker and force the use of ild in incremental mode.

This option is the default if you use -g and do not use -G, and do not name any source file on the command line.

Override this default by using the -xildoff option.

See the Incremental Link Editor guide.


-xinline=f1[,...,fn]

Synonym for -inline=f1[,...,fn].

   SPARC:77 PPC:77 Intel:77

-xl[d]

Enable more VMS Fortran extensions.

   SPARC:77 PPC:77 Intel:77

-xl: Enable the compiler to accept more VMS Fortran extensions. This is a macro that is translated to -vax=misalign, and provides the language features that are listed later in this description. See the description of -vax=, page 83.

Although most VMS features are accepted automatically by f77 without any special options, you must use the -xl option for a few VMS extensions.

In general, you need the -xl option if a source statement can be interpreted as either a VMS feature or an f77 or f90 feature, and you want the VMS feature. In this case, the -xl option forces the compiler to interpret it the VMS way.

The following VMS language features are covered with this option:

Use the -xl to get VMS alignment if your program has some detailed knowledge of how VMS structures are implemented.

-xld: Specifying -xld option causes debugging comments (D or d in column one) to be compiled. Without the -xld option, they remain comments only. No space is allowed between -xl and d.

Programs that need to share structures with C programs should use the default and not -xl.

You may also be interested in -lV77 and the VMS library. See the Fortran Library Reference for information on the VMS libraries.

Read the chapter on VMS language extensions in the Fortran 77 Language Reference for details of the VMS features that you get automatically.


-xlibmil

Synonym for -libmil.

   SPARC:77 PPC:77 Intel:77

-xlibmopt

Use library of optimized math routines.

   SPARC: 77/90 PPC: - Intel: -

Use selected math routines optimized for speed. This option usually generates faster code. It may produce slightly different results; if so, they usually differ in the last bit. The order on the command line for this library option is not significant.


-xlic_lib=libs

Link with the specified Sun licensed libraries.

   SPARC: 77/90 PPC:77 Intel:77

Specifies a comma-separated list of license-controlled libraries to link with. For example:

f77 -o pgx -fast pgx.f -xlic_lib=sunperf 

As with -l, this option should appear on the command line after all source and object file names.


-xlicinfo

Show license server information.

   SPARC: 77/90 PPC:77 Intel:77

Use this option to return license information about the licensing system--in particular, the name of the license server and the user ID for each of the users who have licenses checked out.

Generally, with this option, no compilation takes place, and a license is not checked out. This option is normally used alone with no other options. However, if a conflicting option is used, then the last one on the command line prevails, and there is a warning.

demo% f77 -xlicinfo

    
   License server :	  aardvaark
    sunpro.fortran Version 4.200 expires on : 13-may-1997
    License valid in domain : zoo.furry.COM
   Users of sunpro.fortran Version 4.200 : 
   Total Licenses : 10	    	Licenses Available : 10
Using LM_LICENSE_FILE = ...etc

-Xlist[x]

Produce listings and do global program checking.

   SPARC: 77/90 PPC:77 Intel:77

Use this option to find potential programming bugs. It invokes an extra compiler pass to check for consistency in subprogram call arguments, common blocks, and parameters, across the global program. The option also generates a line-numbered listing of the source code, including a cross reference table. The error messages issued by the -Xlist options are advisory warnings and do not prevent the program from being compiled and linked.


Note - Not all -Xlist suboptions are available with release 1.2 of f90. Full global program checking will be available in a later f90 release.


Example: Check across routines for consistency:

 demo% f77 -Xlist  fil.f

The above example writes the following to the output file fil.lst:

By default, the listings are written to the file name.lst, where name is taken from the first listed source file on the command line.

A number of sub-options provide further flexibility in the selection of actions. These are specified by suffixes to the main -Xlist option, as shown in the following table:

Table  3-22 -Xlist Sub-options

Option
Feature
-Xlist
Show errors, listing, and cross reference table
-Xlistc
Show call graphs and errors
-XlistE
Show errors
-Xlisterr[nnn]
Suppress error nnn messages
-Xlistf
Show errors, listing, and cross references, but no object files
-Xlistflndir
Put .fln files in directory dir, which must already exist
-Xlisth
Terminate compilation if errors detected
-XlistI
Analyze #include and INCLUDE files as well as source files
-XlistL
Show listing and errors only
-Xlistln
Set page length to n lines
-Xlisto name
Rename report file to name.lst
-Xlists
Suppress unreferenced names from the cross-reference table
-Xlistvn
Set checking level to n (1,2,3, or 4) - default is 2
-Xlistw[nnn]
Set width of output line to nnn columns - default is 79
-Xlistwar[nnn]
Suppress warning nnn messages
-XlistX
Show cross-reference table and errors

Options -Xlistc, -Xlistf, -Xlistflndir, -Xlisth, -Xlists, and
-Xlistvn are not available with this release (1.2) of f90.

See the Fortran Programmer's Guide chapter Program Analysis and Debugging for details.


-xloopinfo

Synonym for -loopinfo.

   SPARC:77 PPC: - Intel: -

-xnolib

Synonym for -nolib.

   SPARC: 77/90 PPC:77 Intel:77

-xnolibmil

Synonym for -nolibmil.

   SPARC: 77/90 PPC:77 Intel:77

-xnolibmopt

Do not use fast math library.

   SPARC: 77/90 PPC:77 Intel:77

Use with -fast to override linking the optimized math library:

f77 -fast -xnolibmopt ...

-xO[n]

Synonym for -O[n].

   SPARC: 77/90 PPC:77 Intel:77

-xpad

Synonym for -pad.

   SPARC:77 PPC: - Intel: -

-xparallel

Synonym for -parallel.

   SPARC: 77/90 PPC: - Intel: -

-xpg

Synonym for -pg.

   SPARC: 77/90 PPC:77 Intel:77

-xpp={fpp|cpp}

Select source file preprocessor.

   SPARC: 77/90 PPC:77 Intel:77

The default is -xpp=fpp.

The compilers use fpp(1) to preprocess .F or .F90 source files. This preprocessor is appropriate for Fortran. Previous versions used the standard C preprocessor cpp. To select cpp, specify -xpp=cpp.


-xprofile=p

Collect or optimize with runtime profiling data.

   SPARC:77 PPC: - Intel:77

p must be one of collect[:nm], use[:nm], or tcov. Optimization level must be -O2 or greater.

Only -xprofile=tcov is available on Intel.

collect[:nm] (SPARC)

Collect and save execution frequency data for later use by the optimizer with -xprofile=use. The compiler generates code to measure statement execution frequency.
The nm is the name of the program that is being analyzed. This name is optional. If nm is not specified, a.out is assumed to be the name of the executable.
At runtime a program compiled with -xprofile=collect:nm will create the subdirectory nm.profile to hold the runtime feedback information. Data is written to the file feedback in this subdirectory. If you run the program several times, the execution frequency data accumulates in the feedback file; that is, output from prior runs is not lost.

use[:nm] (SPARC)

Use execution frequency data to optimize strategically.
As with collect:nm, the nm is optional and may be used to specify the name of the program.
The program is optimized by using the execution frequency data previously generated and saved in the feedback files written by a previous execution of the program compiled with -xprofile=collect.
The source files and other compiler options must be exactly the same as used for the compilation that created the compiled program that generated the feedback file. If compiled with -xprofile=collect:nm, the same program name nm must appear in the optimizing compilation:
-xprofile=use:
nm.

tcov (SPARC, Intel)

Basic block coverage analysis using "new" style tcov.
Code instrumentation is similar to that of -a, but .d files are no longer generated for each source file. Instead, a single file is generated, whose name is based on the name of the final executable. For example, if stuff is the executable file, then stuff.profile/tcovd is the data file.
When running tcov, you must pass it the -x option to make it use the new style of data. If not, tcov uses the old .d files, if any, by default for data, and produces unexpected output.
Unlike -a, the TCOVDIR environment variable has no effect at compile-time. However, its value is used at program runtime to identify where to create the profile subdirectory.
See the tcov(1) man page, the Performance Profiling chapter of the Fortran Programmer's Guide, and the Sun Performance Profiling Tools manual for more details.

-xreduction

Synonym for -reduction.

   SPARC: 77/90 PPC: - Intel: -

-xregs=r

Specify register usage.

   SPARC:77 PPC: - Intel: -

r is a comma-separated list that consists of one or more of the following:

[no%]appl, [no%]float.

Where the % is shown, it is a required character.

Example: -xregs=appl,no%float

appl: Allow using the registers g2, g3, and g4.

On SPARC systems, these registers are described as application registers. Using these registers can increase performance because fewer load and store instructions are needed. However, such use can conflict with some old library programs written in assembly code.

no%appl: Do not use the appl registers.

float: Allow using the floating-point registers as specified in the SPARC ABI.

You can use these registers even if the program contains no floating-point code.

no%float: Do not use the floating-point registers.

With this option, a source program cannot contain any floating-point code.

The default is: -xregs=appl,float.


-xs

Allow debugging by dbx without object (.o) files .

   SPARC:77 PPC:77 Intel:77

With -xs, if you move executables to another directory, then you can use dbx and ignore the object (.o) files. Use this option when you cannot keep the .o files.

Without -xs, if you move the executables, you must move both the source files and the object (.o) files, or set the path with either the dbx pathmap or use command.


-xsafe=mem

Assume no memory-based traps.

   SPARC:77 PPC: - Intel: -

Using this option allows the compiler to assume no memory-based traps occur. It grants permission to use the speculative load instruction on V9 machines. It is only effective if -O5 and -xarch=v8plus are also specified.


-xsb

Synonym for -sb.

   SPARC:77 PPC:77 Intel:77

-xsbfast

Synonym for -sbfast.

   SPARC:77 PPC:77 Intel:77

-xspace

Do not allow optimizations to increase code size.

   SPARC:77 PPC: - Intel: -

Do no optimizations that increase the code size.

Example: Do not unroll or parallelize loops if it increases code size.


-xtarget=t

Specify system for optimization.

   SPARC:77 PPC:77 Intel:77

Specify the target system for the instruction set and optimization.

t must be one of: native, generic, system-name.

The -xtarget option permits a quick and easy specification of the -xarch, -xchip, and -xcache combinations that occur on real systems. The only meaning of -xtarget is in its expansion.

The performance of some programs may benefit by providing the compiler with an accurate description of the target computer hardware. When program performance is critical, the proper specification of the target hardware could be very important. This is especially true when running on the newer SPARC processors. However, for most programs and older SPARC processors, the performance gain is negligible and a generic specification is sufficient.

native: Optimize performance for the host system.

The compiler generates code optimized for the host system. It determines the available architecture, chip, and cache properties of the machine on which the compiler is running.

generic: Get the best performance for generic architecture, chip, and cache.

The compiler expands -xtarget=generic to:
-xarch=generic -xchip=generic -xcache=generic
This is the default value.

system-name: Get the best performance for the specified system.

Select a system target name from Table 3-23.

This option is a macro. Each specific value for -xtarget expands into a specific set of values for the -xarch, -xchip, and -xcache options, as shown in Table 3-23. fpversion(1) can be run to determine the target definitions on any system.

For example:

-xtarget=sun4/15 means -xarch=v8a -xchip=micro -xcache=2/16/1


Table  3-23 The -xtarget Expansions  

-xtarget -xarch -xchip -xcache
sun4/15 v8a micro 2/16/1
sun4/20 v7 old 64/16/1
sun4/25 v7 old 64/32/1
sun4/30 v8a micro 2/16/1
sun4/40 v7 old 64/16/1
sun4/50 v7 old 64/32/1
sun4/60 v7 old 64/16/1
sun4/65 v7 old 64/16/1
sun4/75 v7 old 64/32/1
sun4/110 v7 old 2/16/1
sun4/150 v7 old 2/16/1
sun4/260 v7 old 128/16/1
sun4/280 v7 old 128/16/1
sun4/330 v7 old 128/16/1
sun4/370 v7 old 128/16/1
sun4/390 v7 old 128/16/1
sun4/470 v7 old 128/32/1
sun4/490 v7 old 128/32/1
sun4/630 v7 old 64/32/1
sun4/670 v7 old 64/32/1
sun4/690 v7 old 64/32/1
sselc v7 old 64/32/1
ssipc v7 old 64/16/1
ssipx v7 old 64/32/1
sslc v8a micro 2/16/1
sslt v7 old 64/32/1
sslx v8a micro 2/16/1
sslx2 v8a micro2 8/16/1
ssslc v7 old 64/16/1
ss1 v7 old 64/16/1
ss1plus v7 old 64/16/1
ss2 v7 old 64/32/1
ss2p v7 powerup 64/32/1
ss4 v8a micro2 8/16/1
ss4/85 v8a micro2 8/16/1
ss4/110 v8a micro2 8/16/1
ss5 v8a micro2 8/16/1
ss5/85 v8a micro2 8/16/1
ss5/110 v8a micro2 8/16/1
ssvyger v8a micro2 8/16/1
ss10 v8 super 16/32/4
ss10/hs11 v8 hyper 256/64/1
ss10/hs12 v8 hyper 256/64/1
ss10/hs14 v8 hyper 256/64/1
ss10/20 v8 super 16/32/4
ss10/hs21 v8 hyper 256/64/1
ss10/hs22 v8 hyper 256/64/1
ss10/30 v8 super 16/32/4
ss10/40 v8 super 16/32/4
ss10/41 v8 super 16/32/4:1024/32/1
ss10/50 v8 super 16/32/4
ss10/51 v8 super 16/32/4:1024/32/1
ss10/61 v8 super 16/32/4:1024/32/1
ss10/71 v8 super2 16/32/4:1024/32/1
ss10/402 v8 super 16/32/4
ss10/412 v8 super 16/32/4:1024/32/1
ss10/512 v8 super 16/32/4:1024/32/1
ss10/514 v8 super 16/32/4:1024/32/1
ss10/612 v8 super 16/32/4:1024/32/1
ss10/712 v8 super2 16/32/4:1024/32/1
ss20 v8 super 16/32/4:1024/32/1
ss20/hs11 v8 hyper 256/64/1
ss20/hs12 v8 hyper 256/64/1
ss20/hs14 v8 hyper 256/64/1
ss20/hs21 v8 hyper 256/64/1
ss20/hs22 v8 hyper 256/64/1
ss20/50 v8 super 16/32/4
ss20/51 v8 super 16/32/4:1024/32/1
ss20/61 v8 super 16/32/4:1024/32/1
ss20/71 v8 super2 16/32/4:1024/32/1
ss20/151 v8 hyper 512/64/1
ss20/152 v8 hyper 512/64/1
ss20/502 v8 super 16/32/4
ss20/512 v8 super 16/32/4:1024/32/1
ss20/514 v8 super 16/32/4:1024/32/1
ss20/612 v8 super 16/32/4:1024/32/1
ss20/712 v8 super 16/32/4:1024/32/1
ss600/41 v8 super 16/32/4:1024/32/1
ss600/51 v8 super 16/32/4:1024/32/1
ss600/61 v8 super 16/32/4:1024/32/1
ss600/120 v7 old 64/32/1
ss600/140 v7 old 64/32/1
ss600/412 v8 super 16/32/4:1024/32/1
ss600/512 v8 super 16/32/4:1024/32/1
ss600/514 v8 super 16/32/4:1024/32/1
ss600/612 v8 super 16/32/4:1024/32/1
ss1000 v8 super 16/32/4:1024/32/1
sc2000 v8 super 16/32/4:2048/64/1
cs6400 v8 super 16/32/4:2048/64/1
solb5 v7 old 128/32/1
solb6 v8 super 16/32/4:1024/32/1
ultra v8 ultra 16/32/1:512/64/1
ultra2 v8 ultra2 16/32/1:512/64/1
ultra1/140 v8 ultra 16/32/1:512/64/1
ultra1/170 v8 ultra 16/32/1:512/64/1
ultra1/200 v8 ultra 16/32/1:512/64/1
ultra2/1170 v8 ultra 16/32/1:512/64/1
ultra2/1200 v8 ultra 16/32/1:1024/64/1
ultra2/1300 v8 ultra2 16/32/1:2048/64/1
ultra2/2170 v8 ultra 16/32/1:512/64/1
ultra2/2200 v8 ultra 16/32/1:1024/64/1
ultra2/2300 v8 ultra2 16/32/1:2048/64/1
entr2 v8 ultra 16/32/1:512/64/1
entr2/1170 v8 ultra 16/32/1:512/64/1
entr2/2170 v8 ultra 16/32/1:512/64/1
entr2/1200 v8 ultra 16/32/1:512/64/1
entr2/2200 v8 ultra 16/32/1:512/64/1
entr150 v8 ultra 16/32/1:512/64/1
entr3000 v8 ultra 16/32/1:512/64/1
entr4000 v8 ultra 16/32/1:512/64/1
entr5000 v8 ultra 16/32/1:512/64/1
entr6000 v8 ultra 16/32/1:512/64/1

For PowerPC: -xtarget= accepts generic or native.

For Intel: -xtarget= accepts:


-xtime

Synonym for -time.

   SPARC: 77/90 PPC:77 Intel:77

-xtypemap=spec

Specify default data mappings.

   SPARC:77 PPC:77 Intel:77

This option provides a flexible way to specify the byte sizes for default data types. Compare with -dbl and -r8.

The syntax of the specification string spec is:

type:size,type:size,...

The allowable data types are real, double, integer.

The accepted data sizes are 64, 128, and mixed.

This option applies to all variables declared with default specifications (without explicit byte sizes), as in REAL XYZ.

The allowable combinations on each platform are:

Table  3-24 Allowed -xtypemap= mappings

SPARC
PowerPC
Intel
real:64
real:64
real:64
double:64
double:64
double:64
double:128
double:128
-
integer:64
integer:64
integer:64
integer:mixed
integer:mixed
integer:mixed

The mapping integer:mixed indicates 8 byte integers but only 4 byte arithmetic.

The -dbl and -r8 options have their -xtypemap equivalents:

On SPARC and PowerPC:
-dbl same as: -xtypemap=real:64,double:128,integer:64
-r8 same as: -xtypemap=real:64,double:128,integer:mixed
On Intel:
-dbl same as: -xtypemap=real:64,double:64,integer:64
-r8 same as: -xtypemap=real:64,double:64,integer:mixed

There are two additional possibilities on SPARC and PowerPC:

-xtypemap=real:64,double:64,integer:mixed
-xtypemap=real:64,double:64,integer:64

which map both default REAL and DOUBLE to 8 bytes.

Note that INTEGER and LOGICAL are treated the same, and COMPLEX is mapped as two REALs. Also, DOUBLE COMPLEX will be treated the way DOUBLE is mapped.


-xunroll=n

Synonym for -unroll=n.

   SPARC:77 PPC:77 Intel:77

-xvpara

Synonym for -vpara.

   SPARC:77 PPC: - Intel: -

-Zlp

Compile for loop performance profiling by looptool.

   SPARC:77 PPC: - Intel: -

Prepare object files for the loop profiler, looptool. The looptool(1) utility can then be run to generate loop statistics about the program.

If you compile and link in separate steps, and you compile with -Zlp, then be sure to link with -Zlp.

If you compile one subprogram with -Zlp, you need not compile all the subprograms of that program with -Zlp. However, you receive the loop information only for the files compiled with -Zlp, and no indication that the program includes other files.

Refer to WorkShop: Beyond the Basics for more information.


-ztext

Generate only pure libraries with no relocations.

   SPARC:77 PPC: - Intel: -

Do not make the library if relocations remain.

The general purpose of -ztext is verify that a generated library is pure text; instructions are all position-independent code. Therefore, it is generally used with both -G and -pic.

With -ztext, if ld finds an incomplete relocation in the text segment, then it does not build the library. If it finds one in the data segment, then it generally builds the library anyway; the data segment is writable.

Without -ztext, ld builds the library, relocations or not.

A typical use is to make a library from both source files and object files, where you do not know if the object files were made with -pic.

Example: Make library from both source and object files:

demo% f77 -G -pic -ztext -o MyLib -hMyLib a.f b.f x.o y.o

An alternate use is to ask if the code is position-independent already: compile without -pic, but ask if it is pure text.

Example: Ask if it is pure text already--even without -pic:

demo% f77 -G -ztext -o MyLib -hMyLib a.f b.f x.o y.o

If you compile with -ztext and ld does not build the library, then you can recompile without -ztext, and ld will build the library. The failure to build with -ztext means that one or more components of the library cannot be shared; however, maybe some of the other components can be shared. This raises questions of performance that are best left to you, the programmer.


-Ztha

Compile for performance profiling with Thread Analyzer.

   SPARC:77 PPC: - Intel: -

Prepare object files for Thread Analyzer. This option inserts calls to a profiling library at all procedure entries and exits. Code compiled with -Ztha links with the library libtha.so. The -Ztha option is usable only with a Sun WorkShop license.

If you compile and link in separate steps, and you compile with -Ztha, then link with -Ztha. All subprograms need not be compiled with -Ztha. However, thread statistics will appear only for the files compiled with the option.

Refer to tha (1) or WorkShop: Beyond the Basics for details.