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

Cannot find OpenCV path [Mac][Homebrew] #1515

Open
sulibo opened this issue Dec 2, 2024 · 5 comments
Open

Cannot find OpenCV path [Mac][Homebrew] #1515

sulibo opened this issue Dec 2, 2024 · 5 comments

Comments

@sulibo
Copy link

sulibo commented Dec 2, 2024

ViSP was installed via Homebrew on a macbook via Homebrew.

brew install visp

No error was reported when installing.

When I tried to build an example project, the following error showed up:

CMake Error in CMakeLists.txt:
  Imported target "visp_vs" includes non-existent path

    "/usr/local/Cellar/opencv/4.10.0/include/opencv4"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

The CMakeLists.txt is

cmake_minimum_required(VERSION 3.10)

project(tutorial-image)

find_package(VISP REQUIRED)

include_directories(${VISP_INCLUDE_DIRS})

add_executable(tutorial-viewer tutorial-viewer.cpp)
target_link_libraries(tutorial-viewer ${VISP_LIBRARIES})

The problem is that OpenCV is located at /usr/local/OpenCV/4.10.10_14/include/opencv4. OpenCV is automatically installed when installing ViSP. This is a problem with versions of the OpenCV.

Could anyone suggest how to resolve this? Thanks!

@fspindle
Copy link
Contributor

fspindle commented Dec 3, 2024

What is the full output of

$ brew info visp

and

$ brew info opencv

Is it possible that OpenCV was built and installed from source in /usr/local but also using brew install opencv that brings OpenCV in .../Cellar/...?

@sulibo
Copy link
Author

sulibo commented Dec 3, 2024

Here are the outputs of the two commands.

$ brew info visp
==> visp: stable 3.6.0 (bottled)
Visual Servoing Platform library
https://visp.inria.fr/
Installed
/usr/local/Cellar/visp/3.6.0_6 (804 files, 11.0MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-12-02 at 14:53:03
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/v/visp.rb
License: GPL-2.0-or-later
==> Dependencies
Build: cmake ✔, pkgconf ✔
Required: eigen ✔, gsl ✔, jpeg-turbo ✔, libdc1394 ✔, libpng ✔, openblas ✔, opencv ✔, pcl ✔, vtk ✔, zbar ✔, boost ✔, flann ✔, glew ✔, libomp ✔, libpcap ✔, qhull ✔, qt ✔
==> Analytics
install: 108 (30 days), 343 (90 days), 2,537 (365 days)
install-on-request: 108 (30 days), 343 (90 days), 2,537 (365 days)
build-error: 6 (30 days)
$ brew info opencv
==> opencv: stable 4.10.0 (bottled), HEAD
Open source computer vision library
https://opencv.org/
Installed
/usr/local/Cellar/opencv/4.10.0_14 (982 files, 258.3MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-12-02 at 14:05:08
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/o/opencv.rb
License: Apache-2.0
==> Dependencies
Build: cmake ✔, pkgconf ✔, python-setuptools ✘
Required: abseil ✔, ceres-solver ✔, eigen ✔, ffmpeg ✔, freetype ✔, gflags ✔, glog ✔, harfbuzz ✔, jpeg-turbo ✔, jsoncpp ✔, libpng ✔, libtiff ✔, numpy ✔, openblas ✔, openexr ✔, openjpeg ✔, openvino ✔, protobuf ✔, python@3.12 ✔, tbb ✔, tesseract ✔, vtk ✔, webp ✔, glew ✔, imath ✔, libarchive ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 11,030 (30 days), 37,711 (90 days), 147,636 (365 days)
install-on-request: 10,483 (30 days), 35,900 (90 days), 139,462 (365 days)
build-error: 56 (30 days)

OpenCV is also installed via Homebrew. I don't think that I have built OpenCV from source.

From the commit history of opencv.rb in brew GitHub, the most recent version of OpenCV is marked as 4.10.0_14 bottle.

https://github.com/Homebrew/homebrew-core/commits/ecb720afb8aaebf582fee1069594056284886e4a/Formula/o/opencv.rb

@fspindle
Copy link
Contributor

fspindle commented Dec 4, 2024

I'm able to reproduce the issue!

From the commit history of visp.rb I can see that the bottle was updated after migration to OpenCV 4.10.0 on Jul 11, 2024.

https://github.com/Homebrew/homebrew-core/commits/master/Formula/v/visp.rb

The ViSP bottle needs to be updated again to consider 4.10.0_14, but I don't know how to trigger that. Any idea?

@sulibo
Copy link
Author

sulibo commented Dec 5, 2024

Sorry, I don't know how to update the bottle either :(
I have built ViSP from source. Hope someone else can help to update the ViSP bottle.

@fspindle
Copy link
Contributor

fspindle commented Dec 5, 2024

I asked for help: https://github.com/orgs/Homebrew/discussions/5787

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