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

Build fails on M2 Mac with brew opencv and 0.77.0 #428

Closed
hansg60 opened this issue Feb 19, 2023 · 14 comments
Closed

Build fails on M2 Mac with brew opencv and 0.77.0 #428

hansg60 opened this issue Feb 19, 2023 · 14 comments

Comments

@hansg60
Copy link

hansg60 commented Feb 19, 2023

  1. MacOS 13.2.1
  2. brew install opencv@4
  3. opencv--4.7.0_1
  4. rustc 1.67.1 (d5a82bbd2 2023-02-07)
  5. See attached file

cargo-build-output.txt

Anyone have an idea about what I'm doing wrong?

Here's a snippet from compile output file:

[opencv 0.77.0] === Compiling opencv-binding-generator v0.56.0
[opencv 0.77.0] === Finished release [optimized] target(s) in 9.21s
[opencv 0.77.0] === Running: "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out/release/binding-generator" "/usr/local/opt/opencv/include/opencv4" "/Users/hans/.cargo/registry/src/github.com-1ecc6299db9ec823/opencv-0.77.0/src_cpp" "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out" "alphamat" ""
[opencv 0.77.0] === Running: "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out/release/binding-generator" "/usr/local/opt/opencv/include/opencv4" "/Users/hans/.cargo/registry/src/github.com-1ecc6299db9ec823/opencv-0.77.0/src_cpp" "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out" "aruco" ""
[opencv 0.77.0] === Running: "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out/release/binding-generator" "/usr/local/opt/opencv/include/opencv4" "/Users/hans/.cargo/registry/src/github.com-1ecc6299db9ec823/opencv-0.77.0/src_cpp" "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out" "barcode" ""
[opencv 0.77.0] === Running: "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out/release/binding-generator" "/usr/local/opt/opencv/include/opencv4" "/Users/hans/.cargo/registry/src/github.com-1ecc6299db9ec823/opencv-0.77.0/src_cpp" "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out" "bgsegm" ""
[opencv 0.77.0] === Running: "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out/release/binding-generator" "/usr/local/opt/opencv/include/opencv4" "/Users/hans/.cargo/registry/src/github.com-1ecc6299db9ec823/opencv-0.77.0/src_cpp" "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out" "bioinspired" ""
[opencv 0.77.0] === Running: "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out/release/binding-generator" "/usr/local/opt/opencv/include/opencv4" "/Users/hans/.cargo/registry/src/github.com-1ecc6299db9ec823/opencv-0.77.0/src_cpp" "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out" "ccalib" ""
[opencv 0.77.0] === Running: "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out/release/binding-generator" "/usr/local/opt/opencv/include/opencv4" "/Users/hans/.cargo/registry/src/github.com-1ecc6299db9ec823/opencv-0.77.0/src_cpp" "/Users/hans/Rust/vision/target/debug/build/opencv-f393635b647aecd4/out" "calib3d" ""
[opencv 0.77.0] === WARNING: 5 diagnostic messages
[opencv 0.77.0] === /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/chrono:1583:12: error: reference to unresolved using declaration
[opencv 0.77.0] === /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/chrono:1584:35: error: reference to unresolved using declaration
[opencv 0.77.0] === /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/chrono:2951:10: error: reference to unresolved using declaration
[opencv 0.77.0] === /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/chrono:2958:33: error: reference to unresolved using declaration
[opencv 0.77.0] === /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__threading_support:277:28: error: incomplete result type '__libcpp_timespec_t' (aka 'timespec') in function definition
[opencv 0.77.0] thread 'main' panicked at '=== Errors during header parsing', /Users/hans/.cargo/registry/src/github.com-1ecc6299db9ec823/opencv-binding-generator-0.56.0/src/generator.rs:512:17

@hansg60 hansg60 changed the title Building on MacOS with brew opencv and 0.77.0 Problem building on MacOS with brew opencv and 0.77.0 Feb 20, 2023
@hansg60 hansg60 changed the title Problem building on MacOS with brew opencv and 0.77.0 Build fails on M2 Mac with brew opencv and 0.77.0 Feb 22, 2023
@wangm23456
Copy link

and M1 pro

@hansg60
Copy link
Author

hansg60 commented Mar 1, 2023

and M1 pro

@wangm23456 are you seeing the same error message that I reported above?

@wangm23456
Copy link

and M1 pro

@wangm23456 are you seeing the same error message that I reported above?

yes, both 0.77 and 0.78

@wangm23456
Copy link

wangm23456 commented Mar 13, 2023

May be here:

let mut bin_generator = match HOST_TRIPLE.as_ref() {
Some(host_triple) => Command::new(OUT_DIR.join(format!("{host_triple}/release/binding-generator"))),
None => Command::new(OUT_DIR.join("release/binding-generator")),
};

@wangm23456
Copy link

wangm23456 commented Mar 13, 2023

"bindings-generator" is actually at OUT_DIR.join("aarch64-apple-darwin/release/binding-generator"
image

static HOST_TRIPLE: Lazy<Option<String>> = Lazy::new(|| env::var("HOST_TRIPLE").ok());

HOST_TRIPLE.as_ref() may be None

@wangm23456
Copy link

this: #417 (comment)
@hansg60 @twistedfall

@twistedfall
Copy link
Owner

Thanks for the followup! Let me investigate this asap. Although the error you're getting is different from the one from the topic starter.

@aaqidmasoodi
Copy link
Contributor

I am not able to build.
i did brew install opencv

but the build fails. I am on macbook air M2
I am getting into rust and i am not super comfy with it yet but if there is any other additional info i can provide please do ask.

@twistedfall
Copy link
Owner

Can you please attach the output of cargo build -vv?

@aaqidmasoodi
Copy link
Contributor

Forgive me if I have done something stupid but here Is the output of the cargo build -vv. I am very new to rust.

       Fresh glob v0.3.1
       Fresh memchr v2.6.3
       Fresh regex-syntax v0.7.5
       Fresh once_cell v1.18.0
       Fresh autocfg v1.1.0
       Fresh dunce v1.0.4
       Fresh libc v0.2.147
       Fresh aho-corasick v1.0.5
       Fresh percent-encoding v2.3.0
       Fresh shlex v1.2.0
       Fresh pkg-config v0.3.27
       Fresh regex-automata v0.3.8
       Fresh jobserver v0.1.26
       Fresh semver v1.0.18
       Fresh vcpkg v0.2.15
       Fresh clang-sys v1.6.1
       Fresh regex v1.9.5
       Fresh cc v1.0.79
       Fresh num-traits v0.2.16
       Fresh clang v2.0.0
       Fresh opencv-binding-generator v0.72.0
   Compiling opencv v0.84.5
     Running `/Users/aaqidmasoodi/Documents/rust projects/learn-rust/target/debug/build/opencv-c6e35606d3c22d4a/build-script-build`
[opencv 0.84.5] === Crate version: Some("0.84.5")
[opencv 0.84.5] === Environment configuration:
[opencv 0.84.5] ===   OPENCV_PACKAGE_NAME = None
[opencv 0.84.5] ===   OPENCV_PKGCONFIG_NAME = None
[opencv 0.84.5] ===   OPENCV_CMAKE_NAME = None
[opencv 0.84.5] ===   OPENCV_CMAKE_BIN = None
[opencv 0.84.5] ===   OPENCV_VCPKG_NAME = None
[opencv 0.84.5] ===   OPENCV_LINK_LIBS = Some("/opt/homebrew/Cellar/opencv/4.8.0_4/lib")
[opencv 0.84.5] ===   OPENCV_LINK_PATHS = Some("/opt/homebrew/Cellar/opencv/4.8.0_4/share/opencv4")
[opencv 0.84.5] ===   OPENCV_INCLUDE_PATHS = Some("/opt/homebrew/Cellar/opencv/4.8.0_4/include")
[opencv 0.84.5] ===   OPENCV_DISABLE_PROBES = None
[opencv 0.84.5] ===   OPENCV_MSVC_CRT = None
[opencv 0.84.5] ===   CMAKE_PREFIX_PATH = None
[opencv 0.84.5] ===   OpenCV_DIR = None
[opencv 0.84.5] ===   PKG_CONFIG_PATH = None
[opencv 0.84.5] ===   VCPKG_ROOT = None
[opencv 0.84.5] ===   VCPKGRS_DYNAMIC = None
[opencv 0.84.5] ===   VCPKGRS_TRIPLET = None
[opencv 0.84.5] ===   OCVRS_DOCS_GENERATE_DIR = None
[opencv 0.84.5] ===   DOCS_RS = None
[opencv 0.84.5] ===   PATH = Some("/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/aaqidmasoodi/.cargo/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin")
[opencv 0.84.5] === Enabled features:
[opencv 0.84.5] ===   ALPHAMAT
[opencv 0.84.5] ===   ARUCO
[opencv 0.84.5] ===   ARUCO_DETECTOR
[opencv 0.84.5] ===   BARCODE
[opencv 0.84.5] ===   BGSEGM
[opencv 0.84.5] ===   BIOINSPIRED
[opencv 0.84.5] ===   CALIB3D
[opencv 0.84.5] ===   CCALIB
[opencv 0.84.5] ===   CUDAARITHM
[opencv 0.84.5] ===   CUDABGSEGM
[opencv 0.84.5] ===   CUDACODEC
[opencv 0.84.5] ===   CUDAFEATURES2D
[opencv 0.84.5] ===   CUDAFILTERS
[opencv 0.84.5] ===   CUDAIMGPROC
[opencv 0.84.5] ===   CUDAOBJDETECT
[opencv 0.84.5] ===   CUDAOPTFLOW
[opencv 0.84.5] ===   CUDASTEREO
[opencv 0.84.5] ===   CUDAWARPING
[opencv 0.84.5] ===   CVV
[opencv 0.84.5] ===   DEFAULT
[opencv 0.84.5] ===   DNN
[opencv 0.84.5] ===   DNN_SUPERRES
[opencv 0.84.5] ===   DPM
[opencv 0.84.5] ===   FACE
[opencv 0.84.5] ===   FEATURES2D
[opencv 0.84.5] ===   FLANN
[opencv 0.84.5] ===   FREETYPE
[opencv 0.84.5] ===   FUZZY
[opencv 0.84.5] ===   GAPI
[opencv 0.84.5] ===   HDF
[opencv 0.84.5] ===   HFS
[opencv 0.84.5] ===   HIGHGUI
[opencv 0.84.5] ===   IMGCODECS
[opencv 0.84.5] ===   IMGPROC
[opencv 0.84.5] ===   IMG_HASH
[opencv 0.84.5] ===   INTENSITY_TRANSFORM
[opencv 0.84.5] ===   LINE_DESCRIPTOR
[opencv 0.84.5] ===   MCC
[opencv 0.84.5] ===   ML
[opencv 0.84.5] ===   OBJDETECT
[opencv 0.84.5] ===   OPTFLOW
[opencv 0.84.5] ===   OVIS
[opencv 0.84.5] ===   PHASE_UNWRAPPING
[opencv 0.84.5] ===   PHOTO
[opencv 0.84.5] ===   PLOT
[opencv 0.84.5] ===   QUALITY
[opencv 0.84.5] ===   RAPID
[opencv 0.84.5] ===   RGBD
[opencv 0.84.5] ===   SALIENCY
[opencv 0.84.5] ===   SFM
[opencv 0.84.5] ===   SHAPE
[opencv 0.84.5] ===   STEREO
[opencv 0.84.5] ===   STITCHING
[opencv 0.84.5] ===   STRUCTURED_LIGHT
[opencv 0.84.5] ===   SUPERRES
[opencv 0.84.5] ===   SURFACE_MATCHING
[opencv 0.84.5] ===   TEXT
[opencv 0.84.5] ===   TRACKING
[opencv 0.84.5] ===   VIDEO
[opencv 0.84.5] ===   VIDEOIO
[opencv 0.84.5] ===   VIDEOSTAB
[opencv 0.84.5] ===   VIZ
[opencv 0.84.5] ===   WECHAT_QRCODE
[opencv 0.84.5] ===   XFEATURES2D
[opencv 0.84.5] ===   XIMGPROC
[opencv 0.84.5] ===   XOBJDETECT
[opencv 0.84.5] ===   XPHOTO
[opencv 0.84.5] === Detected probe priority based on environment vars: pkg_config: false, cmake: false, vcpkg: false
[opencv 0.84.5] === Probing the OpenCV library in the following order: environment, pkg_config, cmake, vcpkg_cmake, vcpkg
[opencv 0.84.5] === Configuring OpenCV library from the environment:
[opencv 0.84.5] ===   include_paths: /opt/homebrew/Cellar/opencv/4.8.0_4/include
[opencv 0.84.5] ===   link_paths: /opt/homebrew/Cellar/opencv/4.8.0_4/share/opencv4
[opencv 0.84.5] ===   link_libs: /opt/homebrew/Cellar/opencv/4.8.0_4/lib
[opencv 0.84.5] === Successfully probed using: environment
[opencv 0.84.5] === OpenCV library configuration: Library {
[opencv 0.84.5]     include_paths: [
[opencv 0.84.5]         "/opt/homebrew/Cellar/opencv/4.8.0_4/include",
[opencv 0.84.5]     ],
[opencv 0.84.5]     version: Version {
[opencv 0.84.5]         major: 0,
[opencv 0.84.5]         minor: 0,
[opencv 0.84.5]         patch: 0,
[opencv 0.84.5]     },
[opencv 0.84.5]     cargo_metadata: [
[opencv 0.84.5]         "cargo:rustc-link-search=/opt/homebrew/Cellar/opencv/4.8.0_4/share/opencv4",
[opencv 0.84.5]         "cargo:rustc-link-search=framework=/opt/homebrew/Cellar/opencv/4.8.0_4/share/opencv4",
[opencv 0.84.5]         "cargo:rustc-link-lib=",
[opencv 0.84.5]     ],
[opencv 0.84.5] }
[opencv 0.84.5] thread 'main' panicked at 'Unsupported OpenCV version: 0.0.0, must be from 3.2, 3.4 or 4.x branch', /Users/aaqidmasoodi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/build.rs:354:9
[opencv 0.84.5] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to run custom build command for `opencv v0.84.5`

Caused by:
  process didn't exit successfully: `/Users/aaqidmasoodi/Documents/rust projects/learn-rust/target/debug/build/opencv-c6e35606d3c22d4a/build-script-build` (exit status: 101)
  --- stderr
  === Crate version: Some("0.84.5")
  === Environment configuration:
  ===   OPENCV_PACKAGE_NAME = None
  ===   OPENCV_PKGCONFIG_NAME = None
  ===   OPENCV_CMAKE_NAME = None
  ===   OPENCV_CMAKE_BIN = None
  ===   OPENCV_VCPKG_NAME = None
  ===   OPENCV_LINK_LIBS = Some("/opt/homebrew/Cellar/opencv/4.8.0_4/lib")
  ===   OPENCV_LINK_PATHS = Some("/opt/homebrew/Cellar/opencv/4.8.0_4/share/opencv4")
  ===   OPENCV_INCLUDE_PATHS = Some("/opt/homebrew/Cellar/opencv/4.8.0_4/include")
  ===   OPENCV_DISABLE_PROBES = None
  ===   OPENCV_MSVC_CRT = None
  ===   CMAKE_PREFIX_PATH = None
  ===   OpenCV_DIR = None
  ===   PKG_CONFIG_PATH = None
  ===   VCPKG_ROOT = None
  ===   VCPKGRS_DYNAMIC = None
  ===   VCPKGRS_TRIPLET = None
  ===   OCVRS_DOCS_GENERATE_DIR = None
  ===   DOCS_RS = None
  ===   PATH = Some("/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/opt/qt@5/bin:/usr/local/opt/qt/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims:/usr/local/mysql/bin:/Users/aaqidmasoodi/.nvm/versions/node/v16.20.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/aaqidmasoodi/.cargo/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin:/Users/aaqidmasoodi/Library/Android/sdk/tools:/Users/aaqidmasoodi/Library/Android/sdk/platform-tools:/emulator:/tools/bin")
  === Enabled features:
  ===   ALPHAMAT
  ===   ARUCO
  ===   ARUCO_DETECTOR
  ===   BARCODE
  ===   BGSEGM
  ===   BIOINSPIRED
  ===   CALIB3D
  ===   CCALIB
  ===   CUDAARITHM
  ===   CUDABGSEGM
  ===   CUDACODEC
  ===   CUDAFEATURES2D
  ===   CUDAFILTERS
  ===   CUDAIMGPROC
  ===   CUDAOBJDETECT
  ===   CUDAOPTFLOW
  ===   CUDASTEREO
  ===   CUDAWARPING
  ===   CVV
  ===   DEFAULT
  ===   DNN
  ===   DNN_SUPERRES
  ===   DPM
  ===   FACE
  ===   FEATURES2D
  ===   FLANN
  ===   FREETYPE
  ===   FUZZY
  ===   GAPI
  ===   HDF
  ===   HFS
  ===   HIGHGUI
  ===   IMGCODECS
  ===   IMGPROC
  ===   IMG_HASH
  ===   INTENSITY_TRANSFORM
  ===   LINE_DESCRIPTOR
  ===   MCC
  ===   ML
  ===   OBJDETECT
  ===   OPTFLOW
  ===   OVIS
  ===   PHASE_UNWRAPPING
  ===   PHOTO
  ===   PLOT
  ===   QUALITY
  ===   RAPID
  ===   RGBD
  ===   SALIENCY
  ===   SFM
  ===   SHAPE
  ===   STEREO
  ===   STITCHING
  ===   STRUCTURED_LIGHT
  ===   SUPERRES
  ===   SURFACE_MATCHING
  ===   TEXT
  ===   TRACKING
  ===   VIDEO
  ===   VIDEOIO
  ===   VIDEOSTAB
  ===   VIZ
  ===   WECHAT_QRCODE
  ===   XFEATURES2D
  ===   XIMGPROC
  ===   XOBJDETECT
  ===   XPHOTO
  === Detected probe priority based on environment vars: pkg_config: false, cmake: false, vcpkg: false
  === Probing the OpenCV library in the following order: environment, pkg_config, cmake, vcpkg_cmake, vcpkg
  === Configuring OpenCV library from the environment:
  ===   include_paths: /opt/homebrew/Cellar/opencv/4.8.0_4/include
  ===   link_paths: /opt/homebrew/Cellar/opencv/4.8.0_4/share/opencv4
  ===   link_libs: /opt/homebrew/Cellar/opencv/4.8.0_4/lib
  === Successfully probed using: environment
  === OpenCV library configuration: Library {
      include_paths: [
          "/opt/homebrew/Cellar/opencv/4.8.0_4/include",
      ],
      version: Version {
          major: 0,
          minor: 0,
          patch: 0,
      },
      cargo_metadata: [
          "cargo:rustc-link-search=/opt/homebrew/Cellar/opencv/4.8.0_4/share/opencv4",
          "cargo:rustc-link-search=framework=/opt/homebrew/Cellar/opencv/4.8.0_4/share/opencv4",
          "cargo:rustc-link-lib=",
      ],
  }
  thread 'main' panicked at 'Unsupported OpenCV version: 0.0.0, must be from 3.2, 3.4 or 4.x branch', /Users/aaqidmasoodi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/build.rs:354:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@twistedfall
Copy link
Owner

Can you show the contents of the /opt/homebrew/Cellar/opencv/4.8.0_4/include directory?

@aaqidmasoodi
Copy link
Contributor

Contents of the dir. we are connected via two difference threads.
I'll close the other one if you say

aaqidmasoodi@Aaqids-MacBook-Air include % pwd
/opt/homebrew/Cellar/opencv/4.8.0_4/include
aaqidmasoodi@Aaqids-MacBook-Air include % ls
opencv4
aaqidmasoodi@Aaqids-MacBook-Air include % cd opencv4 
aaqidmasoodi@Aaqids-MacBook-Air opencv4 % ls
opencv2
aaqidmasoodi@Aaqids-MacBook-Air opencv4 % cd opencv2 
aaqidmasoodi@Aaqids-MacBook-Air opencv2 % ls
alphamat.hpp		img_hash		sfm.hpp
aruco			img_hash.hpp		shape
aruco.hpp		imgcodecs		shape.hpp
bgsegm.hpp		imgcodecs.hpp		stereo
bioinspired		imgproc			stereo.hpp
bioinspired.hpp		imgproc.hpp		stitching
calib3d			intensity_transform.hpp	stitching.hpp
calib3d.hpp		line_descriptor		structured_light
ccalib			line_descriptor.hpp	structured_light.hpp
ccalib.hpp		mcc			superres
core			mcc.hpp			superres.hpp
core.hpp		ml			surface_matching
core_detect.hpp		ml.hpp			surface_matching.hpp
cvconfig.h		objdetect		text
datasets		objdetect.hpp		text.hpp
dnn			opencv.hpp		tracking
dnn.hpp			opencv_modules.hpp	tracking.hpp
dnn_superres.hpp	optflow			video
dpm.hpp			optflow.hpp		video.hpp
face			phase_unwrapping	videoio
face.hpp		phase_unwrapping.hpp	videoio.hpp
features2d		photo			videostab
features2d.hpp		photo.hpp		videostab.hpp
flann			plot.hpp		viz
flann.hpp		quality			viz.hpp
freetype.hpp		quality.hpp		wechat_qrcode.hpp
fuzzy			rapid.hpp		xfeatures2d
fuzzy.hpp		reg			xfeatures2d.hpp
gapi			rgbd			ximgproc
gapi.hpp		rgbd.hpp		ximgproc.hpp
hfs.hpp			saliency		xobjdetect.hpp
highgui			saliency.hpp		xphoto
highgui.hpp		sfm			xphoto.hpp
aaqidmasoodi@Aaqids-MacBook-Air opencv2 % 

@aaqidmasoodi
Copy link
Contributor

aaqidmasoodi commented Sep 8, 2023

This issue has been fixed on macOS

I've also shared my updated zsh file just use that. It is general.

Visit this thread : #493

@aaqidmasoodi
Copy link
Contributor

I've created a gist about how to set it up properly step by step

https://gist.github.com/aaqidmasoodi/da698ab103e4fbb180ed965988bea734

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

4 participants