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 0.46.0 fails to build on Windows #177

Closed
not-matthias opened this issue Oct 29, 2020 · 7 comments
Closed

OpenCV 0.46.0 fails to build on Windows #177

not-matthias opened this issue Oct 29, 2020 · 7 comments

Comments

@not-matthias
Copy link

I have noticed that the build failed, when I upgraded the crate version from 0.43 to 0.46. Turns out that the last crate version where the build is working, is 0.45. I'm just going to use the working crate version for now, but I still wanted to report the issue so it can get fixed.

Details

OS: Windows 10 - 10.0.18363
OpenCV: Manual Installation (4.4.0)
Rustc Version: rustc 1.49.0-nightly (043eca7f0 2020-10-17)

Output of `RUST_BACKTRACE=full cargo build -vv` Fresh glob v0.3.0 Fresh lazy_static v1.4.0 Fresh regex-syntax v0.6.18 Fresh jobserver v0.1.21 Fresh once_cell v1.4.1 Fresh percent-encoding v2.1.0 Fresh dunce v1.0.1 Fresh semver-parser v0.7.0 Fresh autocfg v1.0.1 Fresh maplit v1.0.2 Fresh pkg-config v0.3.18 Fresh vcpkg v0.2.10 Fresh shlex v0.1.1 Fresh fps_counter v1.0.0 Fresh thread_local v1.0.1 Fresh cc v1.0.61 Fresh semver v0.10.0 Fresh libc v0.2.79 Fresh memchr v2.3.3 Fresh clang-sys v1.0.1 Fresh aho-corasick v0.7.13 Fresh clang v1.0.2 Fresh num-traits v0.2.12 Fresh regex v1.3.9 Fresh opencv-binding-generator v0.21.2 Compiling opencv v0.46.1 Running `E:\\target\debug\build\opencv-297088976bff4022\build-script-build` [opencv 0.46.1] === Crate version: Some("0.46.1") [opencv 0.46.1] === Environment configuration: [opencv 0.46.1] === OPENCV_HEADER_DIR = None [opencv 0.46.1] === OPENCV_PACKAGE_NAME = None [opencv 0.46.1] === OPENCV_PKGCONFIG_NAME = None [opencv 0.46.1] === OPENCV_CMAKE_NAME = None [opencv 0.46.1] === OPENCV_CMAKE_BIN = None [opencv 0.46.1] === OPENCV_VCPKG_NAME = None [opencv 0.46.1] === OPENCV_LINK_LIBS = None [opencv 0.46.1] === OPENCV_LINK_PATHS = None [opencv 0.46.1] === OPENCV_INCLUDE_PATHS = None [opencv 0.46.1] === OPENCV_DISABLE_PROBES = None [opencv 0.46.1] === OPENCV_CLANG_STDLIB_PATH = None [opencv 0.46.1] === OPENCV_MODULE_WHITELIST = None [opencv 0.46.1] === OPENCV_MODULE_BLACKLIST = None [opencv 0.46.1] === CMAKE_PREFIX_PATH = None [opencv 0.46.1] === OpenCV_DIR = Some("C:\\libs\\opencv_custom\\build\\install\\x64\\vc16") [opencv 0.46.1] === PKG_CONFIG_PATH = None [opencv 0.46.1] === VCPKG_ROOT = Some("C:\\libs\\vcpkg") [opencv 0.46.1] === VCPKGRS_DYNAMIC = None [opencv 0.46.1] === Enabled features: [opencv 0.46.1] === BINDING_GENERATOR [opencv 0.46.1] === BUILDTIME_BINDGEN [opencv 0.46.1] === CLANG [opencv 0.46.1] === CONTRIB [opencv 0.46.1] === DEFAULT [opencv 0.46.1] === JOBSERVER [opencv 0.46.1] === OPENCV_4 [opencv 0.46.1] === Probing the OpenCV library in the following order: environment, cmake, vcpkg_cmake, vcpkg, pkg_config [opencv 0.46.1] === Can't probe using: environment, continuing with other methods because: Some environment variables are missing [opencv 0.46.1] === Probing OpenCV library using cmake [opencv 0.46.1] === cmake ninja probe command: "cmake" "--log-level=NOTICE" "-S" "C:\\Users\\admin\\.cargo\\registry\\src\\git.luolix.top-1ecc6299db9ec823\\opencv-0.46.1\\cmake" "-DOCVRS_PACKAGE_NAME=OpenCV" "-DCMAKE_BUILD_TYPE=Debug" "-G" "Ninja" [opencv 0.46.1] === Probing with cmake ninja generator failed, will try makefile generator, error: cmake returned an error [opencv 0.46.1] stdout: "-- Configuring incomplete, errors occurred!\nSee also \"E://target/debug/build/opencv-9744ad7b399dae54/out/cmake_probe_build/CMakeFiles/CMakeOutput.log\".\n" [opencv 0.46.1] stderr: "CMake Error: CMake was unable to find a build program corresponding to \"Ninja\". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.\nCMake Error: CMAKE_C_COMPILER not set, after EnableLanguage\nCMake Error: CMAKE_CXX_COMPILER not set, after EnableL anguage\n" [opencv 0.46.1] === cmake makefiles probe command: "cmake" "--log-level=NOTICE" "-S" "C:\\Users\\admin\\.cargo\\registry\\src\\git.luolix.top-1ecc6299db9ec823\\opencv-0.46.1\\cmake" "-DOCVRS_PACKAGE_NAME=OpenCV" "-DCMAKE_BUILD_TYPE=Debug" "-G" "Unix Makefiles" [opencv 0.46.1] === Can't probe using: cmake, continuing with other methods because: cmake returned an error [opencv 0.46.1] stdout: "-- Configuring incomplete, errors occurred!\nSee also \"E://target/debug/build/opencv-9744ad7b399dae54/out/cmake_probe_build/CMakeFiles/CMakeOutput.log\".\n" [opencv 0.46.1] stderr: "CMake Error: CMake was unable to find a build program corresponding to \"Unix Makefiles\". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.\nCMake Error: CMAKE_C_COMPILER not set, after EnableLanguage\nCMake Error: CMAKE_CXX_COMPILER not set, afte r EnableLanguage\n" [opencv 0.46.1] === Probing OpenCV library using vcpkg [opencv 0.46.1] === Can't probe using: vcpkg_cmake, continuing with other methods because: The system cannot find the file specified. (os error 2) [opencv 0.46.1] === Probing OpenCV library using vcpkg [opencv 0.46.1] === Can't probe using: vcpkg, continuing with other methods because: Could not find Vcpkg tree: Could not find Vcpkg root at C:\libs\vcpkg\.vcpkg-root [opencv 0.46.1] === Probing OpenCV library using pkg_config [opencv 0.46.1] cargo:rerun-if-env-changed=OPENCV4_NO_PKG_CONFIG [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG [opencv 0.46.1] cargo:rerun-if-env-changed=OPENCV4_STATIC [opencv 0.46.1] cargo:rerun-if-env-changed=OPENCV4_DYNAMIC [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-msvc [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc [opencv 0.46.1] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_PATH [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-msvc [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc [opencv 0.46.1] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-msvc [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc [opencv 0.46.1] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR [opencv 0.46.1] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR [opencv 0.46.1] === Can't probe using: pkg_config, continuing with other methods because: Failed to run `"pkg-config" "--libs" "--cflags" "opencv4"`: The system cannot find the file specified. (os error 2) [opencv 0.46.1] Error: "Failed to find OpenCV package using probes: environment, cmake, vcpkg_cmake, vcpkg, pkg_config" error: failed to run custom build command for `opencv v0.46.1`

Caused by:
process didn't exit successfully: E:\<removed>\target\debug\build\opencv-297088976bff4022\build-script-build (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=OPENCV4_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=OPENCV4_STATIC
cargo:rerun-if-env-changed=OPENCV4_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

--- stderr
=== Crate version: Some("0.46.1")
=== Environment configuration:
=== OPENCV_HEADER_DIR = None
=== OPENCV_PACKAGE_NAME = None
=== OPENCV_PKGCONFIG_NAME = None
=== OPENCV_CMAKE_NAME = None
=== OPENCV_CMAKE_BIN = None
=== OPENCV_VCPKG_NAME = None
=== OPENCV_LINK_LIBS = None
=== OPENCV_LINK_PATHS = None
=== OPENCV_INCLUDE_PATHS = None
=== OPENCV_DISABLE_PROBES = None
=== OPENCV_CLANG_STDLIB_PATH = None
=== OPENCV_MODULE_WHITELIST = None
=== OPENCV_MODULE_BLACKLIST = None
=== CMAKE_PREFIX_PATH = None
=== OpenCV_DIR = Some("C:\libs\opencv_custom\build\install\x64\vc16")
=== PKG_CONFIG_PATH = None
=== VCPKG_ROOT = Some("C:\libs\vcpkg")
=== VCPKGRS_DYNAMIC = None
=== Enabled features:
=== BINDING_GENERATOR
=== BUILDTIME_BINDGEN
=== CLANG
=== CONTRIB
=== DEFAULT
=== JOBSERVER
=== OPENCV_4
=== Probing the OpenCV library in the following order: environment, cmake, vcpkg_cmake, vcpkg, pkg_config
=== Can't probe using: environment, continuing with other methods because: Some environment variables are missing
=== Probing OpenCV library using cmake
=== cmake ninja probe command: "cmake" "--log-level=NOTICE" "-S" "C:\Users\admin\.cargo\registry\src\git.luolix.top-1ecc6299db9ec823\opencv-0.46.1\cmake" "-DOCVRS_PACKAGE_NAME=OpenCV" "-DCMAKE_BUILD_TYPE=Debug" "-G" "Ninja"
=== Probing with cmake ninja generator failed, will try makefile generator, error: cmake returned an error
stdout: "-- Configuring incomplete, errors occurred!\nSee also "E://target/debug/build/opencv-9744ad7b399dae54/out/cmake_probe_build/CMakeFiles/CMakeOutput.log".\n"
stderr: "CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.\nCMake Error: CMAKE_C_COMPILER not set, after EnableLanguage\nCMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage\n"
=== cmake makefiles probe command: "cmake" "--log-level=NOTICE" "-S" "C:\Users\admin\.cargo\registry\src\git.luolix.top-1ecc6299db9ec823\opencv-0.46.1\cmake" "-DOCVRS_PACKAGE_NAME=OpenCV" "-DCMAKE_BUILD_TYPE=Debug" "-G" "Unix Makefiles"
=== Can't probe using: cmake, continuing with other methods because: cmake returned an error
stdout: "-- Configuring incomplete, errors occurred!\nSee also "E://target/debug/build/opencv-9744ad7b399dae54/out/cmake_probe_build/CMakeFiles/CMakeOutput.log".\n"
stderr: "CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.\nCMake Error: CMAKE_C_COMPILER not set, after EnableLanguage\nCMake Error: CMAKE_CXX_COMPILER not set, after EnableLangua
ge\n"
=== Probing OpenCV library using vcpkg
=== Can't probe using: vcpkg_cmake, continuing with other methods because: The system cannot find the file specified. (os error 2)
=== Probing OpenCV library using vcpkg
=== Can't probe using: vcpkg, continuing with other methods because: Could not find Vcpkg tree: Could not find Vcpkg root at C:\libs\vcpkg.vcpkg-root
=== Probing OpenCV library using pkg_config
=== Can't probe using: pkg_config, continuing with other methods because: Failed to run "pkg-config" "--libs" "--cflags" "opencv4": The system cannot find the file specified. (os error 2)
Error: "Failed to find OpenCV package using probes: environment, cmake, vcpkg_cmake, vcpkg, pkg_config"

@twistedfall
Copy link
Owner

Hi, thank you for the report! Can you please show the same build log, but from the v0.45 version, which builds fine. I wonder what the difference is.

@not-matthias
Copy link
Author

The build log using 0.45 looks like this:

E:\<removed>>cargo build -vv
       Fresh glob v0.3.0
       Fresh lazy_static v1.4.0
       Fresh regex-syntax v0.6.18
       Fresh dunce v1.0.1
       Fresh jobserver v0.1.21
       Fresh autocfg v1.0.1
       Fresh maplit v1.0.2
       Fresh percent-encoding v2.1.0
       Fresh once_cell v1.4.1
       Fresh semver-parser v0.7.0
       Fresh shlex v0.1.1
       Fresh pkg-config v0.3.18
       Fresh vcpkg v0.2.10
       Fresh fps_counter v1.0.0
       Fresh thread_local v1.0.1
       Fresh cc v1.0.61
       Fresh semver v0.10.0
       Fresh memchr v2.3.3
       Fresh libc v0.2.79
       Fresh aho-corasick v0.7.13
       Fresh clang-sys v1.0.1
       Fresh regex v1.3.9
       Fresh num-traits v0.2.12
       Fresh clang v1.0.2
       Fresh opencv-binding-generator v0.20.0
       Fresh opencv v0.45.1
       Fresh <removed> v0.1.0 (E:\<removed>)
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s

@twistedfall
Copy link
Owner

Can you please do a cargo clean before running it? So that the build log from the OpenCV crate is seen.

@not-matthias
Copy link
Author

Oh, my bad. Here's the new build log of 0.45: opencv_log.txt

@twistedfall
Copy link
Owner

Will you be able to check out cmake_find_package branch and test if it works for you?

@not-matthias
Copy link
Author

not-matthias commented Oct 30, 2020

The branch cmake_find_package works. 👍

@twistedfall
Copy link
Owner

Fixed in v0.46.2

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

No branches or pull requests

2 participants