Vcpkg: [opencv] build failure

Created on 23 Oct 2020  路  14Comments  路  Source: microsoft/vcpkg

Host Environment

  • OS: Windows 10
  • Compiler: revision

To Reproduce
Steps to reproduce the behavior:
.\vcpkg install opencv[core,dnn,ffmpeg,jpeg,opengl,png,tiff,webp] --triplet x64-windows
.\vcpkg install darknet[full]:x64-windows
.\vcpkg install darknet[opencv-base,cuda,cudnn] --triplet x64-windows

Failure logs
Computing installation plan...
The following packages will be built and installed:
darknet[core,cuda,cudnn,opencv-base]:x64-windows

  • opencv[core,dnn,ffmpeg,jpeg,opengl,png,tiff,webp]:x64-windows
  • opencv4[core,dnn,ffmpeg,jpeg,opengl,png,tiff,webp]:x64-windows
    Additional packages (*) will be modified to complete this operation.
    Detecting compiler hash for triplet x64-windows...
    Starting package 1/3: opencv4:x64-windows
    Building package opencv4[core,dnn,ffmpeg,jpeg,opengl,png,tiff,webp]:x64-windows...
    Could not locate cached archive: C:\Users\runji\AppData\Local\vcpkg\archives\95\953199745b91131c12e335bfdb55eefe7d7b784c.zip
    -- Using cached C:/vcpkg/downloads/opencv-opencv-4.3.0.tar.gz
    -- Cleaning sources at C:/vcpkg/buildtrees/opencv4/src/4.3.0-1e84697c4a.clean. Use --editable to skip cleaning for the packages you specify.
    -- Extracting source C:/vcpkg/downloads/opencv-opencv-4.3.0.tar.gz
    -- Applying patch 0001-disable-downloading.patch
    -- Applying patch 0002-install-options.patch
    -- Applying patch 0003-force-package-requirements.patch
    -- Applying patch 0004-fix-policy-CMP0057.patch
    -- Applying patch 0006-jpeg2000_getref.patch
    -- Applying patch 0009-fix-uwp.patch
    -- Using source at C:/vcpkg/buildtrees/opencv4/src/4.3.0-1e84697c4a.clean
    -- Using cached C:/vcpkg/downloads/opencv-cache/tiny_dnn/adb1c512e09ca2c7a6faef36f9c53e59-v1.0.0a3.tar.gz
    -- Configuring x64-windows
    CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:85 (message):
    Command failed: ninja -v
    Working Directory: C:/vcpkg/buildtrees/opencv4/x64-windows-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
    C:\vcpkg\buildtrees\opencv4\config-x64-windows-out.log

Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:312 (vcpkg_execute_required_process)
ports/opencv4/portfile.cmake:280 (vcpkg_configure_cmake)
scripts/ports.cmake:79 (include)

Error: Building package opencv4:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: opencv4:x64-windows
Vcpkg version: 2020.06.15-nohash

Additionally, attach any relevant sections from the log files above.
config-x64-windows-out.log

Additional context
Add any other context about the problem here, such as what you have already tried to resolve the issue.

I tried updating vcpkg and cmake, reinstalling everything.

port-bug

Most helpful comment

Hi gus, I opened a PR #14177 to fix this issue, please test if it works.

Thanks.

All 14 comments

CMake Error at modules/videoio/cmake/init.cmake:12 (set_target_properties):
  Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
  "optimized".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.

Confirmed.

I got the same problem.
The software environment as follows:
Win10
CUDA 10.1
Cudnn 7.6.0
VS 2019 with C++

The log of Config-x64-windows-out stop at "ninja: build stopped: subcommand failed. "

If someone can solve this problem, thanks for your help.

cc @cenit, does this issue related to the cmake update?
Or it's a ffmpeg issue?

Hi gus, I opened a PR #14177 to fix this issue, please test if it works.

Thanks.

Hey @JackBoosY. I was experiencing the same issue as issdn and the PR resolved it for me. Thank you!

Hi gus, I opened a PR #14177 to fix this issue, please test if it works.

Thanks.

This worked, thank you.

cc @cenit, does this issue related to the cmake update?
Or it's a ffmpeg issue?

hi @JackBoosY
first of all sorry for very late reply.
The problem is due to recent ffmpeg update which rewrote the FindFFMPEG.cmake.in that I wrote. You already proposed a fix in another PR, I will let you know if it's ok for me :)
Thank you very much for your work

hi @JackBoosY,
I still get the same problem. Do I update or modify anything?
I use this command ".\vcpkg install darknet[full]:x64-windows" on windows PowerShell
Thanks for your help

config-x64-windows-out.log

@JWFrank
Please merge my changes in #14177, and rerun the install command again.

Hi @JackBoosY ,
I merge changes in #14177, and I still got error message

-- Applying patch 0001-disable-downloading.patch
-- Applying patch 0002-install-options.patch
-- Applying patch 0003-force-package-requirements.patch
-- Applying patch 0004-fix-policy-CMP0057.patch
-- Applying patch 0006-jpeg2000_getref.patch
-- Applying patch 0009-fix-uwp.patch
-- Applying patch 0010-fix-interface_link_libraries.patch
CMake Error at scripts/cmake/vcpkg_apply_patches.cmake:54 (message):
Applying patch failed. error: corrupt patch at line 14

Call Stack (most recent call first):
scripts/cmake/vcpkg_extract_source_archive_ex.cmake:141 (vcpkg_apply_patches)
scripts/cmake/vcpkg_from_github.cmake:139 (vcpkg_extract_source_archive_ex)
ports/opencv4/portfile.cmake:11 (vcpkg_from_github)
scripts/ports.cmake:79 (include)

Error: Building package opencv4:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: opencv4:x64-windows
Vcpkg version: 2020.06.15-nohash

Whether I do something wrong in somewhere
The attachment is my modified files
Thanks for your help

Modify.zip

Hi @JackBoosY,
Sorry about that, I fixed this issue by download your files on GitHub
It works now
Thanks a lot for your help

Trying to checkout to this branch using:

git checkout dev/jack/14171

and getting this error:

error: pathspec 'dev/jack/14171' did not match any file(s) known to git

Any reason?

Hi gus, I opened a PR #14177 to fix this issue, please test if it works.

Thanks.

Hey @JackBoosY. I was experiencing the same issue as issdn and the PR resolved it for me. Thank you!
I am newbie at GitHub and CMake and just have a question what was the real problem, and how your change solved it?
I can see only that some component did not like the "optimized" text and after your change this text disappears from the Found FFMPEG line in "dbg" target. Where did that unexpected "optimized" text came from and why that causes a problem in "dbg"?
Thank you for your explanation.

Was this page helpful?
0 / 5 - 0 ratings