Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

windows powershell support

Gordon__Daniel
Beginner
1,169 Views

Hello,

In order to compile from the command line on Windows, one is instructed to use the special Intel command prompt, which presumably is configured to set path variables, etc..  This works fine, but I prefer to use the powershell.  Is there a way to install a similar shortcut that would start a powershell session with the environment setup for the C++ compiler?  In short, I want to use nmake with icl from the powershell.

Thanks!

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
1,169 Views

(I cannot try this because I do not use PowerShell)

1) Right-Click on the Intel shortcut to the environment (64/32 bit) you wish to use and select Properties.
2) Copy the Target (e.g. C:\Windows\System32\cmd.exe /E:ON /V:ON /K ""C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\bin\ipsxe-comp-vars.bat" intel64 vs2013")
3) Create a batch file, first line is ECHO OFF, second line is the copied Target of 2), 3rd line is optionally CD yourDefaultFolder, 4th line is START thePowerShellProgram.exe optionalSwitchesAndArgsHere
4) Create a shortcut to this batch file on your desktop or in your favorite program launch folder.

Jim Dempsey

0 Kudos
gordon__daniel1
Beginner
1,169 Views

Thanks, it kind of works.  I preferred to have only lines 1 and 2 and invoke this script from the powershell command line.  This does give me access to icl and nmake, but the default Linux style shortcuts got wiped out (such as "ls").  I wonder if there is some statement that clears previous definitions in that Intel script that could be tweaked?

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,169 Views

Have you tried running the

 "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\bin\ipsxe-comp-vars.bat" intel64 vs2013

from within PowerShell?

If that works then create a PowerShell script, and then execute that in the script.

Note, I do not know if the environment changes go away when exiting the script. If so, you could add the icl (icpc) to build your application or run make etc...

Jim Dempsey

0 Kudos
Reply