windowsbatch-fileicc

Invoking Intel compiler from batch file in Windows


I am trying to invoke ICL from a batch file but it seems that setting the environment variables kills any further executions, so for example we will not see "Second line executed" below:

echo First line executed
C:\Windows\SysWOW64\cmd.exe /E:ON /V:ON /K ""C:\Program Files (x86)\Intel\Composer XE 2013\bin\ipsxe-comp-vars.bat" intel64 vs2012"
echo Second line executed
icl myCode.c

There doesn't seem to be any documentation on this; do any of you have success with writing a batch file to invoke icl? A simple example would be awesome. Thanks!


Solution

  • Why are you executing a BAT file from within a spawned command shell from within a CMD file?

    The usual way to call batch files from within batch files is to use 'call', for example 'call ipsxe-comp-vars.bat intel64 vs2012'.