This Appendix lists the new and changed features in this release and previous releases of the Fortran 95 compiler.
The Fortran 95 compiler, version 8.3, is a component released with Sun Studio 12.
The Fortran compiler is now available on the following Linux (x86 and x64) distibutions: SuSe Linux Enterprise Server 9 with Service Pack 3 (or later), Red Hat Enterprise Linux 4, and other Linux distributions based on the 2.6 kernel (although these are not officially supported).
Use -m64 to create 64-bit executables and shared libraries.
New flags for -xarch replace obsolete flags.
New values for -xtarget and -xchip provide code generation for the UltraSPARC T2 and SPARC64vi processors.
New flag -fma=fused to enable generation of fused multiply-add instructions on processors that support them.
New flag -xhwcprof enables compiler support for dataspace profiling.
New flag -xinstrument to enable performance analysis by the Thread Analyzer
-xregs=frameptr added to -fast on x86.
Support for interval arithmetic on Solaris x86 platform with the -xarch=sse2 and -xia options.
Explicit prefetch directives accepted on x86 platforms as well as SPARC platforms. (—xprefetch=explicit)
Default format for debugging information has changed from the "stabs" standard to the "dwarf" standard format. ( -xdebugformat=dwarf).
New -xmodel option:The new -xmodel option lets you specify the kernel, small, or medium memory models on the 64-bit AMD architecture. If the size of your global and static variables exceeds two gigabytes, specify -xmodel=medium. Otherwise, use the default -xmodel=small setting. See 3.4.150 –xmodel=[small | kernel | medium].
The -xvector option extended for x86 SSE2 platforms:The -xvector option enables automatic generation of calls to the vector library functions and/or the generation of the SIMD (Single Instruction Multiple Data) instructions. This option now offers the expanded syntax on x86 SSE2 platforms. See 3.4.181 –xvector[= [[no%]lib, [no%]simd, %none] ].
STACKSIZE environment variable enhanced:The syntax of the STACKSIZE environment variable has been enhanced to include a units keyword.
-xpagesize options available on x86 platforms:Options -xpagesize, -xpagesize_heap, and -xpagesize_stack are now enabled on x86 platforms as well as SPARC. See 3.4.157 –xpagesize=size.
New UltraSPARC T1 and UltraSPARC IV+ targets enabled:Values for -xarch, -xchip, -xcache, and -xtarget support new UltraSPARC processors. See 3.4.177 –xtarget=t.
Compiling for AMD-64 Processors
This release introduces -xarch=amd64 and -xtarget=opteron for compiling applications to run on 64-bit x86 platforms.
File sharing between big-endian and little-endian platforms
The new compiler flag -xfilebyteorder provides cross-platform support of binary I/O files.
OpenMP available on Solaris OS x86 platforms
With this release of Sun Studio, the OpenMP API for shared-memory parallelism is available on Solaris x86 platforms as well as Solaris SPARC platforms. The same functionality is now enabled on both platforms.
OpenMP option -openmp=stubs no longer supported
An OpenMP "stubs" library is provided for user’s convenience. To compile an OpenMP program that calls OpenMP library functions but ignores the OpenMP pragmas, compile the program with the -openmp option and link the object files with the libompstubs.a library. For example: % f95 omp_ignore.c -lompstubs
Linking with both libompstubs.a and the OpenMP runtime library libmtsk.so is unsupported and may result in unexpected behavior.
Fortran 95 compiler released on x86 Solaris platforms:
This release of Sun Studio makes the Fortran 95 compiler available on Solaris OS x86 platforms. Compile with -xtarget values generic, native, 386, 486, pentium, pentium_pro, pentium3, or pentium4, to generate executables on Solaris x86 platforms. The default on x86 platforms is -xtarget=generic.
The following f95 features are not yet implemented on x86 platforms and are only available on SPARC platforms:
Interval Arithmetic (compiler options -xia and -xinterval)
Quad (128-bit) Arithmetic (for example, REAL*16)
IEEE Intrinsic modules IEEE_EXCEPTIONS, IEEE_ARITHMETIC, and IEEE_FEATURES
The sun_io_handler module
Parallelization options such as -autopar, -parallel, -explitipar, and -openmp.
The following f95 command-line options are only available on x86 platforms and not on SPARC platforms: -fprecision, -fstore, -nofstore
The following f95 command-line options are only available on SPARC platforms and not on x86 platforms: -xcode, -xmemalign, -xprefetch, -xcheck, -xia, -xinterval, -xipo, -xjobs, -xlang, -xlinkopt, -xloopinfo, -xpagesize, -xprofile_ircache, -xreduction, -xvector, -depend, -openmp, -parallel, -autopar, -explicitpar, -vpara, -XlistMP. Also, on x86 platforms -fast adds -nofstore.
Improved Runtime Performance:
Runtime performance for most applications should improve significantly with this release. For best results, compile with high optimization levels -xO4 or -xO5. At these levels the compiler may now inline contained procedures, and those with assumed-shape, allocatable, or pointer arguments.
Fortran 2003 Command-Line Intrinsics:
The Fortran 2003 draft standard introduces three new intrinsics for processing command-line arguments and environment variables. These have been implemented in this release of the f95 compiler. The new intrinsics are:
GET_COMMAND(command, length, status)
Returns in command the entire command line that invoked the program.
GET_COMMAND_ARGUMENT(number, value, length, status)
Returns a command-line argument in value.
GET_ENVIRONMENT_VARIABLE(name, value, length, status, trim_name)
Return the value of an environment variable.
New and Changed Command-Line Options:
The following f95 command-line options are new in this release. See the Chapter 3 for details.
-xipo_archive={ none | readonly | writeback }
Allow crossfile optimization to include archive (.a) libraries. (SPARC only)
-xprefetch_auto_type=[no%]indirect_array_access
Generate indirect prefetches for a data arrays accessed indirectly. (SPARC only)
-xprofile_pathmap=collect_prefix:use_prefix
Set path mapping for profile data files. Use the -xprofile_pathmap option with the -xprofile=use option when profiling into a directory that is not the directory used when previously compiling with -xprofile=collect.
The following command-line option defaults have changed with this release of f95.
The default for -xprefetch is -xprefetch=no%auto,explicit.
The default for -xmemalign is -xmemalign=8i; when compiling with one of the -xarch=v9 options the default is -xmemalign=8f.
The default for -xcode when compiling with one of the -xarch=v9 options is abs44.
To compile with the defaults used in previous compiler releases, specify the following options explicitly:
-xarch=v8 -xmemalign=4s -xprefetch=no for 32-bit compilation -xcode=abs64 -xprefetch=no for 64-bit compilation
Default SPARC Architecture is V8PLUS:
The default SPARC architecture is no longer V7. Support for -xarch=v7 is limited in this Sun Studio 9 release. The new default is V8PLUS (UltraSPARC). Compiling with -xarch=v7 is treated as -xarch=v8 because the Solaris 8 OS only supports -xarch=v8 or better.
To deploy on SPARC V8 systems (for example, SPARCStation 10), compile with -xarch=v8 explicitly. The provided system libraries run on SPARC V8 architectures.
To deploy on SPARC V7 systems (for example, SPARCStation 1), compile with -xarch=v7 explicitly. The provided system libraries use the SPARC V8 instruction set. For the Sun Studio 9 release, only the Solaris 8 OS supports the SPARC V7 architecture. When a SPARC V8 instruction is encountered, the OS interprets the instruction in software. The program will run, but performance will be degraded.
OpenMP: Maximum Number of Threads Increased:
The maximum number of threads for OMP_NUM_THREADS and the multitasking library has increased from 128 to 256.
OpenMP: Automatic Scoping of Variables:
This release of the Fortran 95 compiler’s implementation of the OpenMP API for shared-memory parallel programming features automatic scoping of variables in parallel regions. See the OpenMP API User’s Guide for details. (OpenMP is only implemented on SPARC platforms for this release.)
Enhanced -openmp option:
The -openmp option flag has been enhanced to facilitate debugging OpenMP programs. To use dbx to debug your OpenMP application, compile with
-openmp=noopt -g
You will then be able to use dbx to breakpoint within parallel regions and display contents of variables. .
Multi-process compilation:
Specify -xjobs=n with -xipo and the interprocedural optimizer will invoke at most n code generator instances to compile the files listed on the command line. This option can greatly reduce the build time of large applications on a multi-cpu machine. See 3.4.139 –xjobs=n.
Making assertions with PRAGMA ASSUME:
The ASSUME pragma is a new feature in this release of the compiler. This pragma gives hints to the compiler about conditions the programmer knows are true at some point in a procedure. This may help the compiler to do a better job optimizing the code. The programmer can also use the assertions to check the validity of the program during execution. See 2.3.1.9 The ASSUME Directives, and 3.4.114 –xassume_control[=keywords].
More Fortran 2003 features:
The following features appearing in the Fortran 2003 standard have been implemented in this release of Fortran 95 compiler. These are described in Chapter 4.
Exceptions and IEEE Arithmetic:
New intrinsic modules IEEE_ARITHMETIC, and IEEE_FEATURES provide support for exceptions and IEEE arithmetic in the Fortran language. See 4.6.2 IEEE Floating-Point Exception Handling.
Interoperability with C:
The new draft standard for Fortran provides a means of referencing C language procedures and, conversely, a means of specifying that a Fortran subprogram can be referenced from a C function. It also provides a means of declaring global variables that are linked with external C variables. See 4.6.1 Interoperability with C Functions.
PROTECTED Attribute
The Fortran 95 compiler now accepts the Fortran 2003 PROTECTED attribute. PROTECTED imposes limitations on the usage of module entities. Objects with the PROTECTED attribute are only definable within the module that declares them. 4.6.4 PROTECTED Attribute.
ASYNCHRONOUS I/O Specifier
The compiler recognizes the ASYNCHRONOUS specifier on I/O statements:
ASYNCHRONOUS=[’YES’ | ’NO’]
This syntax is as proposed in the draft standard. See 4.6.5 Fortran 2003 Asynchronous I/O.
Enhanced compatibility with legacy f77:
A number of new features enhance the Fortran 95 compiler’s compatibility with legacy Fortran 77 compiler, f77. These include variable format expressions (VFE’s), long identifiers, -arg=local , and the -vax compiler option. See Chapter 3 and Chapter 4.
I/O error handlers:
Two new functions enable the user to specify their own error handling routine for formatted input on a logical unit. These routines are described in 4.7.1 I/O Error Handling Routines, and in man pages and the Fortran Library Reference.
Unsigned integers:
With this release, the Fortran 95 compiler accepts a new data type, UNSIGNED, as an extension to the language. See 4.5 Unsigned Integers.
Set preferred stack/heap page size:
A new command-line option, -xpagesize, enables the running program to set the preferred stack and heap page size at program startup. See 3.4.157 –xpagesize=size.
Faster and enhanced profiling:
This release introduces the new command-line option -xprofile_ircache= path, to speed up the "use" compilation phase during profile feedback. See 3.4.167 –xprofile_ircache[=path]. See also 3.4.168 –xprofile_pathmap=collect_prefix:use_prefix.
Enhanced "known libraries":
The -xknown_lib option has been enhanced to include more routines from the Basic Linear Algebra library, BLAS. See 3.4.140 –xknown_lib=library_list.
Link-time Optimization:
Compile and link with the new -xlinkopt flag to invoke a post-optimizer to apply a number of advanced performance optimizations on the generated binary object code at link time. See 3.4.146 –xlinkopt[={1|2|0}].
Initialization of local variables:
A new extension to the -xcheck option flag enables special initialization of local variables. Compiling with -xcheck=init_local initializes local variables to a value that is likely to cause an arithmetic exception if it is used before it is assigned by the program. See 3.4.120 –xcheck=keyword
Fortran 77 Functionality Absorbed Into Fortran 95 Compiler
This release of the Forte Developer software replaces the f77 compiler with added functionality in the f95 compiler. The f77 command is a script that calls the f95 compiler:
the command: f77 options files libraries becomes a call to the f95 compiler:: f95 -f77=%all -ftrap=%none options files -lf77compat libraries |
See 4.12 Mixing Languages for details on Fortran 77 compatibilities and incompatibilities.
Fortran 77 Compatibility Mode:
The new -f77 flag selects various compatibility features that enable the compiler to accept many Fortran 77 constructs and conventions that are normally incompatible with Fortran 95. See 3.4.27 –f77[=list], and 4.12 Mixing Languages.
Compiling “Dusty Deck” Programs That Employ Non-Standard Aliasing:
The f95 compiler must assume that programs it compiles adhere to the Fortran 95 standard regarding aliasing of variables through subprogram calls, global variables, pointers, and overindexing. Many “dusty deck” legacy programs intentionally utilized aliasing techniques to get around shortcomings in early versions of the Fortran language. Use the new -xalias flag to advise the compiler about how far the program deviates from the standard and what kind of aliasing syndromes it should expect. In some cases the compiler generates correct code only when the proper -xalias suboption is specified. Programs that conform strictly to the standard will find some performance improvement by advising the compiler to be unconcerned about aliasing. See 3.4.112 –xalias[=keywords], and the chapter on Porting in the Fortran Programming Guide.
Enhanced MODULE Features:
New flag -use=list forces one or more implicit USE statements into each subprogram. See 3.4.104 –use=list.
New flag -moddir=path controls where the compiler writes compiled MODULE subprograms (.mod files). See 3.4.58 –moddir=path. A new environment variable, MODDIR, also controls where .mod files are written.
The -Mpath flag will now accept directory paths, archive (.a) files, or module (.mod) files to search for MODULE subprograms. The compiler determines the type of the file by examining its contents; the actual file name extension is ignored. See 3.4.56 –Mpath.
When searching for modules, the compiler now looks first in the directory where module files are being written.
See 4.9 Module Files for details.
Enhanced Global Program Analysis With -Xlist:
This release of the f95 compiler adds a number of new checks to the global program analysis provided by the -Xlist flag. The new -XlistMP suboption opens a new domain of static program analysis, verification of OpenMP parallelization directives. See 3.4.110 –Xlist[x], the Forte Developer OpenMP API User’s Guide, and the chapter on Program Analysis and Debugging in the Fortran Programming Guide for details.
Identifying Known Libraries With -xknown_lib=library:
A new option, -xknown_lib=library, directs the compiler to treat references to certain known libraries as intrinsics, ignoring any user-supplied versions. This enables the compiler to perform optimizations over library calls based on its special knowledge of the library. In this release, the known library names are limited to blas, for a subset of the BLAS routines in the Sun Performance Library, and intrinsics, for ignoring explicit EXTERNAL declarations for Fortran 95 standard intrinsics and any user-supplied versions of these routines. See 3.4.140 –xknown_lib=library_list.
Ignoring Dummy Argument Type in Interfaces:
A new directive, !$PRAGMA IGNORE_TKR {list_of_variables}, causes the compiler to ignore the type, kind, and rank for the specified dummy argument names appearing in a generic procedure interface when resolving a specific call. Using this directive greatly simplifies writing generic interfaces for wrappers that call specific library routines based on argument type, kind, and rank. See 2.3.1.2 The IGNORE_TKR Directive for details.
Enhanced -C Runtime Array Checking:
In this f95 compiler release, runtime array subscript range checking with the -C option has been enhanced to include array conformance checking. A runtime error is produced when an array syntax statement is executed where the array sections are not conformable. See 3.4.7 –C.
Introducing Fortran 2003 Features:
Some new formatted I/O features proposed for the next Fortran standard have been implemented in this release of f95. These are the DECIMAL=, ROUND=, and IOMSG= specifiers, and they may appear in OPEN, READ, WRITE, PRINT, and INQUIRE statements. Also implemented are the DP, DC, RP, and RC edit descriptors. See 4.6.9 Fortran 2003 Formatted I/O Features for details.
Rounding in Formatted I/O:
A new option flag, -iorounding, sets the default rounding mode for formatted I/O. The modes, processor-defined or compatible, correspond to the ROUND= specifier implemented as part of the Fortran 2003 features. See 3.4.49 –iorounding[={compatible|processor-defined}].
Obsolete Flags Removed:
The following flags have been removed from the f95 command line:
-db -dbl
The following f77 compiler flags have not been implemented in the f95 compiler and are also considered obsolete:
-arg=local -i2 -i4 -misalign -oldldo -r8 -vax-xl -xvpara -xtypemap=integer:mixed
Checking for Stack Overflow:
Compiling with the new -xcheck=stkovf flag adds a runtime check for stack overflow conditions on entry to subprograms. If a stack overflow is detected, a SIGSEGV segment fault is raised. Stack overflows in multithreaded applications with large arrays allocated on the stack can cause silent data corruption in neighboring thread stacks. Compile all routines with -xcheck=stkovf if stack overflow is suspected. See 3.4.120 –xcheck=keyword.
New Default Thread Stack Size:
With this release, the default slave thread stack size has been increased to 4 Megabytes on SPARC V8 platforms, and 8 Megabytes on SPARC V9 platforms. See the discussion of stacks and stack sizes in the Parallelization chapter of the Fortran Programming Guide for details.
Enhanced Interprocedural Optimizations:
With -xipo=1 the compiler does inlining across all source files. This release adds -xipo=2 for enhanced interprocedural aliasing analysis and memory allocation and layout optimizations to imporve cache performance. See 3.4.137 –xipo[={0|1|2}].
Control Prefetch Instructions With -xprefetch_level=n:
Use the new flag -xprefetch_level=n to control the automatic insertion of prefetch instructions with -xprefetch=auto. Use requires an optimization level of -xO3 or greater and a target platform that supports prefetch (-xarch platforms v8plus, v8plusa, v8plusb, v9, v9a, v9b, generic64, or native64). See 3.4.165 -xprefetch_level={1|2|3}.
Feature histories for releases prior to Forte Developer 7 can be found in the documentation sets for those earlier releases on the http://docs.sun.com web site.