Updated 2001/06/06 |
Sun WorkShop[tm] 6 update 2 Fortran 95 Readme |
Contents
- Introduction
- About Sun WorkShop 6 update 2 Fortran 95
- New Features
- Software Corrections
- Problems and Workarounds
- Limitations and Incompatibilities
- Documentation Errata
- Shippable Libraries
A. Introduction
This document contains last-minute information about the release of the Sun WorkShop 6 update 2 Fortran 95 compiler. This document describes the software corrections addressed by this release and lists known problems, limitations, and incompatibilities.
For installation-related and late-breaking information about this release, see the Sun WorkShop 6 update 2 Release Notes. Information in the release notes overrides information in all readme files.
To access the release notes and the full Forte[tm] Developer/Sun WorkShop[tm] documentation set, point your Netscape[tm] Communicator 4.0 or compatible browser to the documentation index (file:/opt/SUNWspro/docs/index.html).
To view the text version of this readme, type the following at a command prompt:
example% f95 -xhelp=readmeTo access the HTML version of this readme, point your Netscape Communicator 4.0 or compatible browser to:file:/opt/SUNWspro/docs/index.htmlNote - If your Sun WorkShop software is not installed in the /opt directory, ask your system administrator for the equivalent path on your system.
B. About Sun WorkShop 6 update 2 Fortran 95
This release of Fortran 95 (f95 and f90) runs on SPARC[tm] processors running Solaris[tm] SPARC Platform Edition versions 2.6, 7 and 8, and is a second update to the Sun WorkShop 6 release.
Note - Fortran on Solaris Intel IA-32 Platforms Discontinued:
Development of the Fortran compilers (f77 and f95) and the Sun Performance Library for the Solaris Intel IA-32 platform has been discontinued. We suggest you contact the Portland Group (http://www.pgroup.com) about their development tools for the Solaris IA-32 platform.
C. New Features
This section describes the new and changed features in this release of Sun WorkShop 6 update 2 Fortran 95. In addition, it lists the new features that were introduced in the Sun WorkShop 6 and Sun WorkShop 6 update 1 releases of the Fortran 95.
See also the What's New in Sun WorkShop 6 update 2, which describes all the new features in Sun WorkShop 6 and its updates. You can access this book by pointing your browser to http://docs.sun.com. Click Search Book Titles Only, and Ignore old editions, and search for "What's New."
- Sun WorkShop 6 update 2 New Features
- Sun WorkShop 6 update 1 New Features
- Sun WorkShop 6 New Features
Sun WorkShop 6 update 2 New Features
The Sun WorkShop 6 update 2 Fortran 95 includes the following new and changed features.
- ALLOCATABLE Attribute Extended
- VALUE Attribute from Fortran 2000
- OpenMP 2.0 Fortran API Supported
- OpenMP Library Interface
- Interprocedural Optimiization (-xipo)
- VAX Fortran Structures
- Stream I/O
- Global Program Checking
- Fortran Library Interface
- New and Changed -xtarget, -xchip Values
- ALLOCATABLE Attribute Extended Recent decisions by the Fortran 95 standards organizations have extended the data entities allowed for the ALLOCATABLE attribute. Previously this attribute was limited to locally stored array variables. It is now allowed on:
- array components of structures
- dummy arrays
- array function results
Allocatable entities remain forbidden in all places where they may be storage-associated (COMMON blocks and EQUIVALENCE statements). Allocatable array components may appear in SEQUENCE types, but objects of such types are then prohibited from COMMON and EQUIVALENCE. See the Fortran User's Guide appendix C.
- VALUE Attribute from Fortran 2000
f95 recognizes the VALUE type declaration attribute. Specifying a subprogram dummy input argument with this attribute indicates that the actual argument is passed "by value". The following example demonstrates the use of the VALUE attribute with a C main program calling a Fortran 95 subprogram with a literal value as an argument:
C code: #include <stdlib.h> int main(int ac, char *av[]) { to_fortran(12); } Fortran code: subroutine to_fortran(i) integer, value :: i print *, i end
See the Fortran User's Guide appendix C.
- OpenMP2.0 Fortran API Supported
f95 now supports the OpenMP 2.0 API specifications for Fortran 95. Enhancements include WORKSHARE, REDUCTION for arrays, THREADPRIVATE for variables, COPYPRIVATE for SINGLE directives.
See http://www.openmp.org/specs for the OpenMP 2.0 specifications. The OpenMP readme (in PDF) summarizes the OpenMP directives. See also the Fortran User's Guide appendix E.
- OpenMP Library Interface
The compiler now provides an include file and an interface module for defining the interfaces to the OpenMP Fortran library routines. Supply either of the following statements in every program unit that references the OpenMP library to insure proper type declarations:
INCLUDE 'omp_lib.h'orUSE omp_lib
See the Fortran User's Guide appendix E.
- Interprocedural Optimization (-xipo)
This new compiler flag performs whole-program optimizations by invoking an interprocedural analysis pass. Unlike -xcrossfile, -xipo will perform optimizations across all object files in the link step, and is not limited to just the source files on the compile command.
-xipo is particularly useful when compiling and linking large multi-file applications. Object files compiled with this flag have analysis information compiled within them that enables interprocedural analysis across source and pre-compiled program files. However, analysis and optimization is limited to the object files compiled with -xipo, and does not extend to object files in libraries.
When compiling and linking are performed in separate steps, -xipo must be specified in both steps to be effective.
Example, in a single compile/link step:
f95 -xipo -xO4 -o prog part1.f part2.f part3.fThe optimizer performs crossfile inlining across all three source files. This is done in the final link step, so the compilation of the source files need not all take place in a single compilation and could be over a number of separate compilations, each specifying -xipo.Example, in separate compile/link steps:
f95 -xipo -xO4 -c part1.f part2.f f95 -xipo -xO4 -c part3.f f95 -xipo -xO4 -o prog part1.o part2.o part3.oThe object files created in the compile steps have additional analysis information compiled within them to permit crossfile optimizations to take place at the link step.A restriction is that libraries, even if compiled with -xipo do not participate in crossfile interprocedural analysis, as shown in this example:
f95 -xipo -xO4 one.f two.f three.f ar -r mylib.a one.o two.o three.o ... f95 -xipo -xO4 -o myprog main.f four.f mylib.aHere interprocedural optimizations will be performed between one.f, two.f and three.f, and between main.f and four.f, but not between main.f or four.f and the routines on mylib.a. (The first compilation may generate warnings about undefined symbols, but the interprocedural optimizations will be performed because it is a compile and link step.)Other important information about -xipo:
- requires at least optimization level -xO4.
- conflicts with -xcrossfile. If used together will result in a compilation error.
- objects compiled without -xipo can be linked freely with objects compiled with -xipo.
In this release crossfile subprogram inlining is the only interprocedural optimization performed by -xipo. See the Fortran User's Guide chapter 3.
- VAX Fortran Structures
To aid migration of programs from f77, f95 accepts VAX Fortran STRUCTURE and UNION statements, a precursor of Fortran 95 "derived types". See the Fortran User's Guide, appendix C.
- Stream I/O
Another feature proposed for Fortran 2000 is a new "stream I/O" scheme, which treats a data file as a continuous sequence of bytes, addressable by a positive integer starting from 1. Enable stream I/O by declaring a file with ACCESS='STREAM'. Position files with READ or WRITE statements with the POS=integer_expression specifier. See the Fortran User's Guide, appendix C.
- Global Program Checking
Invoked by the -Xlist options, GPC on f95 now looks more like f77, and includes suboptions -Xlistc -Xlisth -Xlists -Xlistvn and -Xlistw[n]. See the Fortran User's Guide, chapter 3.
- Fortran Library Interface
f95 recognizes the include file system.inc for declaring the proper data types for the Fortran library. Supply the statement INCLUDE 'system.inc' in every routine that references non-intrinsic Fortran library routines to insure proper typing of return values. See the Fortran Library Reference.
- New and Changed Values for -xchip and -xtarget
The -xchip option now accepts the value ultra2e for specifying the UltraSPARC IIe processor.
Also, the implied -xarch setting for the following -xtarget values has changed from v8 to v8plusa:
- entr2/1170
- entr2/1200
- entr2/2170
- entr2/2200
- entr3000
- entr4000
- entr5000
- entr6000
- ultra
- ultra/140
- ultra/170
- ultra/200
- ultra2
- ultra2/1170
- ultra2/1200
- ultra2/1300
- ultra2/2170
- ultra2/2200
- ultra2/2300
- ultra2e
- ultra2i
- ultra3
Sun WorkShop 6 update 1 New Features
Sun WorkShop 6 update 1 Fortran 95 included the following new and changed features.
- UltraSPARC[tm] III Support
- Support for int2
- Mixed-Language Linking with -xlang
- Prefetch added to -fast
- UltraSPARC III Support
The -xtarget and -xchip options now accept ultra3, and the compiler will generate optimized code for the UltraSPARC III processor. Compile with the following flags when compiling and running on an UltraSPARC III platform: -fast -xcrossfile
The -fast option automatically selects the proper options when running on an UltraSPARC III platform.
For cross-compilation (compiling on a platform other than UltraSPARC III but generating binaries intended to run on an UltraSPARC III processor) , add:
-xtarget=ultra3 -xarch={v8plusb|v9b}
(Use -xarch=v9b to compile for 64-bit code generation.)
Note that programs compiled specifically for the UltraSPARC III platform with -xarch={v8plusb|v9b} will not operate on platforms other than UltraSPARC III. Use -xarch={v8plusa/v9a} to compile programs to run compatibly on UltraSPARC I, II, and III.
Performance profiling, -xprofile={collect:|use:}, is particularly useful on the UltraSPARC III platform by enabling the compiler to identify the most frequently executed sections of code and perform localized optimizations to best advantage.
- Support for the int2 Intrinsic:
The Fortran 95 (and Fortran 77) compilers now support the int2 intrinsic for conversion of data types to 2-byte integer. Use of int2 as an intrinsic ( M=int2(J) ) appears in many legacy Fortran 77 codes, and is implemented in the Fortran 95 compiler for compatibility. int is the preferred Fortran 95 standard intrinsic ( M=int(J,2)).
- Mixed-Language Linking with -xlang:
The new -xlang option provides an easy way to link object files and libraries compiled by f77 with f95 object files. The proper runtime environment is insured when using -xlang.
% f95 -o myprog -xlang=f77 myprog.o myf77sub.o
When linking C++ and Fortran 95 and/or Fortran 77 object files, link with the C++ compiler and specify -xlang=f95. (See the C++ man page CC(1) for details.)- Prefetch added to -fast:
The -xprefetch flag has been added to the -fast option set. -fast automatically sets a number of optimization flags for best execution speed on the compiling platform. Adding -xprefetch takes advantage of the UltraSPARC II and III prefetch mechanism, and can add a substantial performance gain in code with loops that process data.
Sun WorkShop 6 New Features
The Sun WorkShop 6 Fortran 95 included the following new and changed features.
- Compliance
- New Command
- File Extensions
- Debugging Optimized Code
- F77 Flags
- New Flags
- OpenMP
- Interval Arithmetic Extensions
- FORM="BINARY" I/O Extension
- Cray-Style Parallelization Directives
- Enhanced Array Optimizations
- Sun WorkShop Online Help
- Compliance:
The Fortran 95 compiler is fully compliant with the Fortran 95 standard.
- New Command:
The Fortran 95 compiler is invoked by both the f90 and f95 command. The f95 command is new. f90 is equivalent to f95.
- File Extensions:
The compiler will accept source files with .f95 and .F95 extensions as well as .f90 and .F90
- Debugging Optimized Code:
The restrictions on compiling with -g have been relaxed so that it is now possible to compile at -O4 and -O5 and/or any of the parallelization flags (-parallel, -explicitpar, -autopar) with debugging (-g).
- F77 Flags:
Most of the Fortran 77 compiler, f77, compiler flags are now implemented in f95/f90. See the f95 man page for details. These include:
- -erroff turn off selected error messages
- -errtags display error messages with tags
- -ext_names create external names with/without underscores
- -fpp specify source code preprocessor
- -loopinfo show which loops parallelized
- -sbfast produce browser table information
- -silent suppress compiler messages
- -U allow lower and upper case
- -u imply IMPLICIT NONE
- -xcrossfile enable optimization across files
- -xF allow function-level reordering for Analyzer
- -xinline compile functions inline
- -xtypemap specify default data sizes
- -xprefetch allows automatic and explicit generation of prefetch instructions on UltraSPARC platforms (-xprefetch=explicit enables new $PRAGMA SPARC_PREFETCH directives).
- New Flags:
The following new flags are implemented in f95/f90:
- -aligncommon align common block elements to specified byte boundaries
- -mp=openmp accept OpenMP directives
- -openmp macro combination of options for OpenMP parallelization
- -r8const promote single-precision constants to REAL*8
- -xia enable interval arithmetic environment
- -xinterval enable processing of interval arithmetic extensions
- -xmemalign specify general alignment of data elements
- -xrecursive allow recursive calls without RECURSIVE attribute
- OpenMP:
This release of Fortran 95 implements the OpenMP interface for explicit parallelization, including a set of source code directives, run-time library routines, and environment variables. Preliminary documentation describing the OpenMP directives accepted by Fortran 95 appears in the Fortran User's Guide. This information also appears as a PDF file in the READMEs directory, omp_directives.pdf . The OpenMP specifications can be viewed at http://www.openmp.org/ (Parallelization features require a Forte Developer for HPC license.)
- Interval Arithmetic Extensions:
This release of Fortran 95 also implements extensions for interval arithmetic computation. See the Fortran 95 Interval Arithmetic Programming Guide, and the interval arithmetic Readme file.
- FORM="BINARY" I/O Extension:
Specifying this new option in an OPEN(..) statement causes the file to be treated as a sequential binary (unformatted) file with no record marks. This enables data to be written and read as a continuous stream of bytes, and provides compatibility with other vendor systems. It is implemented in both the Fortran 95 (f95/f90) and Fortran 77 (f77) compilers.
Effect of FORM="BINARY" on I/O operations:
- WRITE statement: Data is written to the file in binary, with as many bytes transferred as there is specified in the output list.
- READ statement: Data is read into the variables on the input list, with as many bytes transferred as demanded by the list. Because there are no record marks on the file, there will be no "end-of-record" error detection. The only error detected is end-of-file, or abnormal system errors.
- INQUIRE statement: INQUIRE on a file opened with FORM="BINARY" returns:
FORM="BINARY"
ACCESS="SEQUENTIAL"
SEQUENTIAL="YES"
DIRECT="NO"
FORMATTED="NO"
UNFORMATTED="YES"
RECL= and NEXTREC= are undefined.- BACKSPACE statement: Not allowed - returns an error.
- ENDFILE statement: Truncates file at current position, as usual.
- REWIND statement: Repositions file to beginning of data, as usual.
- Cray-Style Parallelization Directives:
The AUTOSCOPE qualifier has been implemented with Cray-style directives.
- Enhanced Array Optimization:
The compiler performs aggressive array optimizations at levels -O4 and -O5.
- Sun WorkShop online help
now interprets f95 error diagnostics in the Building window. Like C compiler error diagnostics, these f95 error messages have hyperlinks to help pages that explain the diagnostic message.
D. Software Corrections
Many of the problems reported with previous releases of the Fortran 95 compiler have been corrected in this release.
E. Problems and Workarounds
This section discusses the following software bugs that could not be fixed in time for this release. For updates, check Forte Developer Products Hot News , http://www.sun.com/forte/developer/, and the database of freely available software patches on http://access1.sun.com/.
- OpenMP and etime()
- Passing character pointers in derived types
- Internal Error on derived types with SEQUENCE
- The value of SIGN(X,-0.)
- -Xlist not checking sizes
- Unused routines get dbx warnings
- Assigning statement labels in internal subroutines
- Formatted write can occasionally damage data in the heap
- -Xlist gives wrong diagnostics
- DBX "whatis" on Generic Functions
- Explicit Parallelization With OpenMP, Sun, or Cray Directives
- Declaring OpenMP Support Functions
- Misplaced C$PAR Directives Causes Error
- f95 vs. f77 Handling of Direct Access I/O
- Use of TRANSPOSE With MATMUL
- Loops with bounds expressions
- ASSIGNed FORMATs and -xarch=v9
- Parallelization and unlimited stacksize
- Complicated VAX structures
- OpenMP 2.0 Known Problems
- OpenMP and etime():
As documented, the Fortran library function etime(3f) checks the PARALLEL environment variable, but not the OMP_NUM_THREADS variable. This can give surprising results to OpenMP users who set the OMP_NUM_THREADS environment variable only. Run OpenMP programs with both PARALLEL and OMP_NUM_THREADS environment variables set to the same value. (4432799)
- Passing character pointers in derived types:
The compiler may pass the wrong length when the argument to a subprogram is a character pointer that is a component of a derived type:
type generic_type character*30, pointer :: name(:) end type generic_type type (generic_type) generic allocate(generic%name(10)) call sub(generic%name)(4434212)
- Internal Error on derived types with SEQUENCE:
Some correct codes containing derived types with a SEQUENCE statement cause an Internal Error diagnostic when compiled with certain options. Try removing the SEQUENCE statement or compiling with different options. (4448683)
- The value of SIGN(X,-0.):
The intrinsic function SIGN gives the wrong value (for Fortran 95) when the second argument is a negative zero. The F95 standard now requires that a negative result be returned in this case, whereas the F90 standard required a positive result. (4436909)
- -Xlist not checking sizes:
-Xlist does not check for common blocks and records that are too large for the compiler. (4441297)
- Unused routines get dbx warnings:
When a routine appears in an interface but is not used, the debugger incorrectly warns that it can't find the function symbol:
interface bar subroutine never_used() end subroutine never_used end interface bar print *, 'hello world' end (dbx) dbx: warning: Can't find function symbol for 'never_used_' :A workaround is simply to ignore the warnings. (4429931)
- Assigning statement labels in internal subroutines:
When an internal subroutine assigns a FORMAT statement label to an integer that is local to the containing program, and an attempt is made to use the variable in a different internal subroutine, the program may fail at runtime with a segmentation fault. The recommendation is to rewrite codes in strict compliance with section 9.4.1.1 in the Fortran 95 standard, requiring that a FORMAT statement appear in the same scoping unit as the statement referencing the FORMAT specifier. (4439038)
- Formatted write can occasionally damage data in the heap:
Under some rare circumstances, a formatted write can damage data in the heap:
pointer (pa, a) open(10, file="data") i = 0 write (10, 10) i, real(i), cmplx(i) pa = malloc(4) a = 12.0 print *, a, pa do i = 1, 250 write (10, 10) i, real(i), cmplx(i) call flush(10) print *,i, a, pa enddo 10 format(i5, 3f20.2) print *, a, pa endWorkaround is to avoid the combination of Cray pointers, formatted write, and explicit call to flush(). (4446899)
- -Xlist gives wrong diagnostics:
-Xlist produces wrong diagnostics when an array section is used as an actual argument. Here's an example:
subroutine sub(A) integer A(:) end interface subroutine sub(A) integer A(:) end subroutine sub end interface integer B(10) call sub(B(2:3)) endThe code is perfectly legal, but an incorrect -Xlist diagnostic appears in the listing file:12 call sub(B(2:3)) ^ **** ERR #323: argument #1 is expression, but dummy argument is array(4431479)
- DBX "whatis" on Generic Functions:
The dbx whatis command on generic functions does not give information on the specific functions. (4347207)
- Explicit Parallelization With OpenMP, Sun, or Cray Directives:
Calling a contained subprogram from within a parallel region does not function correctly. Here is a simple example demonstrating this situation, using OpenMP directives:
program main call sub end program main subroutine sub real a(100), s, t1, t2 integer i do i = 1,100 a(i) = i enddo s = 32 t1 = 1 t2 = 3 !$omp parallel shared(a) private(s) call sub1(a, s) !$omp end parallel print *,' a = ', a contains subroutine sub1(b, t3) real b(:), t3 integer i integer omp_get_thread_num !$omp do do i = 1,size(b) b(i) = omp_get_thread_num() + t3 enddo !$omp end do print *,omp_get_thread_num(),'t1 = ', t1, ' t2 = ', t2, & 't3 = ', t3, ' s = ', s !$omp critical t1 = t1+1 !$omp end critical end subroutine sub1 end subroutine subHere sub1 is a procedure contained in subroutine sub, and called within a parallel region in sub. Although this is perfectly legal Fortran 95, currently the compiler emits the following error message"ERROR: A call to an internal procedure is illegal within a parallel region."(4306893)
- Declaring OpenMP Support Functions:
Certain standard OpenMP support functions were treated incorrectly in the Sun WorkShop 6 compiler release as intrinsics. This bug has been fixed in the Sun WorkShop 6 update 1 and update 2 releases. However, this might mean that some codes that were incorrectly written but ran using the previous compiler could stop working with this release. (Recall that intrinsic functions need not be explicitly typed.) With this release of the f95 compiler, explicit declarations of the OpenMP external functions are required.
The include file omp_lib.h, and interface module omp_lib are provided to insure these external declarations are made correctly. See the Fortran User's Guide, appendix E, for details.
- Misplaced C$PAR Directives Causes Error:
In some cases a fixed-format C$PAR directive placed a few lines above a DO loop can cause an internal compiler error. Place the directive immediately above the DO loop to which it applies.
- f95 vs. f77 Handling of Direct Access I/O:
There is a difference between the way f77 and f95 handle record overflow writing direct access files. The f77 compiler will overwrite records following the record directly addressed. However, the f95 compiler will generate a runtime Error 1010 - record too long. This means that a common practice used in some f77 programs to open a file for direct access with RECL=1 and treating it as a binary file (an unformatted file with no explicit record structure) does not work with f95. The suggested workaround to achieve this is to open the file as a sequential file with FORM=BINARY. (4367635)
- Use of TRANSPOSE With MATMUL:
With optimization levels -O3 or higher, use of the TRANSPOSE intrinsic as an argument to a MATMUL instrinsic call may cause incorrect results if the argument to TRANSPOSE is an array, or array expression, whose first dimension is not the same size as its second dimension. (4459066).
- Loops with bounds expressions:
Sometimes f95 may fail to compile a small DO loop containing only assignment statements where the loop bounds are expressions that could overlap the left-hand side of the statements in the loop. For example
SUBROUTINE sub(a,b) INTEGER a(0:10000,0:2000),b(0:2000) INTEGER i,nr DO nr=1,m DO i=b(0)+1,b(0)+a(0,nr) b(i)=a(i,nr) ENDDO b(0)=b(0)+a(0,nr) ENDDO RETURN ENDA workaround is to compile at optimization -O2 or lower, or rewrite the DO loop by using temporary variables as the loop bounds. (4461100).- ASSIGNed FORMATs and -xarch=v9:
The following program involving ASSIGNED FORMATs does not run if compiled with -xarch=v9 -xO2. The program is not standard conforming because a format is assigned in the main program but the assigned format is used in an internal subroutine. But this fact is not diagnosed. (In Forte Developer 6 update 1 it did not compile.)
program IDATATR assign 40 to IFMT call sub1 40 format(4(e30.20)) contains subroutine sub1 assign 40 to IFMT call sub5 40 format(4(e60.50)) end subroutine sub1 subroutine sub5 write(unit=6, fmt = IFMT) 5.6 stop end subroutine sub5 end program IDATATR(4439038).- Parallelization and unlimited stacksize:
There have been reports that some parallel programs perform better when stacksize is not unlimited. That is,
% limit stacksize unlimitedmay not work as well as% limit stacksize 8196These reports were not fully investigated at "press time", and you should want to check the release notes to see if there is any further information. (4463458).- Complicated VAX structures:
Vax structures is a new feature in the f95 compiler. However, some complicated nested Vax structures can confuse the compiler. For example, compiling
STRUCTURE /STR3/ STRUCTURE R STRUCTURE Z REAL*8 X END STRUCTURE END STRUCTURE END STRUCTURE ENDproduces the internal compiler error messageAssertion failed: type == Integer, file ../srcfw/FWio.c, line 1940(4465612).- OpenMP 2.0 Known Problems
The following are known problems with Fortran 95 OpenMP 2.0 in this release of Forte Developer 6 / Sun WorkShop 6 update 2:
- Allocatable, dynamic array in copyprivate clause.
An allocatable, dynamic array in subroutine that appears in a copyprivate clause causes program to fail at runtime.
Example code: subroutine sub(n) integer n real, dimension(:), allocatable :: a allocate (a(n)) !$omp single a = 22 !$omp end single copyprivate (a) print *, loc(a), a deallocate (a) end subroutine sub program main !$omp parallel call sub (10) !$omp end parallel endcopyprivate(a) in the above example should broadcast all elements of the array a (belonging to the thread that executes single) to other copies of a.
Currently such an example fails at runtime with incorrect results or a segmentation fault. (4417729)
- Assumed-shape arrays:
Assumed-shape arrays cannot be declared PRIVATE, FIRSTPRIVATE, LASTPRIVATE, or COPYPRIVATE. If an assumed-shape array is declared PRIVATE, FIRSTPRIVATE, or LASTPRIVATE, the compiler issues an error message. If an assumed shape array is declared COPYPRIVATE, the program produces incorrect results at runtime. (4418961)
- WORKSHARE within FORALL:
Use of an array assignment in the body of a WORKSHARE construct contained within a FORALL constuct can lead to incorrect results or segmentation fault at runtime. (4448831)- WORKSHARE within PARALLEL dynamic extent:
A WORKSHARE construct in the dynamic extent (but not the lexical extent) of a PARALLEL construct may fail at runtime if the WORKSHARE construct contains the RESHAPE intrinsic, or involves an array reduction function (such as SUM.) (4433878, 4433331)
- ORDERED parallel DO with negative loop step:
The ORDERED directive might not work correctly if the loop step is negative, as in the following example:PROGRAM P !$OMP PARALLEL DO ORDERED DO I = 3, 1, -1 !$OMP ORDERED PRINT *, I !$OMP END ORDERED END DO END PROGRAM PIncorrect results or an infinite loop might occur. (4458791)
- Nested sections bound to different parallel directives:
The compiler may incorrectly parse nested sections bound to different parallel directives, as in the following example:REAL CX, CY, CZ REAL X(N), Y(N), Z(N) CX = 0.1 CY = 0.2 CZ = 0.3 X = 1 Y = 2 Z = 3 !$OMP PARALLEL !$OMP SECTIONS !$OMP SECTION !$OMP PARALLEL !$OMP SECTIONS !$OMP SECTION X = X + CX !$OMP SECTION Y = Y + CY !$OMP END SECTIONS !$OMP END PARALLEL !$OMP SECTION Z = Z + CZ !$OMP END SECTIONS NOWAIT !$OMP END PARALLEL ENDThe compiler incorrectly issues error messages about the nesting of the PARALLEL and SECTIONS directives. (4458787)
F. Limitations and Incompatibilities
This section discusses the following incompatibilities between the Sun WorkShop 6 update 2 Fortran 95 Compiler and previous releases.
- Linking on SPARC V9 Platforms Under Solaris 7 and 8:
Many static system libraries, such as libm.a and libc.a, are not available in Solaris 7 or 8 environments 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 with Solaris 7 or 8. 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 unexepected 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.
- Incompatibility Issues Between f95 and f77:
The following lists some of the known incompatibility issues that arise when compiling and testing f77 programs with this release of f95. These are due to either missing comparable features in f95, or differences in behavior. These items are non-standard extensions to Fortran 77 supported in f77 but not in f95. (See Appendix C in the Fortran User's Guide).
- I/O
- List-directed output uses different formats.
- Variable format expressions are not available in Fortran 95.
- You cannot open a file with ACCESS='APPEND' in Fortran 95.
- f95 does not allow BACKSPACE or ENDFILE on a direct-access file.
- f95 does not print trailing zeroes after decimal points in formatted output.
- Fortran 95 requires explicit field width specifications in format edit descriptors.
For example, FORMAT(I) is not allowed.- f95 does not recognize f77 escape sequences (for example, \n \t \') in output formats.
- f95 does not recognize FILEOPT= in OPEN statements.
- Tab-formatting in Fortran 95 does not allow source lines to extend beyond column 72.
- f95 does not recognize the 'n form for specifying a record number in direct access I/O: READ(2 '13)X,Y,Z
- Data Types, Declarations, and Usage:
- If it appears in a program unit, the IMPLICIT statement in Fortran 95 must precede the first declarative statement in the unit.
- f95 allows only 7 array subscripts; f77 allows 20.
- LOGICAL and INTEGER variables cannot be used interchangeably in Fortran 95.
- Fortran 95 Cray pointers cannot appear in some intrinsic calls.
- f77-style initializations using slashes on type declarations are not accepted in Fortran 95.
- Fortran 95 does not allow assigning Cray character pointers to non-pointer variables or other Cray pointers that are not character pointers.
- Fortran 95 does not allow the same Cray pointer to point to items of different type sizes (REAL*8 and INTEGER*4 for example).
- Fortran 95 does not accept the BYTE data type.
- Fortran 95 does not allow non-integers to be used as array subscripts.
- f95 does not allow relational operators .EQ. and .NE. to be used with logical operands.
- Programs, Subroutines, Functions, Statements:
- The PROGRAM statement requires a name in Fortran 95.
- The f95 maximum length for names is 31 characters.
- Functions in Fortran 95 cannot be called by a CALL statement, as if they were subroutines.
- Functions in Fortran 95 must have their return value defined.
- f95 does not recognize debugging comments (comment lines with "D" in column one).
- Command-line Options:
- f95 does not recognize -vax compiler options.
G. Documentation Errata
- The -xhasc option is only available in f77. However, the Fortran User's Guide and the f95(1) man page show it to be available with both compilers.
H. 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 in a standard install of Sun WorkShop
You may not 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, viewable from the back of the plastic case containing the CDROM.
Copyright 2001 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303, U.S.A. All rights reserved.
Sun, Sun Microsystems, the Sun logo, docs.sun.com, and Solaris are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries.