VisionLabs/torch-opencv

Mac OS X installation issue

Closed this issue · 4 comments

Hi ...I am quite new to all this ...and while installing the steps given in the installation, I am facing following error. I have tried to install using all the three methods given in https://github.com/VisionLabs/torch-opencv/wiki/Installation but getting same error. I have also installed opencv3 using brew.

CMake Error at CMakeLists.txt:22 (FIND_PACKAGE):
Could not find a configuration file for package "OpenCV" that is compatible
with requested version "3.1".

The following configuration files were considered but not accepted:

/usr/local/share/OpenCV/OpenCVConfig.cmake, version: 2.4.13

-- Configuring incomplete, errors occurred!
See also "/Users/viral/torch-opencv/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.

Error: Build error: Failed building.

have you tried

brew instal opencv3 --with-contrib
OpenCV_DIR=/usr/local/Cellar/opencv3/3.1.0/share/OpenCV luarocks install cv

@szagoruyko yes I have already tried that solution. It is giving the same error.

Last login: Sun Jul 17 18:05:02 on ttys000
VIRALs-MacBook-Pro:~ viral$ brew instal opencv3 --with-contrib
Warning: homebrew/science/opencv3-3.1.0_3 already installed
VIRALs-MacBook-Pro:~ viral$ OpenCV_DIR=/usr/local/Cellar/opencv3/3.1.0/share/OpenCV luarocks install cv
Installing https://raw.githubusercontent.com/torch/rocks/master/cv-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/cv-scm-1.rockspec... switching to 'build' mode
Cloning into 'torch-opencv'...
remote: Counting objects: 202, done.
remote: Compressing objects: 100% (180/180), done.
remote: Total 202 (delta 40), reused 76 (delta 19), pack-reused 0
Receiving objects: 100% (202/202), 2.03 MiB | 2.02 MiB/s, done.
Resolving deltas: 100% (40/40), done.
Checking connectivity... done.
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/viral/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/viral/torch/install/lib/luarocks/rocks/cv/scm-1";
make

-- The C compiler identification is AppleClang 7.3.0.7030031
-- The CXX compiler identification is AppleClang 7.3.0.7030031
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:22 (FIND_PACKAGE):
Could not find a configuration file for package "OpenCV" that is compatible
with requested version "3.1".

The following configuration files were considered but not accepted:

/usr/local/share/OpenCV/OpenCVConfig.cmake, version: 2.4.13

-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_cv-scm-1-6393/torch-opencv/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.

Error: Build error: Failed building.
VIRALs-MacBook-Pro:~ viral$

I need to uninstall previous opencv3 using brew uninstall opencv3

then followed the steps again and I guess it is working now... thank you @szagoruyko