How to Select oneAPI Intel® Fortran Compiler and Compiler Version in Microsoft* Visual Studio

ID 662714
Updated 9/27/2024
Version Latest
Public

author-image

By

Intel® Fortran Compiler IDE Integration into Microsoft Visual Studio (Fortran IDE)

When you install a new version of Intel® Fortran Compiler, the previous version of Intel Fortran Compiler IDE integration is uninstalled from Microsoft Visual Studio. The new version of the Fortran Compiler IDE integration is installed and it supports the current Intel Fortran Compiler version and two or three previous versions. For example, if you currently have Intel oneAPI HPC Toolkit 2025.0.0 installed and later install Intel oneAPI HPC Toolkit 2025.1.0, the 2025.0.0 Intel Fortran IDE integration is removed and the 2025.1.0 Fortran IDE integration is installed. Using the 2025.1 version of HPC Toolkit, you can access the compiler versions   2025.1, 2025.0.0, and 2024.2.1 only, even if you still have older versions, such as 2023, installed. Older versions can be accessed only through oneAPI configured command line interface.

This article shows how to select the Intel® Fortran Compiler version within Visual Studio IDE and CLI.

NOTE: You can choose which version of Microsoft Visual Studio to integrate your new Intel® Fortran Compiler with. During Intel oneAPI Toolkit installation, click Customize at the Select Your Installation Mode step. Follow the on-screen instructions until you see a window with all the Visual Studio versions available on your system checked. Check the desired version of Visual Studio.

 

Selecting Intel® Fortran Compiler Version in Visual Studio IDE

If you have multiple versions of Intel® Fortran Compiler installed, you can select among recent compiler versions in supported Microsoft Visual Studio. Only compiler versions that support that version of Visual Studio can be selected.
For example, if you have installed Intel oneAPI Toolkit 2025.0 and have left Intel oneAPI Toolkit 2024.2 and 2023.4 installed, you can select either the 2025.0 or 2024.2 or 2023.4 compiler in Visual Studio 2022 or 2019. To make this selection, navigate to Tools > Options > Intel Compiler and Libraries > IFX Intel Fortran > Compilers

Note: The compiler version might be different on your system depending on which one you have installed.

Microsoft Visual Studio 2022 Dialog

                         

Switching from IFX (Intel® Fortran Compiler) inside the Visual Studio Solution

For every Fortran project, Intel® Fortran Compiler (IFX) is selected by default in Visual Studio. To use the Intel® Fortran Compiler Classic (IFORT) to build your project right click on the Fortran project you wish to build and select Intel Compiler > IFORT Intel® Fortran Compiler or IFX Intel Fortran Compiler

Note: IFX compiler is available in x64 build configuration only.

Selecting Intel® Fortran Compiler (IFX) Version in Visual Studio CLI

  • Click Start menu button on the taskbar, scroll down to Intel oneAPI 2024 or Intel oneAPI 2025 folder, and expand it
  • Click on Intel oneAPI command prompt for Visual Studio 2022
  • This will open a oneAPI cmd interface and load the latest oneAPI Compiler and other tools installed on the system, thus setting up a oneAPI environment. 

  • In the Intel oneAPI cmd interface window type the following two commands in order to change (in this example) from compiler version 2024.2 to 2025.0
cd C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\env
vars.bat
  • See the output below for example:
C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\env>ifx
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2025.0.0 Build 20240825
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

ifx: command line error: no files specified; for help type "ifx /help"

C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\env>

Related Information