Updated 2004/12/10 |
Sun Studio 10: Fortran 95 Readme |
Contents
- Introduction
- About Sun Studio 10 Fortran 95
- New and Changed Features
- Software Corrections
- Problems and Workarounds
- Limitations and Incompatibilities
- Documentation Errors
- Required Patches for Fortran 95
- Shippable Libraries
A. Introduction
This document contains information about this release of the Sun[tm] Studio 10 Fortran 95 compiler, f95. This document describes the software corrections, known problems, limitations, and incompatibilities of this release.
Product DocumentationProduct documentation in the Early Access release has not been fully updated. See the combined readme for details and latest information, using the URL link shown above.
Note - If your compiler collection software has not been installed in the default /opt directory, ask your system administrator for the equivalent path on your system.
- Release Notes: Available on the Sun Studio 10 web site at http://developers.sun.com/tools/cc/documentation/ss10_docs/release_notes.html. Information in the release notes updates and extends information in all readme files.
- Compilers and Tools Documentation: Product man pages, HTML versions of readmes, and manuals can be accessed from /installation_directory/SUNWspro/docs/index.html. The default installation directory for Solaris platforms is /opt. If your Sun Studio 10 software is not installed in the default /opt directory, ask your system administrator for the equivalent path on your system. You can access the following documents from the index.html page:
- Fortran User's Guide
- Fortran Programming Guide
- OpenMP API User's Guide
- Math Libraries Readme
- Numerical Computation Guide
- Incremental Link Editor Readme
- Sun Performance Library Readme
- Sun Performance Library Reference Manual
- Sun Performance Library User's Guide for Fortran and C
- IDE Documentation: Online help for all components of the Sun Studio 9 IDE can be accessed from the Help menu in the IDE.
- Developer Resources Portal: For technical articles, code samples, documentation, and a knowledge base, see the developers portal at http://developers.sun.com/prodtech/cc. For additional information, see the Support page on the portal.
B. About Sun Studio 10 Fortran 95
This readme has been updated with information describing new and changed features in this release of Version 8.1 of f95.Version 8.1 of the Fortran 95 compiler f95 is released as a component of Sun Studio 10 for Solaris[tm] platforms, and is available on Solaris Operating System (Solaris OS) versions 8, 9, and 10, on SPARC(R) and x86 platforms.
The previous version of the compiler was version 8.0, released with Sun Studio 9.
C. New and Changed Features
This section describes new and changed features for this release of Fortran 95. For details on any of the compiler options, see the Fortran User's Guide and the f95(1) man page.Changes introduced in Sun Studio 10 Fortran 95 Compiler:
- Compiling for AMD-64 Processors
- File sharing between big-endian and little-endian platforms
- OpenMP available on Solaris OS x86 platforms
- OpenMP option -openmp=stubs no longer supported
- Compiling for AMD-64 Processors
This release introduces -xarch=amd64 and -xtarget=opteron for compiling applications to run on 64-bit x86 platforms. Details are in the combined component readme.- File sharing between big-endian and little-endian platforms
The new compiler flag -xfilebyteorder provides cross-platform support of binary I/O files. Details are in the f95 man page.- 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. Details are in the combined component readme.- 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.New and changed features that appeared in the previous release, Sun Studio 9:
For information about other Sun Studio components, see the What's New manual. You can find this manual as part of the documentation installed with the software, at file:/opt/SUNWspro/docs/index.html . You can also find the What's New manual in the Sun Studio 9 collection at http://docs.sun.com
- f95 on Solaris OS x86 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=genericThe following f95 features are not yet implemented on x86 platforms and are only available on SPARC platforms:
The following f95 command-line options are only available on x86 platforms and not 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 SPARC platforms and not on x86 platforms:
- -fprecision, -fstore, -nofstore
Also, on x86 platforms -fast adds -nofstore
- -xcode, -xmemalign, -xprefetch, -xcheck, -xia, -xinterval, -xipo, -xjobs, -xlang, -xlinkopt, -xloopinfo, -xpagesize, -xprofile_ircache, -xreduction, -xvector, -depend, -openmp, -parallel, -autopar, -explicitpar, -vpara, -XlistMP
More About Compiling for x86 Platforms
- -xtarget x86 Platform Values and Expansions
Two new -xtarget platform values are available for x86.
-xtarget=pentium3 expands to -xarch=sse -xchip=pentium3 -xcache=16/32/4:256/32/4
-xtarget=pentium4 expands to -xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8
- The new -xarch and -xchip values are:
-xchip=pentium3 - optimize for Pentium 3 processor
-xchip=pentium4 - optimize for Pentium 4 processor
-xarch=sse - add the SSE instruction set to the pentium_pro instruction set
-xarch=sse2 - add the SSE2 and SSE instruction sets to the pentium_pro instruction set- -fns is enabled only on pentium3 or pentium4 processors. When -xarch is not sse or sse2, -fns=yes is ignored. Otherwise, for SSE and SSE2 floating-point instructions, -fns=yes implies that underflows will be flushed to zero (FTZ) and that denormalized operands are treated as zero (DAZ). -fns=yes does not affect traditional x86 floating-point instructions.
- SPECIAL x86 NOTE
Programs compiled with -xarch={sse | sse2} to run on Solaris x86 SSE/SSE2 Pentium 4-compatible platforms must be run only on platforms that are SSE/SSE2 enabled. Running such programs on platforms that are not SSE/SSE2-enabled could result in segmentation faults or incorrect results occuring without any explicit warning messages. Patches to the OS and compilers to prevent execution of SSE/SSE2-compiled binaries on platforms not SSE/SSE2-enabled might be made available at a later date.OS releases starting with Solaris 9 4/04 are SSE/SSE2-enabled on Pentium 4-compatible platforms. Earlier versions of Solaris OS are not SSE/SSE2-enabled.
This warning extends also to programs that employ .il inline assembly language functions or __asm() assembler code that utililize SSE/SSE2 instructions.
If you compile and link in separate steps, always link using the compiler and with -xarch={sse | sse2} to ensure that the correct startup routine is linked.
Arithmetic results on x86 may differ from results on SPARC due to the x86 80-byte floating-point registers. To minimize these differences, use the -fstore option or compile with -xarch=sse2 if the hardware supports SSE2.
D. Software Corrections
No information at this time.
E. Problems and Workarounds
This section discusses known software problems in this release and possible workarounds for those problems.Optimization Levels and
-xipo
On x86 platforms, when compiling and linking with-xipo
, all parts of the program must be compiled with the same optimization level.No additional information. Check the Support page on the Compilers and Tools portal, http://developers.sun.com/prodtech/cc/support_index.html for latest information.
OpenMP Issues:
INTERVAL Reduction Variables- Reduction clauses with INTERVAL type variables on SPARC platforms are not supported, and will give incorrect results.
F. Limitations and Incompatibilities
This section discusses limitations and incompatibilities with systems or other software.
- -xlinkopt
The -zcompreloc linker option should not be used when compiling with -xlinkopt. [4825600]
- Format of module information files (.mod)
The format of a module information file (.mod file) changed in recent releases of the compiler. The compiler will process .mod files generated by previous releases without any problems, except for one case:
MODULE NEW USE OLD END MODULEIf module OLD was compiled by a previous release of the f95 compiler and module NEW is compiled by the current release, there could be problems. To avoid these problems, recompile the older module, OLD, with this release of the compiler.Each compiled .mod file has a version number associated with the compiler that generated it. Module files compiled by this release of the compiler have "Version 1.0". You can determine the version number of a compiled .mod file by using the fdumpmod(1) utility. It is worth noting that the previous releases of the f95 compiler introduced incompatibilities that carry forward to this release of the 8.0 compiler and should be noted if you are updating to 8.0 (Sun Studio 9) from f95 earlier releases. The following incompatibilies are worth noting:
- Interval Function Calls
The interface (ABI) for interval function calls was changed in the Forte Developer 7 release, and is not binary compatible with the ABI for Sun WorkShop 6 update 2 and earlier releases. This means that programs and libraries with interval functions must be recompiled with the current f95. In particular, Fortran interval functions called by C++, and C++ interval functions called by Fortran, must be recompiled with the f95 and CC compilers.
- CHARACTER*1 Call-by-Value Interfaces
Fortran 95 version 7.0 introduced an incompatibility with the previous release in the way it passes CHARACTER*1 in subprogram calls designated with a VALUE attribute in interface blocks.
The difference is transparent for correctly written Fortran 95 programs compiled with versions 7.0 or 8.0 f95. This difference becomes an issue when the caller and the called routine are compiled with different compiler releases, or when one or the other is written in C.
Consider this example:
main.f: interface subroutine s(c1,c2) character*1, value :: c1 ! c1 is call-by-value character*2 :: c2 integer I end subroutine end interface call s('A', 'BC') end sub.f: subroutine s(c1,c2) character*1, value :: c1 character*(*) :: c2 print *, 'You passed ',c1,' and ',c2 ENDWith main.f compiled with the previous release of the compiler and sub.f compiled with this release, the program incorrectly produces:You passed A and BThe compiler now passes call-by-value CHARACTER *1 data without a character length parameter. In all other cases, character data is passed with a hidden length parameter generated automatically by the compiler as part of the call. (Note that Fortran 95 restricts call-by-value of CHARACTER data to only CHARACTER*1 .)Similarly, C routines calling or called by Fortran 95 routines that expect call-by-value CHARACTER*1 data must be rewritten to no longer expect a length parameter for those arguments.
Binary Incompatibility with Forte Developer 6 update 2 Object Files Version 7.0 f95 fixed a problem where the -aligncommon flag did not properly align derived types or variables typed with an explicit KIND.
For example, the following program:
character*26 type logical(1) :: l1 = .true. real(16) :: r16 = 1 integer(2) :: i2 = 1 common /A/ l1,r16,i2 print *, '--------------------------------------------' print *, ' Fortran 95 COMMON-block alignment in Bytes ' print *, '--------------------------------------------' type = 'logical(1)' print *, type, loc(l1)-loc(l1) type = 'real(16)' print *, type, loc(r16)-loc(l1) type = 'integer(2)' print *, type, loc(i2)-loc(l1) endwhen compiled with FD6u2 Fortran 95 (version 6.2) with -aligncommon produces the following output:-------------------------------------------- Fortran 95 COMMON-block alignment in Bytes -------------------------------------------- logical(1) 0 real(16) 8 integer(2) 24whereas it should produce (and does, with versions 8.0 and 7.0 f95 compiler)-------------------------------------------- Fortran 95 COMMON-block alignment in Bytes -------------------------------------------- logical(1) 0 real(16) 1 integer(2) 17If you compile with the -aligncommon option you should not mix FD6U2 object files with objects produced by the version 8.0 or 7.0 compiler if the common blocks contain either derived types or variables typed with an explicit kind value. The following general items should also be noted:Linking on SPARC V9 Platforms under OS releases since Solaris 7:
Many static system libraries, such as libm.a and libc.a, are not available in recent Solaris OS releases on SPARC V9 platforms. Only dynamic, shared libraries, libm.so and libc.so, are provided. This means that -Bstatic and -dn compiler options could cause linking errors on SPARC V9 platforms. Applications must use dynamic libraries in these cases.
To explicitly link with a static version of a user library while linking dynamically system libraries, use a command line that looks something like:
f95 -o prog prog.f -Bstatic -lxyz -labc -Bdynamic
This will link with libxyz.a and libabc.a , but all other libraries, including system libraries, will be linked dynamically.
Array Intrinsic Functions Use Global Registers:
The array intrinsic functions ANY, ALL, COUNT, MAXVAL, MINVAL, SUM, PRODUCT, DOT_PRODUCT, and MATMUL are highly tuned for the appropriate SPARC platform architectures. As a result, they use the global registers %g2, %g3, and %g4 as scratch registers.
User code should not assume these registers are available for temporary storage if calls are made to the array intrinsics listed above. Data in these registers will be overwritten when the array intrinsics are called.
F95 Modules in Archive Libraries Not Included In Executable:
The debugger dbx requires all object files used in the compilation to be included in the executable file. Usually, programs satisfy this requirement with no extra work on the part of the user. An exceptional case arises from the use of archives containing modules. If a program uses a module, but does not reference any of the procedures or variables in the module, the resulting object file will not contain references to the symbols defined in the module. The linker only links with a object file from an archive if there is a reference to a symbol defined in the object file. If there is no such reference, the object file will not be included in the executable file. Dbx will give a warning when it tries to find the debugging information associated with the module that was used. It will not be able to provide information about the symbols whose debugging information is missing.
Use the -u linker option to work around this problem. This option takes a symbol as its option argument. It adds that symbol to the set of undefined linker symbols, so it will have to be resolved. The linker symbol associated with a module is normally the module name with all letters in lower case followed by an underscore.
For example, to force the object file containing the module MODULE_1 to be taken from an archive, specify the linker option -u module_1_. If linking using the f95 command, use the -Qoption ld -umodule_1_ on the command line.
Fortran 95 Derived Types and SCCS:
Because of SCCS's use of the percent sign (%) to delimit single-letter ID keywords, users with Fortran 95 programs that define structure components with single-letter names could see unexpected results when maintaining their source code files under SCCS.
This is not necessarily a bug in the compiler, but rather a conflict between the Fortran 95 language and the SCCS source code control system.
It can be avoided by not using single letter names for structure components if you plan to manage your source codes with SCCS, or by retrieving the files with the SCCS get option -k which ignores these keywords, or by placing blanks around the %, as in X % Y % Z .
G. Documentation Errors
No information at this time. Additional information may be made available at http://developers.sun.com/prodtech/cc/
H. Required Patches for Fortran 95
For information about required and optional patches for this release, see the Sun Studio release notes at http://developers.sun.com/tools/cc/documentation/ss10_docs/release_notes.html.
I. Shippable Libraries
If your executable uses a Sun dynamic library listed in the file named below, your license includes the right to redistribute the library to your customer./opt/SUNWspro/READMEs/runtime.libraries
Note - If your software is not installed in the /opt directory, ask your system administrator for the equivalent path on your system.
You cannot redistribute or otherwise disclose the header files, source code, object modules, or static libraries of object modules in any form.
The License to Use appears in the End User Object Code License, which you can view from the back of the plastic case containing the CD-ROM.
Copyright © 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.