2013-10-17 10 views
6

Ich versuche, meine OpenCV von Version 2.4.5 auf Version 2.4.6.1 mit Homebrew zu aktualisieren. Als ich brew upgrade opencv
laufen laufe ich in den folgenden Fehler:Erstellen von OpenCV_Python in Mac OS X 10.9 mit Homebrew

==> Upgrading opencv 
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid 
==> Downloading http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.6.1/opencv-2.4 
Already downloaded: /Library/Caches/Homebrew/opencv-2.4.6.1.tar.gz 
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.6.1 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIN 
==> make 
/usr/local/Library/ENV/4.3/c++ -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -dynamiclib -Wl,-headerpad_max_install_names -o ../../lib/libopencv_java246.dylib -install_name /tmp/-5W3i/opencv-2.4.6.1/macbuild/lib/libopencv_java246.dylib CMakeFiles/opencv_java.dir/generator/src/cpp/converters.cpp.o CMakeFiles/opencv_java.dir/generator/src/cpp/core_manual.cpp.o CMakeFiles/opencv_java.dir/generator/src/cpp/jni_part.cpp.o CMakeFiles/opencv_java.dir/generator/src/cpp/Mat.cpp.o CMakeFiles/opencv_java.dir/generator/src/cpp/utils.cpp.o CMakeFiles/opencv_java.dir/generator/src/cpp/VideoCapture.cpp.o CMakeFiles/opencv_java.dir/core.cpp.o CMakeFiles/opencv_java.dir/imgproc.cpp.o CMakeFiles/opencv_java.dir/objdetect.cpp.o CMakeFiles/opencv_java.dir/features2d.cpp.o CMakeFiles/opencv_java.dir/video.cpp.o CMakeFiles/opencv_java.dir/highgui.cpp.o CMakeFiles/opencv_java.dir/ml.cpp.o CMakeFiles/opencv_java.dir/calib3d.cpp.o CMakeFiles/opencv_java.dir/photo.cpp.o CMakeFiles/opencv_java.dir/contrib.cpp.o -L/usr/local/include/../lib ../../lib/libopencv_core.2.4.6.dylib ../../lib/libopencv_imgproc.2.4.6.dylib ../../lib/libopencv_highgui.2.4.6.dylib ../../lib/libopencv_objdetect.2.4.6.dylib ../../lib/libopencv_flann.2.4.6.dylib ../../lib/libopencv_features2d.2.4.6.dylib ../../lib/libopencv_video.2.4.6.dylib ../../lib/libopencv_ml.2.4.6.dylib ../../lib/libopencv_calib3d.2.4.6.dylib ../../lib/libopencv_photo.2.4.6.dylib ../../lib/libopencv_legacy.2.4.6.dylib ../../lib/libopencv_gpu.2.4.6.dylib ../../lib/libopencv_ocl.2.4.6.dylib ../../lib/libopencv_nonfree.2.4.6.dylib ../../lib/libopencv_contrib.2.4.6.dylib -ltbb ../../lib/libopencv_gpu.2.4.6.dylib ../../lib/libopencv_photo.2.4.6.dylib ../../lib/libopencv_legacy.2.4.6.dylib ../../lib/libopencv_ocl.2.4.6.dylib ../../lib/libopencv_objdetect.2.4.6.dylib ../../lib/libopencv_video.2.4.6.dylib ../../lib/libopencv_ml.2.4.6.dylib ../../lib/libopencv_calib3d.2.4.6.dylib ../../lib/libopencv_features2d.2.4.6.dylib ../../lib/libopencv_highgui.2.4.6.dylib ../../lib/libopencv_imgproc.2.4.6.dylib ../../lib/libopencv_flann.2.4.6.dylib ../../lib/libopencv_core.2.4.6.dylib /usr/lib/libz.dylib -ltbb -framework OpenCL 
brew: superenv removed: -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -L/usr/local/include/../lib 
usr/local/Cellar/cmake/2.8.11.2/bin/cmake -E cmake_progress_report /tmp/-5W3i/opencv-2.4.6.1/macbuild/CMakeFiles 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 
[100%] Built target opencv_java 
make: *** [all] Error 2 

Es versagt scheint, während die Bindungen Python bauen OpenCV. Ich habe Java Build Version 1.7.0_45-b18 auf meinem Mac installiert und Python 2.7.5 zusammen mit Numpy 1.7.1 auf dem System installiert. Ich habe mich gefragt, was das Problem hier wäre.

Weitere Fehlersuche zeigt, dass das Problem verursacht wird, während OpenCV_Python Aufbau und das ist der Fehler, wo der Bau beendet:

[ 85%] Building CXX object modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o 
cd /tmp/opencv-fc49/opencv-2.4.6.1/macbuild/modules/python && /usr/local/Library/ENV/4.3/c++ -DHAVE_ALLOCA -DHAVE_ALLOCA_H -DHAVE_CVCONFIG_H -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H -DPYTHON_USE_NUMPY=1 -Dopencv_python_EXPORTS -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -Wno-unused-function -fPIC -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2 -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/nonfree/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/ocl/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/gpu/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/legacy/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/contrib/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/objdetect/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/photo/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/calib3d/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/features2d/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/highgui/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/ml/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/video/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/imgproc/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/flann/include -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/core/include -I/tmp/opencv-fc49/opencv-2.4.6.1/macbuild/modules/python -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src -I/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/include -I/tmp/opencv-fc49/opencv-2.4.6.1/macbuild -isystem /usr/local/include -isystem /usr/local/include/eigen3 -isystem /usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Headers -isystem /usr/local/lib/python2.7/site-packages/numpy/core/include -o CMakeFiles/opencv_python.dir/src2/cv2.cpp.o -c /tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp 
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:227:9: error: no matching function for call to 'PyInt_Check' 
if(PyInt_Check(o)) 
    ^~~~~~~~~~~ 
/usr/local/include/pypy_decl.h:171:17: note: candidate function not viable: 1st argument ('const PyObject *' (aka 'const _object *')) would lose const qualifier 
PyAPI_FUNC(int) PyInt_Check(PyObject *arg0); 
       ^
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:233:9: error: no matching function for call to 'PyFloat_Check' 
if(PyFloat_Check(o)) 
    ^~~~~~~~~~~~~ 
/usr/local/include/pypy_decl.h:142:17: note: candidate function not viable: 1st argument ('const PyObject *' (aka 'const _object *')) would lose const qualifier 
PyAPI_FUNC(int) PyFloat_Check(PyObject *arg0); 
       ^
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:239:9: error: no matching function for call to 'PyTuple_Check' 
if(PyTuple_Check(o)) 
    ^~~~~~~~~~~~~ 
/usr/local/include/pypy_decl.h:397:17: note: candidate function not viable: 1st argument ('const PyObject *' (aka 'const _object *')) would lose const qualifier 
PyAPI_FUNC(int) PyTuple_Check(PyObject *arg0); 
       ^
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:245:28: error: no matching function for call to 'PyTuple_GetItem' 
     PyObject* oi = PyTuple_GET_ITEM(o, i); 
         ^~~~~~~~~~~~~~~~ 
/usr/local/include/tupleobject.h:14:26: note: expanded from macro 'PyTuple_GET_ITEM' 
#define PyTuple_GET_ITEM PyTuple_GetItem 
         ^~~~~~~~~~~~~~~ 
/usr/local/include/pypy_decl.h:400:24: note: candidate function not viable: 1st argument ('const PyObject *' (aka 'const _object *')) would lose const qualifier 
PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *arg0, Py_ssize_t arg1); 
        ^
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:702:28: error: use of undeclared identifier 'PySequence_Fast_ITEMS'; did you mean 'PySequence_Fast_GET_SIZE'? 
    PyObject** items = PySequence_Fast_ITEMS(seq); 
         ^~~~~~~~~~~~~~~~~~~~~ 
         PySequence_Fast_GET_SIZE 
/usr/local/include/pypy_decl.h:339:24: note: 'PySequence_Fast_GET_SIZE' declared here 
PyAPI_FUNC(Py_ssize_t) PySequence_Fast_GET_SIZE(PyObject *arg0); 
        ^
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:702:20: error: cannot initialize a variable of type 'PyObject **' (aka '_object **') with an rvalue of type 'Py_ssize_t' (aka 'long') 
    PyObject** items = PySequence_Fast_ITEMS(seq); 
      ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:741:27: error: use of undeclared identifier 'PySequence_Fast_ITEMS'; did you mean 'PySequence_Fast_GET_SIZE'? 
      items_i = PySequence_Fast_ITEMS(seq_i); 
         ^~~~~~~~~~~~~~~~~~~~~ 
         PySequence_Fast_GET_SIZE 
/usr/local/include/pypy_decl.h:339:24: note: 'PySequence_Fast_GET_SIZE' declared here 
PyAPI_FUNC(Py_ssize_t) PySequence_Fast_GET_SIZE(PyObject *arg0); 
       ^
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:741:25: error: assigning to 'PyObject **' (aka '_object **') from incompatible type 'Py_ssize_t' (aka 'long') 
      items_i = PySequence_Fast_ITEMS(seq_i); 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:814:24: error: use of undeclared identifier 'PySequence_Fast_ITEMS'; did you mean 'PySequence_Fast_GET_SIZE'? 
PyObject** items = PySequence_Fast_ITEMS(seq); 
        ^~~~~~~~~~~~~~~~~~~~~ 
        PySequence_Fast_GET_SIZE 
/usr/local/include/pypy_decl.h:339:24: note: 'PySequence_Fast_GET_SIZE' declared here 
PyAPI_FUNC(Py_ssize_t) PySequence_Fast_GET_SIZE(PyObject *arg0); 
        ^
/tmp/opencv-fc49/opencv-2.4.6.1/modules/python/src2/cv2.cpp:814:16: error: cannot initialize a variable of type 'PyObject **' (aka '_object **') with an rvalue of type 'Py_ssize_t' (aka 'long') 
PyObject** items = PySequence_Fast_ITEMS(seq); 

Könnte jemand bitte mit dem Bau OpenCV helfen?

+1

Sie können hier auf meine Antwort verweisen: http://stackoverflow.com/questions/19707468/installing-opencv-2-4-2-on-mac-os-x-10-9-mavericks/19929313 # 19929313 HTH – GilbertLee

+0

Versuchen Sie, numpy, scipy und opencv aus der Quelle zu installieren. Es gibt eine Arbeit für clang, bei der Sie vor dem Kompilieren dieser Bibliotheken die folgende Umgebungsvariable setzen müssen: "export ARCHFLAGS = -Wno-error = unbenutztes-Befehlszeilenargument-hard-error-in-future" –

Antwort

0

Sie können die Compiler-Fehler um Py * -Funktionen erhalten, weil es die Python-Includes nicht in seinen Suchverzeichnissen finden kann.

Ich würde nicht auf die Python Build-Version verlassen und empfehlen, eine andere Version über Python zu installieren. Beide Python-Builds können auf demselben Computer nebeneinander existieren, aber Sie verlassen sich besser auf die Installation von brew. Sie können es überprüfen, indem Sie überprüfen, dass "which python" auf/usr/local/bin/python zeigt oder von der Version, wenn Sie den Python-Interpreter starten. GilberLee Kommentar zeigt auf ein paar gute Schritte, um dies einzurichten: Installing openCV 2.4.2 on Mac OS X 10.9 (Mavericks)

Nach der Installation von Python Ansicht homebrew, versuchen neu installieren opencv und sehen Sie, wenn Sie diese Kompilierungsfehlern übergeben bekommen.

Verwandte Themen