Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV 4.0 Alpha Installation

I am attempting to install OpenCV 4 alpha using the following tutorial: https://www.pyimagesearch.com/2018/08/17/install-opencv-4-on-macos/

The primary issue is when compiling with cmake running the command:

cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ -D PYTHON3_LIBRARY=python -c 'import subprocess ; import sys ; s = subprocess.check_output("python-config --configdir", shell=True).decode("utf-8").strip() ; (M, m) = sys.version_info[:2] ; print("{}/libpython{}.{}.dylib".format(s, M, m))' \ -D PYTHON3_INCLUDE_DIR=python -c 'import distutils.sysconfig as s; print(s.get_python_inc())' \ -D PYTHON3_EXECUTABLE=$VIRTUAL_ENV/bin/python \ -D BUILD_opencv_python2=OFF \ -D BUILD_opencv_python3=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=OFF \ -D BUILD_EXAMPLES=ON ..

Which outputs the following error:

Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command 'python-config --configdir' returned non-zero exit status 1 CMake Error at /usr/local/Cellar/cmake/3.12.3/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:47 (message): Could not find compiler set in environment variable CXX:

/usr/local/bin/g++.

Call Stack (most recent call first): CMakeLists.txt:127 (project)

CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred!

Has anyone come up with this issue? I have attempted setting the CXX binary in the bash profile with no luck.

click to hide/show revision 2
None

updated 2018-10-28 05:44:26 -0500

berak gravatar image

OpenCV 4.0 Alpha Installation

I am attempting to install OpenCV 4 alpha using the following tutorial: https://www.pyimagesearch.com/2018/08/17/install-opencv-4-on-macos/

The primary issue is when compiling with cmake running the command:

 cmake -D CMAKE_BUILD_TYPE=RELEASE \
  -D CMAKE_INSTALL_PREFIX=/usr/local \
  -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
  -D PYTHON3_LIBRARY=python -D PYTHON3_LIBRARY=`python -c 'import subprocess ; import sys ; s = subprocess.check_output("python-config --configdir", shell=True).decode("utf-8").strip() ; (M, m) = sys.version_info[:2] ; print("{}/libpython{}.{}.dylib".format(s, M, m))' \
  -D PYTHON3_INCLUDE_DIR=python m))'` \
 -D PYTHON3_INCLUDE_DIR=`python -c 'import distutils.sysconfig as s; print(s.get_python_inc())'print(s.get_python_inc())'` \
 -D PYTHON3_EXECUTABLE=$VIRTUAL_ENV/bin/python \
  -D BUILD_opencv_python2=OFF \
  -D BUILD_opencv_python3=ON \
 -D INSTALL_PYTHON_EXAMPLES=ON \
  -D INSTALL_C_EXAMPLES=OFF \
  -D BUILD_EXAMPLES=ON ..
 \
  -D PYTHON3_EXECUTABLE=$VIRTUAL_ENV/bin/python \
   -D BUILD_opencv_python2=OFF \
   -D BUILD_opencv_python3=ON \
  -D INSTALL_PYTHON_EXAMPLES=ON \
   -D INSTALL_C_EXAMPLES=OFF \
   -D BUILD_EXAMPLES=ON ..

Which outputs the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'python-config --configdir' returned non-zero exit status 1
CMake Error at /usr/local/Cellar/cmake/3.12.3/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:47 (message):
  Could not find compiler set in environment variable CXX:

/usr/local/bin/g++.

CXX: /usr/local/bin/g++. Call Stack (most recent call first): CMakeLists.txt:127 (project)

(project) CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred!

occurred!

Has anyone come up with this issue? I have attempted setting the CXX binary in the bash profile with no luck.

click to hide/show revision 3
retagged

updated 2018-10-28 05:46:36 -0500

berak gravatar image

OpenCV 4.0 Alpha Installation

I am attempting to install OpenCV 4 alpha using the following tutorial: https://www.pyimagesearch.com/2018/08/17/install-opencv-4-on-macos/

The primary issue is when compiling with cmake running the command:

 cmake -D CMAKE_BUILD_TYPE=RELEASE \
 -D CMAKE_INSTALL_PREFIX=/usr/local \
 -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
 -D PYTHON3_LIBRARY=`python -c 'import subprocess ; import sys ; s = subprocess.check_output("python-config --configdir", shell=True).decode("utf-8").strip() ; (M, m) = sys.version_info[:2] ; print("{}/libpython{}.{}.dylib".format(s, M, m))'` \
 -D PYTHON3_INCLUDE_DIR=`python -c 'import distutils.sysconfig as s; print(s.get_python_inc())'` \
 -D PYTHON3_EXECUTABLE=$VIRTUAL_ENV/bin/python \
  -D BUILD_opencv_python2=OFF \
  -D BUILD_opencv_python3=ON \
 -D INSTALL_PYTHON_EXAMPLES=ON \
  -D INSTALL_C_EXAMPLES=OFF \
  -D BUILD_EXAMPLES=ON ..

Which outputs the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'python-config --configdir' returned non-zero exit status 1
CMake Error at /usr/local/Cellar/cmake/3.12.3/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:47 (message):
  Could not find compiler set in environment variable CXX:

  /usr/local/bin/g++.

Call Stack (most recent call first):
  CMakeLists.txt:127 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

Has anyone come up with this issue? I have attempted setting the CXX binary in the bash profile with no luck.