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

[opencv4[contrib,core,cuda,default-features,dnn,ffmpeg,jpeg,png,quirc,tiff,webp]:x64-windows -> 4.7.0#6] build failure #32673

Closed
Siddhi-agg opened this issue Jul 20, 2023 · 4 comments
Assignees
Labels
requires:repro The issue is not currently repro-able

Comments

@Siddhi-agg
Copy link

Operating system

Windows 11

Compiler

MSVC 19.29.30151.0

Steps to reproduce the behavior

`vcpkg install darknet[full]:x64-windows`

Failure logs

-- Using cached opencv-cache/xfeatures2d/boostdesc/202e1b3e9fec871b04da31f7f016679f-boostdesc_binboost_064.i.
-- Using cached opencv-cache/xfeatures2d/boostdesc/98ea99d399965c03d555cef3ea502a0b-boostdesc_binboost_128.i.
-- Using cached opencv-cache/xfeatures2d/boostdesc/e6dcfa9f647779eb1ce446a8d759b6ea-boostdesc_binboost_256.i.
-- Using cached opencv-cache/xfeatures2d/boostdesc/0ae0675534aa318d9668f2a179c2a052-boostdesc_lbgm.i.
-- Using cached opencv-cache/xfeatures2d/vgg/e8d0dcd54d1bcfdc29203d011a797179-vgg_generated_48.i.
-- Using cached opencv-cache/xfeatures2d/vgg/7126a5d9a8884ebca5aea5d63d677225-vgg_generated_64.i.
-- Using cached opencv-cache/xfeatures2d/vgg/7cd47228edec52b6d82f46511af325c5-vgg_generated_80.i.
-- Using cached opencv-cache/xfeatures2d/vgg/151805e03568c9f490a5e3a872777b75-vgg_generated_120.i.
-- Using cached opencv-cache/data/7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat.
-- Found external ninja('1.10.2').
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
Command failed: C:/Users/ASUS/tmp/vcpkg/downloads/tools/cmake-3.25.1-windows/cmake-3.25.1-windows-i386/bin/cmake.exe --build . --config Release --target install -- -v -j17
Working Directory: C:/Users/ASUS/tmp/vcpkg/buildtrees/opencv4/x64-windows-rel
See logs for more information:
C:\Users\ASUS\tmp\vcpkg\buildtrees\opencv4\install-x64-windows-rel-out.log

Call Stack (most recent call first):
installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
ports/opencv4/portfile.cmake:451 (vcpkg_cmake_install)
scripts/ports.cmake:147 (include)

error: building opencv4:x64-windows failed with: BUILD_FAILED
Elapsed time to handle opencv4:x64-windows: 48 min
Please ensure you're using the latest port files with git pull and vcpkg update.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+opencv4
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[opencv4]+Build+error&body=Copy+issue+body+from+C%3A%2FUsers%2FASUS%2Ftmp%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md

install-x64-windows-rel-out.log

Additional context

I have been trying to install opencv through vcpkg since 2 days. One after the other, it has been running into errors. I can't understand what I'm doing wrong. Please help.

@Siddhi-agg Siddhi-agg added the category:port-bug The issue is with a library, which is something the port should already support label Jul 20, 2023
@MonicaLiu0311 MonicaLiu0311 added requires:repro The issue is not currently repro-able category:port-bug The issue is with a library, which is something the port should already support and removed category:port-bug The issue is with a library, which is something the port should already support requires:repro The issue is not currently repro-able labels Jul 21, 2023
@ImmaturityRules
Copy link

ImmaturityRules commented Jul 21, 2023

It's a bug in opencv - I got opencv4 to build with CUDA 12.2 and cuDNN 8.9.3.28 by following this comment:

opencv/opencv#23893 (comment)

You just need to copy normalize_bbox.hpp and region.hpp to another location and edit them, then copy them to

[vcpkg directory]\buildtrees\opencv4\src\4.7.0-87379d1df6.clean\modules\dnn\src\cuda4dnn\primitives

after opencv4 starts building, because vcpkg deletes and re-extracts the source when the build starts.

@MonicaLiu0311
Copy link
Contributor

MonicaLiu0311 commented Jul 24, 2023

I'm still validating the issue about opencv4.

after opencv4 starts building, because vcpkg deletes and re-extracts the source when the build starts.

It is recommended to use --editable:
You can use ./vcpkg install opencv4 --editable to download a source file without .clen suffix, and then make any modification you need in this source file. When you use ./vcpkg install opencv4 --editable to install again, it will not be cleared and downloaded again, but your modified source file will be executed.

Cleared on every install:
[VCPKG_ROOT]\buildtrees\opencv4\src\4.7.0-87379d1df6.clean
editable:
[VCPKG_ROOT]\buildtrees\opencv4\src\4.7.0-87379d1df6

@MonicaLiu0311
Copy link
Contributor

Sorry I did't repro your issue.

Building opencv4[ade,contrib,core,cuda,cudnn,default-features,dnn,eigen,ffmpeg,freetype,gdcm,gstreamer,ipp,jasper,jpeg,lapack,nonfree,openexr,opengl,openmp,ovis,png,python,qt,quirc,sfm,tbb,tiff,vtk,webp]:x64-windows...
-- Using cached opencv-opencv-4.7.0-1.tar.gz.
-- Extracting source D:/downloads/opencv-opencv-4.7.0-1.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-eigen.patch
-- Applying patch 0005-fix-policy-CMP0057.patch
-- Applying patch 0006-fix-uwp.patch
-- Applying patch 0008-devendor-quirc.patch
-- Applying patch 0009-fix-protobuf.patch
-- Applying patch 0010-fix-uwp-tiff-imgcodecs.patch
-- Applying patch 0011-remove-python2.patch
-- Applying patch 0012-fix-zlib.patch
-- Applying patch 0015-fix-freetype.patch
-- Using source at D:/buildtrees/opencv4/src/4.7.0-87379d1df6.clean
-- Downloading https://www.python.org/ftp/python/3.10.7/python-3.10.7-embed-amd64.zip -> python-3.10.7-embed-amd64.zip...
-- Using cached pypa-get-pip-38e54e5de07c66e875c11a1ebbdb938854625dd8.tar.gz.
-- Extracting source D:/downloads/pypa-get-pip-38e54e5de07c66e875c11a1ebbdb938854625dd8.tar.gz
-- Using source at D:/buildtrees/opencv4/src/8854625dd8-861bd167bd.clean
-- Setting up python virtual environmnent...
-- Installing python packages: numpy
-- Using cached opencv-cache/wechat_qrcode/238e2b2d6f3c18d6c3a30de0c31e23cf-detect.caffemodel.
-- Using cached opencv-cache/wechat_qrcode/cbfcd60361a73beb8c583eea7e8e6664-sr.caffemodel.
-- Using cached opencv-cache/wechat_qrcode/6fb4976b32695f9f5c6305c19f12537d-detect.prototxt.
-- Using cached opencv-cache/wechat_qrcode/69db99927a70df953b471daaba03fbef-sr.prototxt.
-- Using cached opencv-cache/xfeatures2d/boostdesc/0ea90e7a8f3f7876d450e4149c97c74f-boostdesc_bgm.i.
-- Using cached opencv-cache/xfeatures2d/boostdesc/232c966b13651bd0e46a1497b0852191-boostdesc_bgm_bi.i.
-- Using cached opencv-cache/xfeatures2d/boostdesc/324426a24fa56ad9c5b8e3e0b3e5303e-boostdesc_bgm_hd.i.
-- Using cached opencv-cache/xfeatures2d/boostdesc/202e1b3e9fec871b04da31f7f016679f-boostdesc_binboost_064.i.
-- Using cached opencv-cache/xfeatures2d/boostdesc/98ea99d399965c03d555cef3ea502a0b-boostdesc_binboost_128.i.
-- Using cached opencv-cache/xfeatures2d/boostdesc/e6dcfa9f647779eb1ce446a8d759b6ea-boostdesc_binboost_256.i.
-- Using cached opencv-cache/xfeatures2d/boostdesc/0ae0675534aa318d9668f2a179c2a052-boostdesc_lbgm.i.
-- Using cached opencv-cache/xfeatures2d/vgg/e8d0dcd54d1bcfdc29203d011a797179-vgg_generated_48.i.
-- Using cached opencv-cache/xfeatures2d/vgg/7126a5d9a8884ebca5aea5d63d677225-vgg_generated_64.i.
-- Using cached opencv-cache/xfeatures2d/vgg/7cd47228edec52b6d82f46511af325c5-vgg_generated_80.i.
-- Using cached opencv-cache/xfeatures2d/vgg/151805e03568c9f490a5e3a872777b75-vgg_generated_120.i.
-- Using cached opencv-cache/data/7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat.
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_intel64_20191018_general.zip -> opencv-cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip...
-- Found external ninja('1.11.0').
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
-- Using cached mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst.
-- Using msys root at D:/downloads/tools/msys2/6f3fa1a12ef85a6f
-- Installing: D:/packages/opencv4_x64-windows/share/opencv4/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 1.2 min.
Elapsed time to handle opencv4:x64-windows: 1.3 h

@MonicaLiu0311 MonicaLiu0311 added requires:repro The issue is not currently repro-able and removed category:port-bug The issue is with a library, which is something the port should already support labels Jul 27, 2023
@Siddhi-agg
Copy link
Author

You just need to copy normalize_bbox.hpp and region.hpp to another location and edit them, then copy them to

[vcpkg directory]\buildtrees\opencv4\src\4.7.0-87379d1df6.clean\modules\dnn\src\cuda4dnn\primitives

after opencv4 starts building, because vcpkg deletes and re-extracts the source when the build starts.

I tried this on my system, and the installation went a little ahead than the last time but it failed again after about 1.4 hrs with a build failure.

You can use ./vcpkg install opencv4 --editable to download a source file without .clen suffix

Then I tried to download opencv4 individually using --editable, which again failed with an error.

Installing 9/9 opencv4:x86-windows...
Building opencv4[core,default-features,dnn,jpeg,png,quirc,tiff,webp]:x86-windows...
-- Using cached opencv-opencv-4.7.0-1.tar.gz.
-- Extracting source C:/Users/ASUS/tmp/vcpkg/downloads/opencv-opencv-4.7.0-1.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-eigen.patch
-- Applying patch 0005-fix-policy-CMP0057.patch
-- Applying patch 0006-fix-uwp.patch
-- Applying patch 0008-devendor-quirc.patch
-- Applying patch 0009-fix-protobuf.patch
-- Applying patch 0010-fix-uwp-tiff-imgcodecs.patch
-- Applying patch 0011-remove-python2.patch
-- Applying patch 0012-fix-zlib.patch
-- Applying patch 0015-fix-freetype.patch
-- Using source at C:/Users/ASUS/tmp/vcpkg/buildtrees/opencv4/src/4.7.0-87379d1df6
-- Using cached opencv-cache/tiny_dnn/adb1c512e09ca2c7a6faef36f9c53e59-v1.0.0a3.tar.gz.
-- Found external ninja('1.10.2').
-- Configuring x86-windows
-- Building x86-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
Command failed: C:/Users/ASUS/tmp/vcpkg/downloads/tools/cmake-3.25.1-windows/cmake-3.25.1-windows-i386/bin/cmake.exe --build . --config Debug --target install -- -v -j17
Working Directory: C:/Users/ASUS/tmp/vcpkg/buildtrees/opencv4/x86-windows-dbg
See logs for more information:
C:\Users\ASUS\tmp\vcpkg\buildtrees\opencv4\install-x86-windows-dbg-out.log

Call Stack (most recent call first):
installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
ports/opencv4/portfile.cmake:451 (vcpkg_cmake_install)
scripts/ports.cmake:147 (include)

error: building opencv4:x86-windows failed with: BUILD_FAILED
Elapsed time to handle opencv4:x86-windows: 1.4 min
internal error: D:\a_work\1\s\src\vcpkg\commands.build.cpp(1511): Value was null
Please open an issue at https://github.com/microsoft/vcpkg/issues/new?template=other-type-of-bug-report.md&labels=category:vcpkg-bug with detailed steps to reproduce the problem.

Then just for the sake of trying I ran .\vcpkg install darknet[full]:x64-windows again, and the build was successful. I'm clueless about what happened, but the error was solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:repro The issue is not currently repro-able
Projects
None yet
Development

No branches or pull requests

3 participants