Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28167 Discussions

Setting environment variables on Windows

Petr_Parik
Beginner
600 Views

Hi,

I have installed the newest Intel Fortran Compiler for Windows (oneAPI 2023.2.0), but I can't figure out how to set the environment variables to use ifort from the command line.

In older versions, I just needed to run

"%IFORT_COMPILER12%\bin\compilervars.bat" intel64 

to be able to invoke ifort, but this does not work anymore.

Here is the output of the setvars.bat file:

Microsoft Windows [Version 10.0.19044.3086]
(c) Microsoft Corporation. Všechna práva vyhrazena.

c:\Program Files (x86)\Intel\oneAPI>setvars
:: initializing oneAPI environment...
   Initializing Visual Studio command-line environment...
:: WARNING: Visual Studio was not found in the standard installation location:
   "C:\Program Files\Microsoft Visual Studio\<Year>\<Edition>" or
   "C:\Program Files (x86)\Microsoft Visual Studio\<Year>\<Edition>"
   Set the VS2017INSTALLDIR or VS2019INSTALLDIR or VS2022INSTALLDIR
   environment variable to point to your install location and try again.
   Visual Studio command-line environment was not configured.
:  compiler -- latest
:: WARNING: Visual Studio was not found in the standard installation location:
   "C:\Program Files\Microsoft Visual Studio\<Year>\<Edition>" or
   "C:\Program Files (x86)\Microsoft Visual Studio\<Year>\<Edition>"
   Set the VS2017INSTALLDIR or VS2019INSTALLDIR or VS2022INSTALLDIR
   environment variable to point to your install location and try again.
:  debugger -- latest
:  dpl -- latest
:  mpi -- latest
:  tbb -- latest
:: oneAPI environment initialized ::

I don't need or want to install Visual Studio.

I'd be grateful for any advice.

Best, Petr

Labels (1)
0 Kudos
1 Solution
mecej4
Black Belt
581 Views

The Intel Fortran Compiler relies on the Visual Studio tools (linker, CRT, etc.) to function. Regardless of whether or not you intend to use the Visual Studio IDE, you will need to install the desktop VC++ development package from Microsoft. That is a prerequisite, and setting environment variables is no substitute.

View solution in original post

0 Kudos
5 Replies
mecej4
Black Belt
582 Views

The Intel Fortran Compiler relies on the Visual Studio tools (linker, CRT, etc.) to function. Regardless of whether or not you intend to use the Visual Studio IDE, you will need to install the desktop VC++ development package from Microsoft. That is a prerequisite, and setting environment variables is no substitute.

0 Kudos
Petr_Parik
Beginner
573 Views

I have installed standalone VS Build Tools. It seems to work when I first run "x64 Native Tools Command Prompt for VS 2022" and then from within I run Intel oneAPI setvars.bat .

Thank you.

0 Kudos
Arjen_Markus
Honored Contributor I
570 Views

It should not be necessary to run setvars.bat manually - this is done as part of the "native tools command prompt".

0 Kudos
Arjen_Markus
Honored Contributor I
570 Views

Oh, wait. I was thinking of the command prompt that comes under the Intel Fortran menu.

0 Kudos
Petr_Parik
Beginner
540 Views

So, the environment is still not set up properly, because ifort complains about missing libraries (ifmodintr & ifconsol). In older versions (compilervars.bat), this was set up by the 'intel64' parameter. It does not seem to work now.

EDIT: Solved, it was my mistake overwriting the LIB environment variable.

0 Kudos
Reply