if %PY_VER%==2.7 (
    set VS=vs2008
    set ICC_ENV_BAT="C:\localdisk\tools\intel\composer_xe_2013_sp1.5.239\bin\compilervars_arch.bat"
) else (
    set VS=vs2015
    set ICC_ENV_BAT="C:\localdisk\tools\intel\parallel_studio_xe_2016.3.059\compilers_and_libraries_2016\windows\bin\compilervars_arch.bat"
)

call %ICC_ENV_BAT% intel64 %VS%
if errorlevel 1 exit 1
set CC=icl
set CFLAGS=/Qstd=c++11 %CFLAGS%
set LD=xilink

set TBBROOT=%PREFIX%
%PYTHON% buildscripts/remove_unwanted_files.py
%PYTHON% setup.py build install --single-version-externally-managed --record=record.txt
if errorlevel 1 exit 1

if "%PY3K%"=="1" (
    del /F /S /Q %SP_DIR%\numpy 2>nul
)
