conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
971 stars 1.79k forks source link

[package] opencv/4.5.3: can't build with address sanitizer on windows #10413

Open AndreyMlashkin opened 2 years ago

AndreyMlashkin commented 2 years ago

Package and Environment Details (include every applicable attribute)

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.cppstd=17
compiler.runtime=MD
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
CFLAGS=/fsanitize=address
CONAN_USE_ALWAYS_SHORT_PATHS=True
CXXFLAGS=/fsanitize=address
LDFLAGS=/fsanitize=address

Steps to reproduce (Include if Applicable)

conan install opencv/4.5.3@ --build missing

Logs (Include/Attach if Applicable)

Click to expand log ``` opencv/4.5.3: Copying sources to build folder opencv/4.5.3: Building your package in E:\.conan\2ffc7d\1 opencv/4.5.3: Generator cmake created conanbuildinfo.cmake opencv/4.5.3: Generator cmake_find_package created FindJasper.cmake opencv/4.5.3: Generator cmake_find_package created FindOpenEXR.cmake opencv/4.5.3: Generator cmake_find_package created FindTIFF.cmake opencv/4.5.3: Generator cmake_find_package created FindEigen3.cmake opencv/4.5.3: Generator cmake_find_package created Findquirc.cmake opencv/4.5.3: Generator cmake_find_package created FindProtobuf.cmake opencv/4.5.3: Generator cmake_find_package created Findade.cmake opencv/4.5.3: Generator cmake_find_package created FindJPEG.cmake opencv/4.5.3: Generator cmake_find_package created FindPNG.cmake opencv/4.5.3: Generator cmake_find_package created Findlibdeflate.cmake opencv/4.5.3: Generator cmake_find_package created FindLibLZMA.cmake opencv/4.5.3: Generator cmake_find_package created Findjbig.cmake opencv/4.5.3: Generator cmake_find_package created Findzstd.cmake opencv/4.5.3: Generator cmake_find_package created FindWebP.cmake opencv/4.5.3: Generator cmake_find_package created FindZLIB.cmake opencv/4.5.3: Aggregating env generators opencv/4.5.3: Calling build() WARN: replace_in_file didn't find pattern 'if (ade_DIR)' in 'source_subfolder\modules\gapi\cmake\init.cmake' file. ----Running------ > cd E:\.conan\2ffc7d\1\build_subfolder && cmake -G "Visual Studio 16 2019" -A "x64" -DCONAN_LINK_RUNTIME="/MD" -DCONAN_CMAKE_CXX_STANDARD="17" -DCONAN_CMAKE_CXX_EXTENSIONS="OFF" -DCONAN_STD_CXX_FLAG="/std:c++17" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="16" -DCONAN_CXX_FLAGS="/MP4" -DCONAN_C_FLAGS="/MP4" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="E:\.conan\7c59ab\1" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_MODULE_PATH="E:/.conan/2ffc7d/1" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DOPENCV_CONFIG_INSTALL_PATH="cmake" -DOPENCV_BIN_INSTALL_PATH="bin" -DOPENCV_LIB_INSTALL_PATH="lib" -DOPENCV_3P_LIB_INSTALL_PATH="lib" -DOPENCV_OTHER_INSTALL_PATH="res" -DOPENCV_LICENSES_INSTALL_PATH="licenses" -DBUILD_CUDA_STUBS="False" -DBUILD_DOCS="False" -DBUILD_EXAMPLES="False" -DBUILD_FAT_JAVA_LIB="False" -DBUILD_IPP_IW="False" -DBUILD_ITT="False" -DBUILD_JASPER="False" -DBUILD_JAVA="False" -DBUILD_JPEG="False" -DBUILD_OPENEXR="False" -DBUILD_OPENJPEG="False" -DBUILD_TESTS="False" -DBUILD_PROTOBUF="False" -DBUILD_PACKAGE="False" -DBUILD_PERF_TESTS="False" -DBUILD_USE_SYMLINKS="False" -DBUILD_opencv_apps="False" -DBUILD_opencv_java="False" -DBUILD_opencv_java_bindings_gen="False" -DBUILD_opencv_js="False" -DBUILD_ZLIB="False" -DBUILD_PNG="False" -DBUILD_TIFF="False" -DBUILD_WEBP="False" -DBUILD_TBB="False" -DOPENCV_FORCE_3RDPARTY_BUILD="False" -DBUILD_opencv_python2="False" -DBUILD_opencv_python3="False" -DBUILD_opencv_python_bindings_g="False" -DBUILD_opencv_python_tests="False" -DBUILD_opencv_ts="False" -DWITH_1394="False" -DWITH_ADE="True" -DWITH_ARAVIS="False" -DWITH_CLP="False" -DWITH_NVCUVID="False" -DWITH_FFMPEG="False" -DWITH_GSTREAMER="False" -DWITH_HALIDE="False" -DWITH_HPX="False" -DWITH_IMGCODEC_HDR="True" -DWITH_IMGCODEC_PFM="False" -DWITH_IMGCODEC_PXM="False" -DWITH_IMGCODEC_SUNRASTER="False" -DWITH_INF_ENGINE="False" -DWITH_IPP="False" -DWITH_ITT="False" -DWITH_LIBREALSENSE="False" -DWITH_MFX="False" -DWITH_NGRAPH="False" -DWITH_OPENCL="False" -DWITH_OPENCLAMDBLAS="False" -DWITH_OPENCLAMDFFT="False" -DWITH_OPENCL_SVM="False" -DWITH_OPENGL="False" -DWITH_OPENMP="False" -DWITH_OPENNI="False" -DWITH_OPENNI2="False" -DWITH_OPENVX="False" -DWITH_PLAIDML="False" -DWITH_PVAPI="False" -DWITH_QT="False" -DWITH_QUIRC="False" -DWITH_V4L="False" -DWITH_VA="False" -DWITH_VA_INTEL="False" -DWITH_VTK="False" -DWITH_VULKAN="False" -DWITH_XIMEA="False" -DWITH_XINE="False" -DWITH_LAPACK="False" -DWITH_GTK="False" -DWITH_GTK_2_X="False" -DWITH_WEBP="True" -DWITH_JPEG="True" -DWITH_PNG="True" -DWITH_TIFF="True" -DWITH_JASPER="True" -DWITH_OPENJPEG="False" -DWITH_OPENEXR="True" -DWITH_EIGEN="True" -DHAVE_QUIRC="True" -DWITH_DSHOW="True" -DWITH_MSMF="True" -DWITH_MSMF_DXVA="True" -DOPENCV_MODULES_PUBLIC="opencv" -DOPENCV_ENABLE_NONFREE="False" -DWITH_PROTOBUF="True" -DPROTOBUF_UPDATE_FILES="True" -DBUILD_opencv_dnn="True" -DOPENCV_DNN_CUDA="False" -DBUILD_opencv_freetype="False" -DBUILD_opencv_sfm="False" -DOPENEXR_ROOT="E:\conan_new\openexr\2.5.7\_\_\package\fd95940302caa4e143358a4895a705b646424538" -DWITH_CUDA="False" -DWITH_CUBLAS="False" -DWITH_CUFFT="False" -DWITH_CUDNN="False" -DENABLE_PIC="True" -DBUILD_WITH_STATIC_CRT="False" -Wno-dev E:\.conan\2ffc7d\1 ----------------- -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044. -- The C compiler identification is MSVC 19.29.30143.0 -- The CXX compiler identification is MSVC 19.29.30143.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: E:/msvc2019/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: E:/msvc2019/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Conan: called by CMake conan helper -- Conan: called inside local cache -- Conan: Adjusting output directories -- Conan: Using cmake global configuration -- Conan: Adjusting language standard -- Conan setting CPP STANDARD: 17 WITH EXTENSIONS OFF -- Detected processor: AMD64 -- Found PythonInterp: C:/Python310/python.exe (found suitable version "3.10.4", minimum required is "2.7") CMake Warning at source_subfolder/cmake/OpenCVDetectPython.cmake:81 (message): CMake's 'find_host_package(PythonInterp 2.7)' found wrong Python version: PYTHON_EXECUTABLE=C:/Python310/python.exe PYTHON_VERSION_STRING=3.10.4 Consider providing the 'PYTHON2_EXECUTABLE' variable via CMake command line or environment variables Call Stack (most recent call first): source_subfolder/cmake/OpenCVDetectPython.cmake:271 (find_python) source_subfolder/CMakeLists.txt:620 (include) -- Could NOT find Python2 (missing: Python2_EXECUTABLE Interpreter) Reason given by package: Interpreter: Wrong major version for the interpreter "C:/Python310/python.exe" -- Found PythonInterp: C:/Python310/python.exe (found suitable version "3.10.4", minimum required is "3.2") -- Found PythonLibs: C:/Python310/libs/python310.lib (found suitable exact version "3.10.4") Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'numpy' -- Performing Test HAVE_CXX_FP:PRECISE -- Performing Test HAVE_CXX_FP:PRECISE - Failed -- Performing Test HAVE_C_FP:PRECISE -- Performing Test HAVE_C_FP:PRECISE - Failed -- Performing Test HAVE_CPU_SSE3_SUPPORT (check file: source_subfolder/cmake/checks/cpu_sse3.cpp) -- Performing Test HAVE_CPU_SSE3_SUPPORT - Failed -- SSE3 is not supported by C++ compiler -- Performing Test HAVE_CPU_SSSE3_SUPPORT (check file: source_subfolder/cmake/checks/cpu_ssse3.cpp) -- Performing Test HAVE_CPU_SSSE3_SUPPORT - Failed -- SSSE3 is not supported by C++ compiler -- Performing Test HAVE_CPU_SSE4_1_SUPPORT (check file: source_subfolder/cmake/checks/cpu_sse41.cpp) -- Performing Test HAVE_CPU_SSE4_1_SUPPORT - Failed -- SSE4_1 is not supported by C++ compiler -- Performing Test HAVE_CPU_POPCNT_SUPPORT (check file: source_subfolder/cmake/checks/cpu_popcnt.cpp) -- Performing Test HAVE_CPU_POPCNT_SUPPORT - Failed -- POPCNT is not supported by C++ compiler -- Performing Test HAVE_CPU_SSE4_2_SUPPORT (check file: source_subfolder/cmake/checks/cpu_sse42.cpp) -- Performing Test HAVE_CPU_SSE4_2_SUPPORT - Failed -- SSE4_2 is not supported by C++ compiler -- Performing Test HAVE_CXX_ARCH:AVX (check file: source_subfolder/cmake/checks/cpu_fp16.cpp) -- Performing Test HAVE_CXX_ARCH:AVX - Failed -- FP16 is not supported by C++ compiler -- AVX is not supported by C++ compiler -- Performing Test HAVE_CXX_ARCH:AVX2 (check file: source_subfolder/cmake/checks/cpu_avx2.cpp) -- Performing Test HAVE_CXX_ARCH:AVX2 - Failed -- AVX2 is not supported by C++ compiler -- Performing Test HAVE_CXX_ARCH:AVX512 (check file: source_subfolder/cmake/checks/cpu_avx512.cpp) -- Performing Test HAVE_CXX_ARCH:AVX512 - Failed -- AVX_512F is not supported by C++ compiler -- AVX512_COMMON is not supported by C++ compiler -- AVX512_SKX is not supported by C++ compiler -- Optimization SSE3 is not available, skipped -- Dispatch optimization SSE4_1 is not available, skipped -- Dispatch optimization SSE4_2 is not available, skipped -- Dispatch optimization AVX is not available, skipped -- Dispatch optimization FP16 is not available, skipped -- Dispatch optimization AVX2 is not available, skipped -- Dispatch optimization AVX512_SKX is not available, skipped -- Performing Test HAVE_CPU_BASELINE_FLAGS -- Performing Test HAVE_CPU_BASELINE_FLAGS - Failed CMake Error at source_subfolder/cmake/OpenCVCompilerOptimizations.cmake:593 (message): Compiler doesn't support baseline optimization flags: Call Stack (most recent call first): source_subfolder/cmake/OpenCVCompilerOptions.cmake:320 (ocv_compiler_optimization_options) source_subfolder/CMakeLists.txt:623 (include) -- Configuring incomplete, errors occurred! See also "E:/.conan/2ffc7d/1/build_subfolder/CMakeFiles/CMakeOutput.log". See also "E:/.conan/2ffc7d/1/build_subfolder/CMakeFiles/CMakeError.log". opencv/4.5.3: opencv/4.5.3: ERROR: Package '55b449663d4fc58f0c8bc6ad898cd6a32de80d4f' build failed opencv/4.5.3: WARN: Build folder E:\.conan\2ffc7d\1 ERROR: opencv/4.5.3: Error in build() method, line 517 cmake = self._configure_cmake() while calling '_configure_cmake', line 512 self._cmake.configure(build_folder=self._build_subfolder) ConanException: Error 1 while executing cd E:\.conan\2ffc7d\1\build_subfolder && cmake -G "Visual Studio 16 2019" -A "x64" -DCONAN_LINK_RUNTIME="/MD" -DCONAN_CMAKE_CXX_STANDARD="17" -DCONAN_CMAKE_CXX_EXTENSIONS="OFF" -DCONAN_STD_CXX_FLAG="/std:c++17" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="16" -DCONAN_CXX_FLAGS="/MP4" -DCONAN_C_FLAGS="/MP4" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="E:\.conan\7c59ab\1" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_MODULE_PATH="E:/.conan/2ffc7d/1" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DOPENCV_CONFIG_INSTALL_PATH="cmake" -DOPENCV_BIN_INSTALL_PATH="bin" -DOPENCV_LIB_INSTALL_PATH="lib" -DOPENCV_3P_LIB_INSTALL_PATH="lib" -DOPENCV_OTHER_INSTALL_PATH="res" -DOPENCV_LICENSES_INSTALL_PATH="licenses" -DBUILD_CUDA_STUBS="False" -DBUILD_DOCS="False" -DBUILD_EXAMPLES="False" -DBUILD_FAT_JAVA_LIB="False" -DBUILD_IPP_IW="False" -DBUILD_ITT="False" -DBUILD_JASPER="False" -DBUILD_JAVA="False" -DBUILD_JPEG="False" -DBUILD_OPENEXR="False" -DBUILD_OPENJPEG="False" -DBUILD_TESTS="False" -DBUILD_PROTOBUF="False" -DBUILD_PACKAGE="False" -DBUILD_PERF_TESTS="False" -DBUILD_USE_SYMLINKS="False" -DBUILD_opencv_apps="False" -DBUILD_opencv_java="False" -DBUILD_opencv_java_bindings_gen="False" -DBUILD_opencv_js="False" -DBUILD_ZLIB="False" -DBUILD_PNG="False" -DBUILD_TIFF="False" -DBUILD_WEBP="False" -DBUILD_TBB="False" -DOPENCV_FORCE_3RDPARTY_BUILD="False" -DBUILD_opencv_python2="False" -DBUILD_opencv_python3="False" -DBUILD_opencv_python_bindings_g="False" -DBUILD_opencv_python_tests="False" -DBUILD_opencv_ts="False" -DWITH_1394="False" -DWITH_ADE="True" -DWITH_ARAVIS="False" -DWITH_CLP="False" -DWITH_NVCUVID="False" -DWITH_FFMPEG="False" -DWITH_GSTREAMER="False" -DWITH_HALIDE="False" -DWITH_HPX="False" -DWITH_IMGCODEC_HDR="True" -DWITH_IMGCODEC_PFM="False" -DWITH_IMGCODEC_PXM="False" -DWITH_IMGCODEC_SUNRASTER="False" -DWITH_INF_ENGINE="False" -DWITH_IPP="False" -DWITH_ITT="False" -DWITH_LIBREALSENSE="False" -DWITH_MFX="False" -DWITH_NGRAPH="False" -DWITH_OPENCL="False" -DWITH_OPENCLAMDBLAS="False" -DWITH_OPENCLAMDFFT="False" -DWITH_OPENCL_SVM="False" -DWITH_OPENGL="False" -DWITH_OPENMP="False" -DWITH_OPENNI="False" -DWITH_OPENNI2="False" -DWITH_OPENVX="False" -DWITH_PLAIDML="False" -DWITH_PVAPI="False" -DWITH_QT="False" -DWITH_QUIRC="False" -DWITH_V4L="False" -DWITH_VA="False" -DWITH_VA_INTEL="False" -DWITH_VTK="False" -DWITH_VULKAN="False" -DWITH_XIMEA="False" -DWITH_XINE="False" -DWITH_LAPACK="False" -DWITH_GTK="False" -DWITH_GTK_2_X="False" -DWITH_WEBP="True" -DWITH_JPEG="True" -DWITH_PNG="True" -DWITH_TIFF="True" -DWITH_JASPER="True" -DWITH_OPENJPEG="False" -DWITH_OPENEXR="True" -DWITH_EIGEN="True" -DHAVE_QUIRC="True" -DWITH_DSHOW="True" -DWITH_MSMF="True" -DWITH_MSMF_DXVA="True" -DOPENCV_MODULES_PUBLIC="opencv" -DOPENCV_ENABLE_NONFREE="False" -DWITH_PROTOBUF="True" -DPROTOBUF_UPDATE_FILES="True" -DBUILD_opencv_dnn="True" -DOPENCV_DNN_CUDA="False" -DBUILD_opencv_freetype="False" -DBUILD_opencv_sfm="False" -DOPENEXR_ROOT="E:\conan_new\openexr\2.5.7\_\_\package\fd95940302caa4e143358a4895a705b646424538" -DWITH_CUDA="False" -DWITH_CUBLAS="False" -DWITH_CUFFT="False" -DWITH_CUDNN="False" -DENABLE_PIC="True" -DBUILD_WITH_STATIC_CRT="False" -Wno-dev E:\.conan\2ffc7d\1 ```
Nekto89 commented 2 years ago

AFAIK running binaries with AddressSanitizer in MSVC requires additional path for finding proper DLLs. It should be injected only for specific build targets, not for whole build.