Customizing the Configuration File

The configuration file specifies information that the compiler uses when you invoke it. XL Fortran provides the default configuration file /etc/opt/ibmcmp/xlf/9.1/xlf.cfg at installation time.

If you are running on a single-user system, or if you already have a compilation environment with compilation scripts or makefiles, you may want to leave the default configuration file as it is.

Otherwise, especially if you want many users to be able to choose among several sets of compiler options, you may want to add new named stanzas to the configuration file and to create new commands that are links to existing commands. For example, you could specify something similar to the following to create a link to the xlf95 command:

ln -s /opt/ibmcmp/xlf/9.1/bin/xlf95 /home/lisa/bin/my_xlf95

When you run the compiler under another name, it uses whatever options, libraries, and so on, that are listed in the corresponding stanza.

Notes:

  1. The configuration file contains other named stanzas to which you may want to link.

  2. If you make any changes to the default configuration file and then move or copy your makefiles to another system, you will also need to copy the changed configuration file.

  3. You cannot use tabs as separator characters in the configuration file. If you modify the configuration file, make sure that you use spaces for any indentation.

Attributes

The configuration file contains the following attributes:

use
The named and local stanzas provide the values for attributes. For single-valued attributes, values in the use attribute apply if there is no value in the local, or default, stanza. For comma-separated lists, the values from the use attribute are added to the values from the local stanza. You can only use a single level of the use attribute. Do not specify a use attribute that names a stanza with another use attribute.

crt
When invoked in 32-bit mode, the default (which is the path name of the object file that contains the startup code), passed as the first parameter to the linkage editor.

crt_64
When invoked in 64-bit mode, using -q64 for example, the path name of the object file that contains the startup code, passed as the first parameter to the linkage editor.

mcrt
Same as for crt, but the object file contains profiling code for the -p option.

mcrt_64
Same as for crt_64, but the object file contains profiling code for the -p option.

gcrt
Same as crt, but the object file contains profiling code for the -pg option.

gcrt_64
Same as crt_64, but the object file contains profiling code for the -pg option.

gcc_libs
When invoked in 32-bit mode, the linker options to specify the path to the GCC libraries and to link the GCC library.

gcc_libs_64
When invoked in 64-bit mode, the linker options to specify the path to the GCC libraries and to link the GCC library.

gcc_path
Specifies the path to the 32-bit tool chain.

gcc_path_64
Specifies the path to the 64-bit tool chain.

cpp
The absolute path name of the C preprocessor, which is automatically called for files ending with a specific suffix (usually .F).

xlf
The absolute path name of the main compiler executable file. The compiler commands are driver programs that execute this file.

code
The absolute path name of the optimizing code generator.

xlfopt
Lists names of options that are assumed to be compiler options, for cases where, for example, a compiler option and a linker option use the same letter. The list is a concatenated set of single-letter flags. Any flag that takes an argument is followed by a colon, and the whole list is enclosed by double quotation marks.

as
The absolute path name of the assembler.

asopt
Lists names of options that are assumed to be assembler options for cases where, for example, a compiler option and an assembler option use the same letter. The list is a concatenated set of single-letter flags. Any flag that takes an argument is followed by a colon, and the whole list is enclosed by double quotation marks. You may find it more convenient to set up this attribute than to pass options to the assembler through the -W compiler option.

ld
The absolute path name of the linker.

ldopt
Lists names of options that are assumed to be linker options for cases where, for example, a compiler option and a linker option use the same letter. The list is a concatenated set of single-letter flags. Any flag that takes an argument is followed by a colon, and the whole list is enclosed by double quotation marks.

You may find it more convenient to set up this attribute than to pass options to the linker through the -W compiler option. However, most unrecognized options are passed to the linker anyway.

options
A string of options that are separated by commas. The compiler processes these options as if you entered them on the command line before any other option. This attribute lets you shorten the command line by including commonly used options in one central place.

cppoptions
A string of options that are separated by commas, to be processed by cpp (the C preprocessor) as if you entered them on the command line before any other option. This attribute is needed because some cpp options are usually required to produce output that can be compiled by XL Fortran. The default option is -C, which preserves any C-style comments in the output.

fsuffix
The allowed suffix for Fortran source files. The default is f. The compiler requires that all source files in a single compilation have the same suffix. Therefore, to compile files with other suffixes, such as f95, you must change this attribute in the configuration file or use the -qsuffix compiler option. For more information on -qsuffix, see -qsuffix Option.

cppsuffix
The suffix that indicates a file must be preprocessed by the C preprocessor (cpp) before being compiled by XL Fortran. The default is F.

osuffix
The suffix used to recognize object files that are specified as input files. The default is o.

ssuffix
The suffix used to recognize assembler files that are specified as input files. The default is s.

libraries
-l options, which are separated by commas, that specify the libraries used to link all programs.

smplibraries
Specifies the libraries that are used to link programs that you compiled with the -qsmp compiler option.

hot
Absolute path name of the program that does array language transformations.

ipa
Absolute path name of the program that performs interprocedural optimizations, loop optimizations, and program parallelization.

bolt
Absolute path name of the binder.

defaultmsg
Absolute path name of the default message files.

include
Indicates the search path that is used for compilation include files and module files.

include_32
Indicates the search path that is used for 32-bit compilation include files.

include_64
Indicates the search path that is used for 64-bit compilation include files.
Note:
To specify multiple search paths for compilation include files, separate each path location with a comma as follows:
include = -l/path1, -l/path2, ...

What a Configuration File Looks Like

The following is an example of a configuration file:

xlf95:    use          = DEFLT
          libraries    = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64 = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          gcc_libs     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64  = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options      = -qfree=f90
 
* Alias for standard Fortran compiler
f95:      use          = DEFLT
          libraries    = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64 = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          gcc_libs     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64  = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options      = -qfree=f90
          fsuffix      = f95
 
* Fortran 90 compiler
xlf90:    use          = DEFLT
          libraries    = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64 = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          gcc_libs     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64  = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options      = -qxlf90=noautodealloc:nosignedzero,-qfree=f90
 
* Alias for Fortran 90 compiler
f90:      use          = DEFLT
          libraries    = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64 = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          gcc_libs     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64  = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options      = -qxlf90=noautodealloc:nosignedzero,-qfree=f90
          fsuffix      = f90
 
* Original Fortran compiler
xlf:      use          = DEFLT
          libraries    = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64 = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          gcc_libs     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64  = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options      = -qnozerosize,-qsave,-qalias=intptr,
                         -qposition=appendold,-qxlf90=noautodealloc:nosignedzero,
                         -qxlf77=intarg:intxor:persistent:noleadzero:gedit77:
                          noblankpad:oldboz:softeof
 
* Alias for original Fortran compiler
f77:      use          = DEFLT
          libraries    = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64 = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          gcc_libs     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64  = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options      = -qnozerosize,-qsave,-qalias=intptr,
                         -qposition=appendold,
                         -qxlf90=noautodealloc:nosignedzero,-qxlf77=intarg:
                          intxor:persistent:noleadzero:gedit77:noblankpad:
                          oldboz:softeof
 
* Alias for original Fortran compiler, used for XPG4 compliance
fort77:   use          = DEFLT
          libraries    = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64 = -lxlf90,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          gcc_libs     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64  = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options      = -qnozerosize,-qsave,-qalias=intptr,-qposition=appendold,
                         -qxlf90=noautodealloc:nosignedzero,-qxlf77=intarg:intxor:
                          persistent:noleadzero:gedit77:noblankpad:oldboz:softeof
 
* xlf with links to thread-safe components
xlf_r:    use             = DEFLT
          libraries       = -lxlf90_r,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64    = -lxlf90_r,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          smplibraries    = -lxlf90_r,-lxlopt,-lxlsmp,-lxl,-lxlfmath
          smplibraries_64 = -lxlf90_r,-lxlopt,-lxlsmp,-lxl,-lxlfmath
          gcc_libs        = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options         = -qthreaded,-qnozerosize,-qsave,-qalias=intptr,
                            -qposition=appendold,-qxlf90=noautodealloc:nosignedzero,
                            -qxlf77=intarg:intxor:persistent:noleadzero:gedit77:
                             noblankpad:oldboz:softeof
 
* xlf90 with links to thread-safe components
xlf90_r:  use             = DEFLT
          libraries       = -lxlf90_r,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64    = -lxlf90_r,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          smplibraries    = -lxlf90_r,-lxlopt,-lxlsmp,-lxl,-lxlfmath
          smplibraries_64 = -lxlf90_r,-lxlopt,-lxlsmp,-lxl,-lxlfmath
          gcc_libs        = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options         = -qxlf90=noautodealloc:nosignedzero,-qfree=f90,
                            -qthreaded
 
* xlf95 with links to thread-safe components
xlf95_r:  use             = DEFLT
          libraries       = -lxlf90_r,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          libraries_64    = -lxlf90_r,-lxlopt,-lxlomp_ser,-lxl,-lxlfmath
          smplibraries    = -lxlf90_r,-lxlopt,-lxlsmp,-lxl,-lxlfmath
          smplibraries_64 = -lxlf90_r,-lxlopt,-lxlsmp,-lxl,-lxlfmath
          gcc_libs        = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          gcc_libs_64     = -ldl,-lrt,-lpthread,-lm,-lc,-lgcc
          options         = -qfree=f90,-qthreaded
 
 
* Common definitions
DEFLT:    xlf            = /opt/ibmcmp/xlf/9.1/exe/xlfentry
          crt            = /usr/lib/crt1.o
          crtp           = /usr/lib/crti.o
          crte           = /usr/lib/crtn.o
          crtbegin       = /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/crtbegin.o
          crtend         = /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/crtend.o
          crtsavres      = /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/crtsavres.o
          mcrt           = /usr/lib/gcrt1.o
          gcrt           = /usr/lib/gcrt1.o
          crt_64         = /usr/lib64/crt1.o
          crtp_64        = /usr/lib64/crti.o
          crte_64        = /usr/lib64/crtn.o
          crtbegin_64    = /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/64/crtbegin.o
          crtend_64      = /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/64/crtend.o
          crtsavres_64   = /usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/64/crtsavres.o
          mcrt_64        = /usr/lib64/gcrt1.o
          gcrt_64        = /usr/lib64/gcrt1.o
          include_32     = -I/opt/ibmcmp/xlf/9.1/include
          include_64     = -I/opt/ibmcmp/xlf/9.1/include64
          dis            = /opt/ibmcmp/xlf/9.1/exe/dis
          code           = /opt/ibmcmp/xlf/9.1/exe/xlfcode
          hot            = /opt/ibmcmp/xlf/9.1/exe/xlfhot
          ipa            = /opt/ibmcmp/xlf/9.1/exe/ipa
          bolt           = /opt/ibmcmp/xlf/9.1/exe/bolt
          defaultmsg     = /opt/ibmcmp/xlf/9.1/msg/en_US
          as             = /usr/bin/as
          as_64          = /usr/bin/as
          ld             = /usr/bin/ld
          ld_64          = /usr/bin/ld
          cppoptions     = -C
          cpp            = /opt/ibmcmp/xlf/9.1/exe/cpp
          dynlib         = -dynamic-linker,/lib/ld.so.1
          dynlib_64      = -dynamic-linker,/lib64/ld64.so.1
          libdirs        = -L/opt/ibmcmp/xlsmp/1.3/lib,-L/opt/ibmcmp/xlf/9.1/lib,
                           -R/opt/ibmcmp/xlsmp/1.3/../../lib,
                           -R/opt/ibmcmp/xlf/9.1/../../lib
          libdirs_64     = -L/opt/ibmcmp/xlsmp/1.3/lib64,-L/opt/ibmcmp/xlf/9.1/lib64,
                           -R/opt/ibmcmp/xlsmp/1.3/../../lib64,
                           -R/opt/ibmcmp/xlf/9.1/../../lib64
          gcc_path       = /usr
          gcc_path_64    = /usr
          gcc_libdirs    = -L/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3,
                           -L/usr/powerpc-suse-linux/lib,
                           -L/usr/lib,-L/lib,
          gcc_libdirs_64 = -L/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/64,
                           -L/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3,
                           -L/usr/powerpc-suse-linux/lib,
                           -L/usr/lib,-L/lib64,
                           -L/usr/lib64
          xlcmp_path     = /opt/ibmcmp/xlf/9.1
          bigdata        = -T/opt/ibmcmp/xlf/9.1/exe/elf32ppclinux.x
          bigdata_shr    = -T/opt/ibmcmp/xlf/9.1/exe/elf32ppclinux_shr.x
          options        = -qnoenablevmx
        modes_configure  = 32_64
        crt2 = NULL
        crt2_64 = NULL
        xlf_path = /opt/ibmcmp/xlf/9.1

XL Fortran provides the library libxlf90_r.so in addition to libxlf90_t.so. The library libxlf90_r.so is a superset of libxlf90_t.so, which is a partial thread-support run-time library. The file xlf.cfg has been set up to link to libxlf90_r.so automatically when you use the xlf90_r, xlf95_r, and xlf_r commands.

Related Information:
You can use the -F Option to select a different configuration file, a specific stanza in the configuration file, or both.
IBM Copyright 2003