[x265] How to compile with the Intel C/C++ compiler on Windows

Michael Lackner michael.lackner at unileoben.ac.at
Fri Dec 7 11:42:39 CET 2018


Hello again,

As a quick followup on my previous question, I have managed to make some progress. The
name of the platform toolset has seemingly changed a bit over the years, so the correct
generator + platform toolset options for cmake in multilib.bat for using the Intel C++
compiler on Windows look like this:

-G "Visual Studio 15 2017 Win64" -T "Intel C++ Compiler 19.0"

Also, one needs to add another option to cmake:

-DCMAKE_VS_PLATFORM_TOOLSET="Intel C++ Compiler 19.0"

With this, it does detect the Intel compiler and attempts to compile x265 with it.
However, it crashes when trying to build asm-primitives.cpp with an error where I do not
know why this would happen:


  asm-primitives.cpp

X:\Build\x265\2018-11-22-source\source\common\x86\asm-primitives.cpp
(5421): error : name followed by "::" must be a class or namespace name [X:\Bui
ld\x265\2018-11-22-source\build\vc17-x86_64\12bit\common\common.vcxp
roj]
        uint32_t cpu = x265::cpu_detect(false);
                       ^

X:\Build\x265\2018-11-22-source\source\common\x86\asm-primitives.cpp
(5448): error : identifier "x265_safe_intel_cpu_indicator_init" is undefined [X
:\Build\x265\2018-11-22-source\build\vc17-x86_64\12bit\common\common
.vcxproj]
        x265_safe_intel_cpu_indicator_init();
        ^


Can anyone help with this? It only happens with Intels' stuff (icl.exe), compiles fine
with MSVC (cl.exe)

Thank you!


On 12/06/2018 12:06 PM, Michael Lackner wrote:
> Hello!
> 
> I would like to compare the MSVC and Intel compilers on Windows, for multilib builds. So
> I've looked at other people's solutions to do this, like calling Intels' compilervars.bat
> instead of vcvarsall.bat, setting the -T "Intel C++ Compiler XE 19.0" option for the cmake
> lines in multilib.bat, setting CC/CXX in there as well etc., but it always fails
> catastrophically.
> 
> By default, when using the Intel terminal / running Intel's compilervars.bat, the cmake
> build system still uses the MSVC platform toolset.
> 
> So I would like to ask how to switch the compiler. Building multilib releases with just
> MSVC is super easy, and works fine (Visual Studio 2017), but I just can't figure out what
> I need to do to build with Intel's C++ Compiler XE 19.0.
> 
> On Linux and UNIX, all I need to do is export CC & CXX to switch compilers, but it's not
> so easy on Windows it seems...
> 
> Any hints?
> 
> Thank you very much!


-- 
Michael Lackner
Lehrstuhl für Informationstechnologie (CiT)
Montanuniversität Leoben
Tel.: +43 (0)3842/402-1505 | Mail: michael.lackner at unileoben.ac.at
Fax.: +43 (0)3842/402-1502 | Web: http://institute.unileoben.ac.at/infotech


More information about the x265-devel mailing list