Vcpkg: [opencv4] Building package opencv4:x64-windows failed

Created on 19 Aug 2020  路  26Comments  路  Source: microsoft/vcpkg

Host Environment

  • OS: [Windows.10]
  • Compiler: revision

To Reproduce
Steps to reproduce the behavior:
.\vcpkg install darknet[full]:x64-windows

Failure logs
-- Using cached G:/vcpkg/downloads/opencv-cache/xfeatures2d/boostdesc/0ae0675534aa318d9668f2a179c2a052-boostdesc_lbgm.i
-- Using cached G:/vcpkg/downloads/opencv-cache/xfeatures2d/vgg/e8d0dcd54d1bcfdc29203d011a797179-vgg_generated_48.i
-- Using cached G:/vcpkg/downloads/opencv-cache/xfeatures2d/vgg/7126a5d9a8884ebca5aea5d63d677225-vgg_generated_64.i
-- Using cached G:/vcpkg/downloads/opencv-cache/xfeatures2d/vgg/7cd47228edec52b6d82f46511af325c5-vgg_generated_80.i
-- Using cached G:/vcpkg/downloads/opencv-cache/xfeatures2d/vgg/151805e03568c9f490a5e3a872777b75-vgg_generated_120.i
-- Using cached G:/vcpkg/downloads/opencv-cache/data/7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat
-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
Command failed: ninja -v
Working Directory: G:/vcpkg/buildtrees/opencv4/x64-windows-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
G:\vcpkg\buildtrees\opencv4\config-x64-windows-out.log

Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:300 (vcpkg_execute_required_process)
ports/opencv4/portfile.cmake:282 (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

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

port-bug

All 26 comments

cc @cenit

Please provide failure log _G:\vcpkg\buildtrees\opencv4\config-x64-windows-out.log_.

config-x64-windows-out.log
@JackBoosY
Thanks

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.

It looks like ffmpeg module is outputting libraries with the optimized/debug keywords, while they are expected with the generator expression syntax?
Maybe a recent PR modified it?
I will look into it...

@chrisgame1002 please also do a git pull to update your vcpkg. Since from the logs CUDA 10.0 is detected and allowed, it means that your vcpkg is not up to date (minimum required now is 10.1)

@cenit I already git pull to update my vcpkg,but also have same problem

Same problem.

@cenit , Hi again..
I downgraded CUDA to 10.2 and python to 3.7

The windows build process for darknet using vcpkg mentioned here failed with

The error happens at this command:
.\vcpkg install darknet[full]:x64-windows

Error : Command failed: ninja -v

```

-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
Command failed: ninja -v
Working Directory: D:/Development_work/vcpkg/buildtrees/opencv4/x64-windows-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
D:\Development_work\vcpkg\buildtrees\opencv4\config-x64-windows-out.log

Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:300 (vcpkg_execute_required_process)
ports/opencv4/portfile.cmake:282 (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

````

Complete logs here:

config-x64-windows-out.log
I thgt downgrading CUDA (as suggested by you here ) would solve build issues .

Many thanks for your great stuff..

When I add feature ffmpeg:
Building package opencv4[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,openexr,opengl,openmp,png,sfm,tiff,webp]:x64-windows...
It also fails at
-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
Command failed: ninja -v
Working Directory: D:/vcpkg/buildtrees/opencv4/x64-windows-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
D:\vcpkg\buildtrees\opencv4\config-x64-windows-out.log

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

The log file

config-x64-windows-out.log

^ as you can see above in the linked PR ([ffmpeg] fix cmake module #13004), I have already submitted a fix for this FFMPEG problem you are encountering.
Unfortunately a broken PR has been accepted and it broke opencv/darknet/many other ports using ffmpeg downstream...

You can already use my PR to shortcut the solution, otherwise wait for its merge. Nowadays my PR are extremely slow to get merged (I have many pending, some urgent like the one related to OpenCV+VTK9 but still waiting). I hope this one is faster...

You can already use my PR to shortcut the solution, otherwise wait for its merge. Nowadays my PR are extremely slow to get merged (I have many pending, some urgent like the one related to OpenCV+VTK9 but still waiting). I hope this one is faster...

And tried building everything from scratch in a clean enviornment.
The windows build process for darknet using vcpkg mentioned here

I ran:

PS Code\>              git clone https://github.com/microsoft/vcpkg
PS Code\>              cd vcpkg
PS Code\vcpkg>         $env:VCPKG_ROOT=$PWD
PS Code\vcpkg>         .\bootstrap-vcpkg.bat

And then changed the 2 files in my environment.
https://github.com/microsoft/vcpkg/pull/13004/files#diff-d4dc1c0937a15714e65d2309b7100c71
and
https://github.com/microsoft/vcpkg/pull/13004/files#diff-c426d2ca016b755cc8653fdb422a1b5d

Then ran .\vcpkg install darknet[full]:x64-windows again, Still fails with this same error.

CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    Command failed: ninja -v
    Working Directory: D:/Development_work/vcpkg/buildtrees/opencv4/x64-windows-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      D:\Development_work\vcpkg\buildtrees\opencv4\config-x64-windows-out.log

Can you upload the log? The PR should fix the ffmpeg error, I want to better understand what鈥檚 the problem now

Can you upload the log? The PR should fix the ffmpeg error, I want to better understand what鈥檚 the problem now

config-x64-windows-out.log

I can see some cmake errors.. so here are those logs as well

CMakeOutput.log
CMakeError.log

It looks like the patchset from #13004 was not correctly applied?

It looks like the patchset from #13004 was not correctly applied?

There were only 2 files changed in ffmpeg right ?
I think I did it correctly..But you may be right... I did try again a clean build with carefully changing the ffmpeg fix.. and this time surprisingly it failed with a different error...

-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/8afa57abc8229d611c4937165d20e2a2d9fc5a12/face_landmark_model.dat...
-- Configuring x64-windows
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:141 (message):
    Command failed: "C:/Program Files/CMake/bin/cmake.exe" --build . --config Debug --target install -- -v
    Working Directory: D:/Development_work/vcpkg/buildtrees/opencv4/x64-windows-dbg
    See logs for more information:
      D:\Development_work\vcpkg\buildtrees\opencv4\install-x64-windows-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:91 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/opencv4/portfile.cmake:371 (vcpkg_install_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

install-x64-windows-dbg-out.log

FAILED: modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/convolution_layer.cpp.obj 
....
D:\Development_work\vcpkg\buildtrees\opencv4\src\4.3.0-0c6047baf6.clean\modules\dnn\src\cuda4dnn\csl\cudnn/transpose_convolution.hpp(38): 
error C2065: 'CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST': undeclared identifier
D:\Development_work\vcpkg\buildtrees\opencv4\src\4.3.0-0c6047baf6.clean\modules\dnn\src\cuda4dnn\csl\cudnn/transpose_convolution.hpp(38): error C2065: 'CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST': undeclared identifier
D:\Development_work\vcpkg\buildtrees\opencv4\src\4.3.0-0c6047baf6.clean\modules\dnn\src\cuda4dnn\csl\cudnn/transpose_convolution.hpp(38): error C2065: 'CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST': undeclared identifier

any help?

13004 works fine. 馃憤 馃憤

13004 works fine. 馃憤 馃憤

Yes, but then I get a different error I mentioned above?

I do not encounter this, for latest version of vcpkg with #13004 PR. I added these features to build :
opencv4[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]

Did you use the very clear environment?

Building package opencv[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]:x64-windows... Could not locate cached archive: C:\Users\Administrator.DESKTOP-05T32PK\AppData\Local\vcpkg/archives\30\3034572fe5bdee26fd2ba258c14bdccdb6770e9d.zip -- Performing post-build validation -- Performing post-build validation done Stored binary cache: C:\Users\Administrator.DESKTOP-05T32PK\AppData\Local\vcpkg/archives\30\3034572fe5bdee26fd2ba258c14bdccdb6770e9d.zip Building package opencv[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]:x64-windows... done Installing package opencv[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]:x64-windows... Installing package opencv[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]:x64-windows... done Elapsed time for package opencv:x64-windows: 4.498 s

I do not encounter this, for latest version of vcpkg with #13004 PR. I added these features to build :
opencv4[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]

Did you use the very clear environment?

Building package opencv[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]:x64-windows... Could not locate cached archive: C:\Users\Administrator.DESKTOP-05T32PK\AppData\Local\vcpkg/archives\30\3034572fe5bdee26fd2ba258c14bdccdb6770e9d.zip -- Performing post-build validation -- Performing post-build validation done Stored binary cache: C:\Users\Administrator.DESKTOP-05T32PK\AppData\Local\vcpkg/archives\30\3034572fe5bdee26fd2ba258c14bdccdb6770e9d.zip Building package opencv[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]:x64-windows... done Installing package opencv[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]:x64-windows... Installing package opencv[contrib,core,cuda,dnn,eigen,ffmpeg,jasper,jpeg,nonfree,openexr,opengl,openmp,png,sfm,tiff,webp]:x64-windows... done Elapsed time for package opencv:x64-windows: 4.498 s

Yes I did on clean install...

Thanks for looking into this.

Did you or can you try this?
.\vcpkg install darknet[full]:x64-windows

does this work?

It works on my computer. I fear that some confusion happened during your cuda11 downgrade

It works on my computer. I fear that some confusion happened during your cuda11 downgrade

Oh that's sad...
I am not sure what to try now.. I am losing sleep over this.. I got to get this working :)

In other option, I had built opencv with cmake and visual studio. everything buit fine.. But still cv2 module is not found when I try to import. I set PATH etc, but still its giving me grief.

I have opened a separate issue to not drag this ffmpeg issue.. I need your help please.
Thanks for your support.

It works on my computer. I fear that some confusion happened during your cuda11 downgrade

I uninstalled everything now.. installed it back cleaning all nvidia directories. but still issue persists mentioned #13077.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

husseinalihazime picture husseinalihazime  路  3Comments

jack17529 picture jack17529  路  3Comments

grandprixgp picture grandprixgp  路  3Comments

pakdel picture pakdel  路  3Comments

jasjuang picture jasjuang  路  3Comments