Get Started on Windows*
Before You Begin
For building applications with full IDE functionality, including debugging and development, you must have a supported version of Microsoft Visual Studio* installed. To build applications using command-line tools only, you must have a supported version of Build Tools for Visual Studio installed. For all versions, Desktop development with C++ support must be selected as part of the Visual Studio or Build Tools installation.
- Refer to Installing Microsoft Visual Studio* for Use with Intel® Compilers for instructions on how to select Desktop development with C++.
- Refer to Intel© Compilers Compatibility with Microsoft Visual Studio* and Xcode* for detailed information about which version of Microsoft Visual Studio to use with the compiler.
You typically do not need to set the environment variables on Windows, as the compiler command-line window sets these variables for you automatically. If you need to set the environment variables, run the environment script as described in the suite-specific Get Started documentation.
The default installation directory (<install_dir>) is C:\Program Files (x86)\Intel\oneAPI.
Option 1: Use the Command Line
The following steps show how to invoke the compiler on Windows. Exact steps may vary depending on which version of Windows is installed.
Step 1: Open a command prompt
- Open the Start menu
- Select Intel oneAPI command prompt under the installed version of Intel oneAPI, for example Intel oneAPI 2023
Step 2: Invoke the compiler
Invoke the compiler using the following syntax:
{ifx|ifort} [option] file1 [file2...] [/link link_options]
For example:
ifx hello.f90
To display all available compiler options, use the following command:
- ifx /help
Refer to Compiler Options for detailed information about available options.
Option 2: Use Microsoft Visual Studio
The following steps show how to invoke the compiler from within Microsoft Visual Studio. Exact steps may vary depending on the version of Microsoft Visual Studio in use.
Step 1: Build a binary
Launch Microsoft Visual Studio
Select File > New > Project
In the New Project window, select a project type under Fortran
(Set Fortran as the language in the Language dropdown)
Select a template and click OK
Select Build > Build Solution
The results of the compilation display in the Output window.
Step 2: Set build configurations
- Right click on Project in Solution Explorer > Properties
- Locate Fortran in the list and expand the heading
- Walk through the available properties to select your configuration
Build a Program From the Command Line
Use the following steps to test your compiler installation and build a program.
- Use a text editor to create a file called hello.f90 with the following contents:
print *, “Hello, world!” end
- From a command prompt, compile hello.f90:
ifx hello.f90
- Now you have an executable called hello, which can be run and will give immediate feedback:
hello
Which outputs:
Hello, world!
Next Steps
- Explore the latest oneAPI Fortran Code Samples.