Adding Environment Variables

When the Intel compiler and Visual Studio software are installed, sometimes the Environment Variables are not properly added.

1. Detecting the Issue

This issue can sometimes be detected using the Fortran Medic utility:

  • Perform Steps a-d of this article to download, launch and start the Fortran Medic Utility.

    Note - If you have Windows Administrator Privileges on this machine, it is recommended to select "Yes" when the Windows User Account Control displays, in case you need to make any changes to your machine in Step 2 using this Utility.

  • In the Utility results, scroll down and review your Intel or Visual Studio software installations.

    For example: For Visual Studio 2017, the "VS2017INSTALLDIR" path is not set:

    Fortran Medic - VS variable missing.png (45 KB)

    For example: For Intel 19.2, the IFORT_COMPILER21 variable is missing:

    Fortran Medic - Intel variable missing.png (18 KB)

The variable may be added to the environment either automatically by using the Fortran Medic utility (if applicable) (Step 2 below), or manually (Step 3 below).


2. Adding a Variable Automatically Using the Fortran Medic Utility

The following steps show how to automatically add a variable to your environment using the Fortran Medic Utility:

  • Perform Step 1 above to launch, run and start the Fortran Medic utility.

Note when prompted whether to launch the Medic with elevated privileges, select Yes.

  • For a missing Visual Studio Variable:
    • In the Utility, scroll down to the Visual Studio heading, right-click on the "Path not set" error, and select the option to fix this.
      Refer to the following example:
      Fortran Medic - Add VS 2017 Variable.png (203 KB)
    • Log out then log back in on your machine to apply the changes.

  • For a missing Intel Fortran Variable:
    • In the Utility, scroll down to the Intel Fortran heading, right-click on the "Environment Variable does not exist" error, and select the option to fix this.
      Refer to the following example:

      Fortran Medic - Add Intel 19.2 Variable.png (38 KB)

    • Log out then log back in on your machine to apply the changes.


  • Note - to check that this change has been made in the Fortran Medic Utility, rerun the Utility (Select Actions | Start), then scroll back down to the Visual Studio results; the path should now be listed.

    •     For Visual Studio, the path should be listed now, with the message "Folder exists". For example:

          VS2017INSTALLDIR
          C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
          Folder exists

    • For Intel, the path should be listed now, with the the message "Folder exists". For example:

         Environment [Actual]
            IFORT_COMPILER21:C:\Program Files (x86)\Intel\oneAPI\compiler\2022.0.3\windows
            C:\Program Files (x86)\Intel\oneAPI\compiler\2022.0.3\windows
            Folder exists

3. Adding a Variable Manually

The following steps show how to manually add a variable to your environment.

Warning - Be very careful when making changes to your environment, so that you do not disable other software.
It is preferred to use the Fortran Medic utility as per Step 2 above if possible, rather than doing this manually.

  • Obtain the missing variable name and value from this article.

  • Use the following example to add the missing variable:
    Note - This example uses for Visual Studio 2017 Professional Edition.

Adding Environment Variable (VS2017).png (389 KB)

Log out then log back in on your machine to apply the change.

Back