OpenCV64 project build failed due to Eigen new source code error C2665

Submitted by Microsoft Visual C++ Team

Assigned to Nobody

Link to original bugzilla bug (#1744)
Operating system: Windows

Description

Created attachment 950

log_x64_build.log

Hi All

I build OpenCV project failed with error C2665 on Windows + MSVC, this issue is exposed by OpenCV dependency lib Eigen new source code 9aba5274. Could you please help take a look at this? Thanks!

Steps to reproduce:

1.git clone https://github.com/opencv/opencv D:\OpenCV\src

2.git clone https://github.com/opencv/opencv_extra D:\OpenCV\src\extra

3.hg clone https://bitbucket.org/eigen/eigen/ d:\Eigen\src

4.Open a VS 2017 x64 prompt and browse to D:\OpenCV

5.mkdir build_x64 && pushd build_x64

6.cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DWITH_IPP=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_PERF_TESTS=ON -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DWITH_OPENCL=OFF -DBUILD_DOCS=OFF -DWITH_CUDA=OFF ..\src

7.msbuild /p:Configuration=Release;Platform=x64 build_x64\OpenCV.sln /t:Rebuild /m /p:BuildInParallel=true

The whole log file(log_x64_build.log) please see attachment.

Actual result:

D:\Eigen\src\Eigen\src/Core/GenericPacketMath.h(524): error C2665: 'log': none of the 3 overloads could convert all the argument types [D:\OpenCV\build_x64\modules\imgproc\opencv_imgproc_AVX512_SKX.vcxproj]

     C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\cmath(393): note: could be 'long double log(long double) noexcept'  

     C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\cmath(153): note: or       'float log(float) noexcept'  

     C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\corecrt_math.h(480): note: or       'double log(double)'  

     D:\Eigen\src\Eigen\src/Core/GenericPacketMath.h(524): note: while trying to match the argument list '(const Packet)'  

             with  

             [  

                 Packet=Eigen::internal::Packet16f  

             ]  

     D:\Eigen\src\Eigen\src\Core\arch\SSE\../Default/GenericPacketMathFunctions.h(139): note: see reference to function template instantiation 'Packet Eigen::internal::plog<Packet>(const Packet &)' being compiled  

             with  

             [  

                 Packet=Eigen::internal::Packet16f  

             ]  

     D:\Eigen\src\Eigen\src/Core/arch/AVX512/MathFunctions.h(399): note: see reference to function template instantiation 'Packet Eigen::internal::generic_plog1p<Eigen::internal::Packet16f>(const Packet &)' being compiled  

             with  

             [  

                 Packet=Eigen::internal::Packet16f  

             ]  

Attachment 950, "log_x64_build.log":

log_x64_build.log