Overview of XL Fortran features

Commonality with other XL compilers
Documentation, online help, and technical support
Hardware and operating system support
Highly configurable compiler
Language standards compliance
Source-code migration and conformance checking
Program optimization
64-bit object capability
Shared memory parallelization
OpenMP directives
Diagnostic listings
Symbolic debugger support

XL Fortran Advanced Edition V10.1 for Linux can be used for large, complex, computationally intensive programs, including interlanguage calls with C and C++ programs. This section discusses the features of the XL Fortran compiler at a high level. It is intended for people who are evaluating XL Fortran and for new users who want to find out more about the product.

Commonality with other XL compilers

XL Fortran, together with XL C and XL C/C++, comprise the family of XL compilers.

The XL compilers are part of a larger family of IBM C, C++, and Fortran compilers that are derived from a common code base that shares compiler function and optimization technologies among a variety of platforms and programming languages, such as AIX, Linux distributions, OS/390, OS/400, z/OS, and z/VM operating systems. The common code base, along with compliance to international programming language standards, helps ensure consistent compiler performance and ease of program portability across multiple operating systems and hardware platforms.

The XL compilers are available for use on AIX and selected Linux distributions.

Documentation, online help, and technical support

This guide provides an overview of XL Fortran and its features. You can also find more extensive product documentation in the following formats:

Hardware and operating system support

XL Fortran Advanced Edition V10.1 for Linux supports several Linux distributions. See the README file and System prerequisites for a complete list of supported distributions and requirements.

The compiler, its libraries, and its generated object programs will run on all POWER3(TM), POWER4(TM), POWER5(TM), POWER5+(TM), PowerPC(R), and PowerPC 970 systems with the required software and disk space.

To take maximum advantage of different hardware configurations, the compiler provides a number of options for performance tuning based on the configuration of the machine used for executing an application.

Highly configurable compiler

XL Fortran offers you a wealth of features to let you tailor the compiler to your own unique compilation requirements.

Compiler invocation commands
XL Fortran provides several different commands that you can use to invoke the compiler, for example, xlf, xlf95, and xlf90. Each invocation command is unique in that it instructs the compiler to tailor compilation output to meet a specific language level specification. Compiler invocation commands are provided to support all standardized Fortran language levels, and many popular language extensions as well.

The compiler also provides corresponding "_r" versions of most invocation commands, for example, xlf_r. These "_r" invocations instruct the compiler to link and bind object files to thread-safe components and libraries, and produce threadsafe object code for compiler-created data and procedures.

For more information about XL Fortran compiler invocation commands, see Compiling with XL Fortran or Compiling XL Fortran programs.

Compiler options
You can control the actions of the compiler through a large set of provided compiler options. Different categories of options help you to debug your applications, optimize and tune application performance, select language levels and extensions for compatibility with programs from other platforms, and do many other common tasks that would otherwise require changing the source code.

XL Fortran lets you specify compiler options through a combination of environment variables, compiler configuration files, command line options, and compiler directive statements embedded in your Fortran program source.

For more information about XL Fortran compiler options, see Compiler-options reference.

Custom compiler configuration files
The installation process creates a default compiler configuration file at /etc/opt/ibmcmp/xlf/10.1/xlf.cfg. This configuration file contains several stanzas that define compiler option default settings.

Your compilation needs may frequently call for specifying compiler option settings other than the defaults settings provided by XL Fortran. If so, XL Fortran provides the xlf_configure utility that you can use to create additional configuration files. You can then modify these files with any text editor to contain your own frequently-used compiler option settings.

See Customizing the configuration file for more information on creating and using custom configuration files.

Language standards compliance

The compiler supports the following programming language specifications for Fortran:

In addition to the standardized language levels, XL Fortran also supports language extensions, including:

See Language standards for more information about Fortran language specifications and extensions.

Source-code migration and conformance checking

XL Fortran helps protect your investment in your existing Fortran source code by providing compiler invocation commands that instruct the compiler to inspect your application for conformance to to a specific language level and warn you if it finds constructs and keywords that do not conform to the specified language level. You can also use the -qlanglvl compiler option to specify a given language level, and the compiler will issue warnings if language elements in your program source do not conform to that language level. Additionally, you can name your source files with common filename extensions such as .f77, .f90, or .f95, then use the generic compiler invocations such as xlf or xlf_r to automatically select the appropriate language-level appropriate to the filename extension.

See -qlanglvl for more information.

Program optimization

XL Fortran provides several compiler options that can help you control the optimization of your programs. With these options, you can:

Optimizing transformations can give your application better overall performance at run time. Fortran provides a portfolio of optimizing transformations tailored to various supported hardware. These transformations can:

Significant performance improvements are possible with relatively little development effort because the compiler is capable of sophisticated program analysis and transformation. Moreover, XL Fortran enables programming models, such as OpenMP, which allow you to write high-performance code.

If possible, you should test and debug your code without optimization before attempting to optimize it.

For more information about optimization techniques, see Optimizing XL compiler applications.

For a summary of optimization-related compiler options, see Options for performance optimization.

64-bit object capability

The XL Fortran compiler's 64-bit object capability addresses increasing demand for larger storage requirements and greater processing power. The Linux operating system provides an environment that allows you to develop and execute programs that exploit 64-bit processors through the use of 64-bit address spaces.

To support larger executables that can be fit within a 64-bit address space, a separate, 64-bit object form is used to meet the requirements of 64-bit executables. The linker binds 64-bit objects to create 64-bit executables. Note that objects that are bound together must all be of the same object format. The following scenarios are not permitted and will fail to load, or execute, or both:

On both 64-bit and 32-bit platforms, 32-bit executables will continue to run as they currently do on a 32-bit platform.

XL Fortran supports 64-bit mode mainly through the use of the -q64 and -qarch compiler options. This combination determines the bit mode and instruction set for the target architecture.

For more information, see Using XL Fortran in a 64-Bit Environment.

Shared memory parallelization

XL Fortran Advanced Edition V10.1 for Linux supports application development for multiprocessor system architectures. You can use any of the following methods to develop your parallelized applications with XL Fortran:

For more information, see Parallel programming with XL Fortran.

OpenMP directives

OpenMP directives are a set of API-based commands supported by XL Fortran and many other IBM and non-IBM C, C++, and Fortran compilers.

You can use OpenMP directives to instruct the compiler how to parallelize a particular loop. The existence of the directives in the source removes the need for the compiler to perform any parallel analysis on the parallel code. OpenMP directives require the presence of Pthread libraries to provide the necessary infrastructure for parallelization.

OpenMP directives address three important issues of parallelizing an application:

  1. Clauses and directives are available for scoping variables. Frequently, variables should not be shared; that is, each processor should have its own copy of the variable.
  2. Work sharing directives specify how the work contained in a parallel region of code should be distributed across the SMP processors.
  3. Directives are available to control synchronization between the processors.

XL Fortran supports the OpenMP API Version 2.5 specification. For more information, see www.openmp.org.

Diagnostic listings

The compiler output listing has optional sections that you can include or omit. For more information about the applicable compiler options and the listing itself, refer to XL Fortran compiler listings.

Symbolic debugger support

You can use gdb or any other symbolic debugger when debugging your programs.