2

Intel oneAPI command prompt can be invoked and works fine on my computer (Windows 10), but I want ifort work on Windows Powershell. Is there any way to do it?

Raymond
  • 48
  • 6
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 16 '23 at 18:19
  • Run the batch script setvars.bat that Intel provides in your power shell environment to define the runtime environment: https://www.intel.com/content/www/us/en/docs/oneapi/programming-guide/2023-0/use-the-setvars-script-with-windows.html – Scientist May 16 '23 at 19:34
  • @Scientist - that seems like it should work, but it doesn't. See my answer below for what does work. – Steve Lionel May 19 '23 at 01:05

1 Answers1

1
  1. Open an Intel Fortran command shell prompt (shortcut installed in the Start menu or use call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 vs2022 from a cmd window.
  2. Type powershell
Steve Lionel
  • 6,972
  • 18
  • 31
  • Nice. Intel should likely document oneAPI usage with Powershell, as Microsoft has advocated Powershell as a CMD replacement for quite some time now. – Scientist May 19 '23 at 05:07
  • You can't do that with a CMD shell either - there are numerous environment variables needed to be established, which is what the setvars.bat does (and it calls a MS Visual Studio .bat file). The best you could do for now is to create your own .bat file which invokes the setvars.bat file and then calls powershell, leaving you with the open window. – Steve Lionel May 21 '23 at 23:42
  • It works this way, thank you, but that is not what I was looking for. I want to right click on any location and open Powershell, then type my commands. It needed linker.exe and some .lib files, so I changed System Variables to fix it. It still says cannot open file 'kernel32.lib'. – Raymond May 26 '23 at 16:49