Using Other Methods to Set Environment Variables

All OSes:

Depending on your operating system, there are additional ways to set environment variables.

Linux OS and Mac OS X:

Within the C Shell, use the setenv command to set an environment variable:

setenv FORT9 /usr/users/smith/test.dat

To remove the association of an environment variable and its value within the C shell, use the unsetenv command.

unsetenv FORT9

Within the Bourne* shell (sh), the Korn shell (ksh), and the bash shell, use the export command and assignment command to set the environment variable:

export FORT9
FORT9=/usr/users/smith/test.dat

To remove the association of an environment variable and its value within the Bourne* shell, the Korn shell, or the bash shell, use the unset command:

unset FORT9

Windows OS:

Environment variables specifying path, library, and include directories can be defined in the IDE on a per user basis using Tools>Options... from the menu bar.

Note iconNote

If you specify devenv/useenv on the command line to start the IDE, the IDE uses the PATH, INCLUDE, and LIB environment variables defined for that command line when performing a build. It uses these values instead of the values defined using Tool>Options.

For more information on the devenv command, see the devenv description in the Microsoft Visual Studio* documentation.

During installation, the Intel Fortran compiler may modify certain system-wide environment variables, depending on your installation choices. (For more information, see the install.htm file.)

To view or change these environment variable settings, do the following:

On Windows* 2000, Windows NT* 4, or Windows XP* operating systems:


  1. Log into an account with Administrator privilege.

  2. Open the Control panel.

  3. Click System.

  4. On Windows 2000 and Windows XP systems: Click the Advanced tab and then click the Environment Variables button. On Windows NT 4 systems: Click the Environment tab.

  5. View or change the displayed environment variables.

  6. To have any environment variable changes take effect immediately, click Apply.

  7. Click OK.

Note iconNote

Changing system-wide environment variables affects command line builds (those done without IDE involvement), but not builds done through the IDE. IDE builds are managed by the environment variables set in the IDE using Tools>Options. An exception to this is an IDE build (devenv) done from the command line that specifies the /useenv option. In this case, the IDE uses the PATH, INCLUDE, and LIB environment variables defined for that command line.

Copyright © 1996-2010, Intel Corporation. All rights reserved.