Setting the PATH environment variable to include the path to the compiler invocations

To use IBM® XL Fortran for Linux, V15.1.5 commands without typing the complete path, you can add the location of the compiler invocations to the PATH environment variable.

The command to set the PATH environment variable depends on the shell that you are using.
  • If you are using the Bourne, Korn, or BASH shell, use the following command:
    export PATH=$PATH:installation_path/xlf/15.1.5/bin/
  • If you are using the C shell, use the following command:
    setenv PATH $PATH:installation_path/xlf/15.1.5/bin/
where installation_path is the location where you have installed the compiler packages. By default, this is /opt/ibm/.
Note: To set this variable in the Bourne, Korn, or BASH shell so that it applies to all users, add the command to the file /etc/profile. To set it for a specific user only, add the command to the file .profile in the user's home directory. To set this variable in the C shell so that it applies to all users, add the command to the file /etc/csh.cshrc. To set it for a specific user only, add the command to the file .cshrc in the user's home directory. The environment variable is set each time the user logs in.


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