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

opencv: Fix lack of config verification #22833

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

connorsmacd
Copy link
Contributor

@connorsmacd connorsmacd commented Feb 20, 2024

Specify library name and version: opencv/4.x

This PR modifies the OpenCV 4.x recipe to enable the configuration option ENABLE_CONFIG_VERIFICATION.

According the OpenCV documentation, ENABLE_CONFIG_VERIFICATION does the following:

For each enabled dependency (WITH_ option) verify that it has been found and enabled (HAVE_ variable). By default feature will be silently turned off if dependency was not found, but with this option enabled cmake configuration will fail. Convenient for packaging systems which require stable library configuration not depending on environment fluctuations.

The recipe did not enable this option, so it was possible for the build to succeed even though an explicitly enabled dependency was not found. I noticed this issue while I was playing around with my own fork of the FFmpeg recipe -- despite WITH_FFMPEG being passed, I would see this in the build output:

--   Video I/O:
--     FFMPEG:                      NO (find_package)

While find_package failed due to my own error in the FFmpeg recipe, I would have expected the build to fail as well, but it succeeded due to the error passing silently. With the change in this PR, the build now fails as expected.


@CLAassistant
Copy link

CLAassistant commented Feb 20, 2024

CLA assistant check
All committers have signed the CLA.

@conan-center-bot conan-center-bot added Failed Version conflict There is a version conflict when solving the dependencies graph labels Feb 20, 2024
@conan-center-bot

This comment has been minimized.

@conan-center-bot conan-center-bot removed the Version conflict There is a version conflict when solving the dependencies graph label Mar 8, 2024
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@AbrilRBS AbrilRBS self-assigned this Mar 22, 2024
@AbrilRBS
Copy link
Member

I've restarted the build now that quirc is properly handled :)

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Failure in build 1 (76e57fcedac8c590fe7cff328451af7de5668524):

  • opencv/4.1.2:
    CI failed to create some packages (All logs)

    Logs for packageID d8a4b92e751f45f155292536ce0dd24458a6bb7f:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=Visual Studio
    compiler.runtime=MD
    compiler.version=16
    os=Windows
    [options]
    opencv:shared=False
    
    [...]
    -- Verifying WITH_GPHOTO2= => 'HAVE_GPHOTO2'=FALSE
    -- Verifying WITH_LAPACK=OFF => 'HAVE_LAPACK'=FALSE
    -- Verifying WITH_ITT=OFF => 'HAVE_ITT'=FALSE
    -- Verifying WITH_PROTOBUF=True => 'HAVE_PROTOBUF'=TRUE
    -- Verifying WITH_IMGCODEC_HDR=False => 'HAVE_IMGCODEC_HDR'=FALSE
    -- Verifying WITH_IMGCODEC_SUNRASTER=False => 'HAVE_IMGCODEC_SUNRASTER'=FALSE
    -- Verifying WITH_IMGCODEC_PXM=False => 'HAVE_IMGCODEC_PXM'=FALSE
    -- Verifying WITH_IMGCODEC_PFM=False => 'HAVE_IMGCODEC_PFM'=FALSE
    -- Verifying WITH_QUIRC=False => 'HAVE_QUIRC'=FALSE
    -- Verifying WITH_ANDROID_MEDIANDK= => 'HAVE_ANDROID_MEDIANDK'=FALSE
    -- Configuring incomplete, errors occurred!
    See also "C:/J/workspace/prod-v1/bsr/7777/bceff/s/46e688/1/build/CMakeFiles/CMakeOutput.log".
    See also "C:/J/workspace/prod-v1/bsr/7777/bceff/s/46e688/1/build/CMakeFiles/CMakeError.log".
    opencv/4.1.2: 
    CMake Warning at cmake/OpenCVUtils.cmake:710 (message):
      Option WITH_OPENCL_D3D11_NV is enabled but corresponding dependency have
      not been found: "HAVE_OPENCL_D3D11_NV" is FALSE
    Call Stack (most recent call first):
      CMakeLists.txt:1552 (ocv_verify_config)
    
    
    CMake Error at cmake/OpenCVUtils.cmake:722 (message):
      Some dependencies have not been found or have been forced, unset
      ENABLE_CONFIG_VERIFICATION option to ignore these failures or change
      following options:
    
      WITH_OPENCL_D3D11_NV
    Call Stack (most recent call first):
      CMakeLists.txt:1552 (ocv_verify_config)
    
    
    CMake Warning:
      Value of OPENCV_BUILD_INFO_STR contained a newline; truncating
    
    
    WARN: protobuf/3.21.12: requirement zlib/[>=1.2.11 <2] overridden by opencv/4.1.2 to zlib/1.3.1 
    WARN: libpng/1.6.43: requirement zlib/[>=1.2.11 <2] overridden by opencv/4.1.2 to zlib/1.3.1 
    WARN: openexr/3.2.3: requirement zlib/[>=1.2.11 <2] overridden by opencv/4.1.2 to zlib/1.3.1 
    WARN: libtiff/4.6.0: requirement zlib/[>=1.2.11 <2] overridden by opencv/4.1.2 to zlib/1.3.1 
    WARN: ffmpeg/4.4.4: requirement zlib/[>=1.2.11 <2] overridden by opencv/4.1.2 to zlib/1.3.1 
    WARN: freetype/2.13.2: requirement libpng/[>=1.6 <2] overridden by ffmpeg/4.4.4 to libpng/1.6.43 
    WARN: freetype/2.13.2: requirement zlib/[>=1.2.10 <2] overridden by ffmpeg/4.4.4 to zlib/1.3.1 
    WARN: openssl/3.2.1: requirement zlib/[>=1.2.11 <2] overridden by ffmpeg/4.4.4 to zlib/1.3.1 
    opencv/4.1.2: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
    opencv/4.1.2: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
    opencv/4.1.2: ERROR: Package 'd8a4b92e751f45f155292536ce0dd24458a6bb7f' build failed
    opencv/4.1.2: WARN: Build folder C:/J/workspace/prod-v1/bsr/7777/bceff/s\46e688\1\build
    ERROR: opencv/4.1.2: Error in build() method, line 1565
    	cmake.configure()
    	ConanException: Error 1 while executing cmake -G "Visual Studio 16 2019" -DCMAKE_TOOLCHAIN_FILE="C:/J/workspace/prod-v1/bsr/7777/bceff/s/46e688/1/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/J/workspace/prod-v1/bsr/7777/bceff/s/e85fd1/1" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "C:/J/workspace/prod-v1/bsr/7777/bceff/s\46e688\1\src"
    
  • opencv/4.5.5:
    Didn't run or was cancelled before finishing

  • opencv/4.5.3:
    Didn't run or was cancelled before finishing

  • opencv/4.8.1:
    Didn't run or was cancelled before finishing

  • opencv/4.9.0:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.


Conan v2 pipeline ❌

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping @conan-io/barbarians on the PR and we will help you.

See details:

Failure in build 1 (76e57fcedac8c590fe7cff328451af7de5668524):

  • opencv/4.9.0:
    Didn't run or was cancelled before finishing

  • opencv/4.8.1:
    Didn't run or was cancelled before finishing

  • opencv/4.5.5:
    Didn't run or was cancelled before finishing

  • opencv/4.5.3:
    Didn't run or was cancelled before finishing

  • opencv/4.1.2:
    CI failed to create some packages (All logs)

    Logs for packageID 10817ec28d83926b185f1b5fd47f4bd752b5599e:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=msvc
    compiler.cppstd=14
    compiler.runtime=dynamic
    compiler.runtime_type=Release
    compiler.version=192
    os=Windows
    [options]
    */*:shared=False
    
    [...]
    -- Verifying WITH_OPENCLAMDFFT=OFF => 'HAVE_CLAMDFFT'=FALSE
    -- Verifying WITH_OPENCLAMDBLAS=OFF => 'HAVE_CLAMDBLAS'=FALSE
    -- Verifying WITH_DIRECTX=ON => 'HAVE_DIRECTX'=TRUE
    -- Verifying WITH_OPENCL_D3D11_NV=ON => 'HAVE_OPENCL_D3D11_NV'=FALSE
    CMake Warning at cmake/OpenCVUtils.cmake:710 (message):
      Option WITH_OPENCL_D3D11_NV is enabled but corresponding dependency have
      not been found: "HAVE_OPENCL_D3D11_NV" is FALSE
    Call Stack (most recent call first):
      CMakeLists.txt:1552 (ocv_verify_config)
    
    
    -- Verifying WITH_LIBREALSENSE=OFF => 'HAVE_LIBREALSENSE'=FALSE
    -- Verifying WITH_VA=OFF => 'HAVE_VA'=FALSE
    -- Verifying WITH_VA_INTEL=OFF => 'HAVE_VA_INTEL'=FALSE
    -- Verifying WITH_MFX=OFF => 'HAVE_MFX'=FALSE
    -- Verifying WITH_GDAL=False => 'HAVE_GDAL'=FALSE
    -- Verifying WITH_GPHOTO2= => 'HAVE_GPHOTO2'=FALSE
    -- Verifying WITH_LAPACK=OFF => 'HAVE_LAPACK'=FALSE
    -- Verifying WITH_ITT=OFF => 'HAVE_ITT'=FALSE
    -- Verifying WITH_PROTOBUF=True => 'HAVE_PROTOBUF'=TRUE
    -- Verifying WITH_IMGCODEC_HDR=False => 'HAVE_IMGCODEC_HDR'=FALSE
    -- Verifying WITH_IMGCODEC_SUNRASTER=False => 'HAVE_IMGCODEC_SUNRASTER'=FALSE
    -- Verifying WITH_IMGCODEC_PXM=False => 'HAVE_IMGCODEC_PXM'=FALSE
    -- Verifying WITH_IMGCODEC_PFM=False => 'HAVE_IMGCODEC_PFM'=FALSE
    -- Verifying WITH_QUIRC=False => 'HAVE_QUIRC'=FALSE
    -- Verifying WITH_ANDROID_MEDIANDK= => 'HAVE_ANDROID_MEDIANDK'=FALSE
    CMake Error at cmake/OpenCVUtils.cmake:722 (message):
      Some dependencies have not been found or have been forced, unset
      ENABLE_CONFIG_VERIFICATION option to ignore these failures or change
      following options:
    
      WITH_OPENCL_D3D11_NV
    Call Stack (most recent call first):
      CMakeLists.txt:1552 (ocv_verify_config)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/J/workspace/prod-v2/bsr/6546/accce/p/b/openc1234ec4786d18/b/build/CMakeFiles/CMakeOutput.log".
    See also "C:/J/workspace/prod-v2/bsr/6546/accce/p/b/openc1234ec4786d18/b/build/CMakeFiles/CMakeError.log".
    CMake Warning:
      Value of OPENCV_BUILD_INFO_STR contained a newline; truncating
    
    
    
    opencv/4.1.2: ERROR: 
    Package '10817ec28d83926b185f1b5fd47f4bd752b5599e' build failed
    opencv/4.1.2: WARN: Build folder C:\J\workspace\prod-v2\bsr\6546\accce\p\b\openc1234ec4786d18\b\build
    ERROR: opencv/4.1.2: Error in build() method, line 1565
    	cmake.configure()
    	ConanException: Error 1 while executing
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@connorsmacd
Copy link
Contributor Author

I figured something like this would happen:

  Some dependencies have not been found or have been forced, unset
  ENABLE_CONFIG_VERIFICATION option to ignore these failures or change
  following options:

  WITH_OPENCL_D3D11_NV

It looks like this is getting enabled by default because DirectX support is enabled by default (see: https://github.com/opencv/opencv/blob/f37924796f5e07d14b9011400573a48343a22d26/CMakeLists.txt#L424), so we could either disable WITH_DIRECTX or WITH_OPENCL_D3D11_NV -- I'm not sure about which option to go with.

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

Successfully merging this pull request may close these issues.

5 participants