Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Intel Compiler #980

Closed
RoyiAvital opened this issue Oct 3, 2020 · 13 comments
Closed

Add Support for Intel Compiler #980

RoyiAvital opened this issue Oct 3, 2020 · 13 comments

Comments

@RoyiAvital
Copy link

RoyiAvital commented Oct 3, 2020

Add support for Intel Compiler:

  • Windows: icl (C / C++).
    Mostly compatible with MSVC's cl with many added features and flags (Optimization Level, Math Precision Level, OpenMP Flag, Vector Extension Flags).
  • macOS / Linux: icc (C) / icpc (C++).
    Mostly compatible with GCC with many added features and flags (Optimization Level, Math Precision Level, OpenMP Flag, Vector Extension Flags).

Intel Compiler has the best performance in many scenarios.

@waruqi waruqi added this to the v2.3.8 milestone Oct 4, 2020
@waruqi
Copy link
Member

waruqi commented Oct 4, 2020

Supporting the intel compiler is not very troublesome, but I remember it is not free, and I have no intel compiler available for testing on my macOS/windows.

@RoyiAvital
Copy link
Author

RoyiAvital commented Oct 4, 2020

If you point me to the related files I might try.

@waruqi
Copy link
Member

waruqi commented Oct 5, 2020

@RoyiAvital
Copy link
Author

Could you create the files (For now, copy GCC's for POSIX and MSVC for Windows)?
I will then try editing them.

@waruqi
Copy link
Member

waruqi commented Oct 5, 2020

I will create a icc branch and create these files.

@waruqi
Copy link
Member

waruqi commented Oct 5, 2020

You can edit and commit to the icc branch. https://github.com/xmake-io/xmake/tree/icc

Test find_icc/icl.lua

cd one_non_xmake_projectdir (without .xmake cache)
xmake l lib.detect.find_tool icc
xmake l lib.detect.find_tool icl
xmake l lib.detect.find_tool icpc

Test icc toolchain

xmake f --toolchain=icc -c -vD
xmake -r -vD

@RoyiAvital
Copy link
Author

RoyiAvital commented Oct 6, 2020

I don't have any lua experience so I am not sure what to do exactly.
Also I don't see the find file.

This is the Environment Variable in Windows when running the Intel Compiler Environment CMD:


architecture_bits=64
ARCH_PATH=intel64
BIN_DIR=bin64
BIN_ROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\
CLASSPATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\daal\lib\daal.jar;
CLIENTNAME=DESKTOP-6E0B1L3
clink_architecture=x64
CPATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\ipp\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\pstl\bin\..\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\pstl\bin\..\stdlib;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\daal\include;
C_TARGET_ARCH=intel64
DAALROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\daal
debug_output=0
depth=1
DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\
DriverData=C:\Windows\System32\Drivers\DriverData
ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
FPS_BROWSER_USER_PROFILE_STRING=Default
Framework40Version=v4.0
FrameworkDir=C:\Windows\Microsoft.NET\Framework64\
FrameworkDir32=C:\Windows\Microsoft.NET\Framework\
FrameworkDir64=C:\Windows\Microsoft.NET\Framework64\
FrameworkVersion=v4.0.30319
FrameworkVersion32=v4.0.30319
FrameworkVersion64=v4.0.30319
GooGetRoot=C:\ProgramData\GooGet
HOME=C:\Applications\CMDer\Config
HOMEDRIVE=C:
ICPP_COMPILER20=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.2.254\windows\
IFORT_COMPILER20=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.2.254\windows\
INCLUDE=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\compiler\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\compiler\include\intel64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\bin\..\..\intel64\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\ipp\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\pstl\bin\..\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\pstl\bin\..\stdlib;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\daal\include;C:\Program Files (x86)\IntelSWTools\itac_2020\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt
INSPECTOR_2020_DIR=C:\Program Files (x86)\IntelSWTools\Inspector 2020\
INTEL_DEV_REDIST=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
INTEL_LICENSE_FILE=C:\Program Files (x86)\Common Files\\Intel\Licenses;C:\Program Files (x86)\Common Files\Intel\Licenses
INTEL_PYTHONPATH=C:\Program Files (x86)\IntelSWTools\Advisor 2020\pythonapi
IPPROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\ipp
IPP_TARGET_ARCH=intel64
ITAC_ARCH=Intel(R) 64
I_MPI_ROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\bin\..\..
LANG=en_US.UTF-8
LD_LIBRARY_PATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\..\linux\compiler\lib\intel64_lin;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\..\..\linux\tbb\lib\intel64\gcc4.8;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\..\..\linux\tbb\lib\intel64\gcc4.8;
LIB=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\compiler\lib;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\bin\..\..\intel64\lib\release;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\bin\..\..\intel64\lib;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\ipp\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\lib\intel64_win;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\compiler\lib\intel64_win;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\lib\intel64\vc14;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\lib\intel64\vc14;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\daal\lib\intel64_win;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\lib\intel64_win\vc_mt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\lib\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x86
LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.19041.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.19041.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.19041.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.19041.0;C:\Windows\Microsoft.NET\Framework\v4.0.30319
LIBRARY_PATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\ipp\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\..\..\linux\tbb\lib\intel64\gcc4.8;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\..\..\linux\tbb\lib\intel64\gcc4.8;
MIC_LD_LIBRARY_PATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\compiler\lib\mic;
MIC_LIBRARY_PATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\compiler\lib\mic;
MKLROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl
MSVS_VAR_SCRIPT="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat"
MSVS_VAR_SCRIPT_DIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build
OS=Windows_NT
Path=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\redist\intel64\compiler;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\redist\intel64_win\compiler;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\bin\..\..\intel64\libfabric\bin\utils;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\bin\..\..\intel64\libfabric\bin;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\bin\..\..\intel64\bin\release;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\bin\..\..\intel64\bin;C:\Program Files (x86)\IntelSWTools\debugger_2020\bin\\..\gdb\intel64\bin;C:\Program Files (x86)\IntelSWTools\debugger_2020\bin\\..\libipt\intel64\lib;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\ipp\..\redist\intel64\ipp;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\redist\intel64_win\mkl;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\redist\intel64_win\compiler;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\..\redist\intel64\tbb\vc14;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..\..\redist\intel64\tbb\vc14;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\redist\intel64_win\daal;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\redist\intel64_win\tbb\vc_mt;C:\Program Files (x86)\IntelSWTools\itac_2020\bin;C:\Program Files (x86)\IntelSWTools\itac_2020\dll;C:\Program Files (x86)\IntelSWTools\Advisor 2020\bin64;C:\Program Files (x86)\IntelSWTools\Inspector 2020\bin64;C:\Applications\BuildEnv\CMake\bin\;C:\Applications\BuildEnv\Meson\;C:\Applications\BuildEnv\Ninja;C:\Applications\BuildEnv\Xmake;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\bin\HostX86\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\;C:\Applications\CMDer\vendor\bin;C:\Applications\CMDer\vendor\git-for-windows\cmd;C:\Applications\CMDer\vendor\conemu-maximus5\ConEmu\Scripts;C:\Applications\CMDer\vendor\conemu-maximus5;C:\Applications\CMDer\vendor\conemu-maximus5\ConEmu;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Google\Compute Engine\sysprep;C:\Program Files\MATLAB\R2020b\runtime\win64;C:\Program Files\MATLAB\R2020b\bin;C:\PROGRA~1\MATLAB\R2020a\runtime\win64;C:\PROGRA~1\MATLAB\R2020a\bin;C:\Program Files\MATLAB\R2020a\runtime\win64;C:\Program Files\MATLAB\R2020a\bin;C:\Users\MyUser\AppData\Local\Microsoft\WindowsApps;C:\Applications\CMDer\vendor\git-for-windows\mingw64\bin;C:\Applications\CMDer\vendor\git-for-windows\usr\bin;C:\Applications\CMDer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
path_position=append
PKG_CONFIG_PATH=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\bin\pkgconfig;
Platform=x64
PLINK_PROTOCOL=ssh
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 63 Stepping 0, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3f00
PRODUCT_DIR=C:\Program Files (x86)\IntelSWTools\Advisor 2020\
PRODUCT_NAME=Intel Compiler 19.1 Update 2
PRODUCT_NAME_FULL=Intel(R) Compiler 19.1 Update 2 (package 254)
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Program Files (x86)\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell
PSTLROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\pstl\bin\..
PSTL_BIN_DIR=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\pstl\bin\
PSTL_TARGET_ARCH=intel64
PSTL_TARGET_VS=vs2019
PUBLIC=C:\Users\Public
PYTHONPATH=C:\Program Files (x86)\IntelSWTools\Advisor 2020\pythonapi
ROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows
ROOT_ROOT_NAME=windows
SCRIPT_NAME=compilervars_arch.bat
SystemDrive=C:
SystemRoot=C:\Windows
TARGET_ARCH=intel64
TARGET_VS=vs2019
TARGET_VS_ARCH=amd64
TBBROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\..
TBB_BIN_DIR=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\
TBB_TARGET_ARCH=intel64
TBB_TARGET_VS=vc14
UCRTVersion=10.0.19041.0
UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
VCIDEInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\
VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\
VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Redist\MSVC\14.27.29016\
VCToolsVersion=14.27.29110
VS160COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\
VS2017INSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
VS2019INSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x64
VSCMD_ARG_TGT_ARCH=x64
VSCMD_VER=16.7.5
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\
VTUNE_PROFILER_2020_DIR=C:\Program Files (x86)\IntelSWTools\VTune Profiler 2020\
VT_ADD_LIBS=ws2_32.lib advapi32.lib
VT_DLL_DIR=C:\Program Files (x86)\IntelSWTools\itac_2020\dll
VT_FMPI_DLL=impi.dll
VT_LIB_DIR=C:\Program Files (x86)\IntelSWTools\itac_2020\dll
VT_MPI=impi64
VT_MPI_DLL=impi.dll
VT_ROOT=C:\Program Files (x86)\IntelSWTools\itac_2020
VT_SLIB_DIR=C:\Program Files (x86)\IntelSWTools\itac_2020\dll
windir=C:\Windows
WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.19041.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.19041.0
WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin\
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
WindowsSDKLibVersion=10.0.19041.0\
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\
WindowsSDKVersion=10.0.19041.0\
WIN_TITLE=Intel Compiler 19.1 Update 2 Intel(R) 64 Visual Studio 2019
WIN_TITLE_ARCH=Intel(R) 64
WIN_TITLE_VS=Visual Studio 2019
__DOTNET_ADD_32BIT=1
__DOTNET_ADD_64BIT=1
__DOTNET_PREFERRED_BITNESS=64
__MS_VC_INSTALL_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\
__VSCMD_PREINIT_PATH=C:\Applications\CMDer\vendor\bin;C:\Applications\CMDer\vendor\git-for-windows\cmd;C:\Applications\CMDer\vendor\conemu-maximus5\ConEmu\Scripts;C:\Applications\CMDer\vendor\conemu-maximus5;C:\Applications\CMDer\vendor\conemu-maximus5\ConEmu;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Google\Compute Engine\sysprep;C:\Program Files\MATLAB\R2020b\runtime\win64;C:\Program Files\MATLAB\R2020b\bin;C:\PROGRA~1\MATLAB\R2020a\runtime\win64;C:\PROGRA~1\MATLAB\R2020a\bin;C:\Program Files\MATLAB\R2020a\runtime\win64;C:\Program Files\MATLAB\R2020a\bin;C:\Users\MyUser\AppData\Local\Microsoft\WindowsApps;C:\Applications\CMDer\vendor\git-for-windows\mingw64\bin;C:\Applications\CMDer\vendor\git-for-windows\usr\bin;C:\Applications\CMDer
__VSCMD_PREINIT_VCToolsVersion=14.27.29110
__VSCMD_PREINIT_VS160COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\
__VSCMD_script_err_count=0

This is on Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.2.254 Build 20200623.

I think what should be done on Windows is looking for ICPP_COMPILER on the system variables (The pattern is probably something like ICPP_COMPILER?? as the last 2 digits are there for a version) and VCINSTALLDIR. When both are defined we have Intel Compiler available.

Then we should define CC=icl and CXX=icl and use MSVC style of flags with the added flags options of Intel Compiler.

What do you think?

Update

Another useful information is any version define the path C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin and symlinks it to the latest version installed (This path has no version in it).

@waruqi
Copy link
Member

waruqi commented Oct 6, 2020

I have installed the free 30-day trial version and I will attempt to support it.

@waruqi
Copy link
Member

waruqi commented Oct 6, 2020

I have supported for intel c/c++ compiler on linux/macos/windows. you can update to the dev branch and try it.

xmake f --toolchain=icc -c
xmake -rv

Windows

[ 50%]: compiling.release src\main.cpp
"C:\\Program Files (x86)\\IntelSWTools\\compilers_and_libraries_2020.2.254\\windows\\bin\\intel64\\icl.exe" -c -Ox -fp:fast -Fobuild\.objs\test\windows\x64\release\src\main.cpp.obj src\main.cpp
checking for flags (/sourceDependencies C:\Users\ruki\AppData\Local\Temp\.xmake\201006\_EE0E6C54EDAD4408BFF68AAEF6078DC7.json) ... no
[ 75%]: linking.release test.exe
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.27.29109\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf /ltcg -out:build\windows\x64\release\test.exe build\.objs\test\windows\x64\release\src\main.cpp.obj
[100%]: build ok!

macOS

[ 50%]: ccache compiling.release src/main.cpp
/usr/local/bin/ccache /usr/local/bin/icpc -c -m64 -fvisibility=hidden -fvisibility-inlines-hidd
en -O3 -I/usr/local/include -o build/.objs/demo/macosx/x86_64/release/src/main.cpp.o src/main.c
pp
[ 37%]: ccache compiling.release src/interface.cpp
/usr/local/bin/ccache /usr/local/bin/icpc -c -m64 -fvisibility=hidden -fvisibility-inlines-hidd
en -O3 -I/usr/local/include -o build/.objs/test/macosx/x86_64/release/src/interface.cpp.o src/i
nterface.cpp
checking for flags (-MMD -MF) ... ok
checking for flags (-fcolor-diagnostics) ... ok
[ 62%]: archiving.release libtest.a
/usr/bin/ar -cr build/macosx/x86_64/release/libtest.a build/.objs/test/macosx/x86_64/release/sr
c/interface.cpp.o
[ 87%]: linking.release demo
/usr/local/bin/icpc -o build/macosx/x86_64/release/demo build/.objs/demo/macosx/x86_64/release/
src/main.cpp.o -m64 -Lbuild/macosx/x86_64/release -Wl,-x -L/usr/local/lib -L/usr/lib -ltest
[100%]: build ok!

@RoyiAvital
Copy link
Author

Is it always --toolchain=icc or on Windows it is icl?

@waruqi
Copy link
Member

waruqi commented Oct 6, 2020

Is it always --toolchain=icc or on Windows it is icl?

always icc, a short name of intel c++ compiler

@waruqi
Copy link
Member

waruqi commented Oct 7, 2020

BTW, now I have also supported for Intel Fortran Compiler on linux/macOS/windows.

xmake f --toolchain=ifort -c
xmake

@RoyiAvital
Copy link
Author

It seems the next version with all those new features will be great!
Maybe it should be 2.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants