Using custom compiler configuration files

The XL Fortran compiler generates a default configuration file /opt/IBM/xlf/15.1.3/etc/xlf.cfg.nn , where nn indicates which OS version the configuration file is for). The configuration file specifies information that the compiler uses when you invoke it.

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

If you want users to be able to choose among several sets of compiler options, you might want to use custom configuration files for specific needs. For example, you might want to enable -qlist by default for compilations using the xlf compiler invocation command. This is to avoid forcing your users to specify this option on the command line for every compilation, because -qnolist is automatically in effect every time the compiler is called with the xlf command.

You have several options for customizing configuration files:
  • You can directly edit the default configuration file. In this case, the customized options will apply for all users for all compilations. The disadvantage of this option is that you will need to reapply your customizations to the new default configuration file that is provided every time you install a compiler update.
  • You can use the default configuration file as the basis of customized copies that you specify at compile time with the -F option. In this case, the custom file overrides the default file on a per-compilation basis.
    Note: This option requires you to reapply your customization after you apply service to the compiler.
  • You can create custom, or user-defined, configuration files that are specified at compile time with the XLF_USR_CONFIG environment variable. In this case, the custom user-defined files complement, rather than override, the default configuration file, and they can be specified on a per-compilation or global basis. The advantage of this option is that you do not need to modify your existing, custom configuration files when a new system configuration file is installed during an update installation. Procedures for creating custom, user-defined configuration files are provided below.


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us