Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Dec 2012 21:20:37 GMT
From:      "O. Hartmann" <ohartman@zedat.fu-berlin.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/174786: graphics/opencv: /usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:270:40: error: use of undeclared identifier 'PyInt_Check' if (PyFloat_Check(item) || PyInt_Check(item)) {
Message-ID:  <201212282120.qBSLKbtb049842@red.freebsd.org>
Resent-Message-ID: <201212282130.qBSLU1iF048584@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         174786
>Category:       ports
>Synopsis:       graphics/opencv: /usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:270:40: error: use of undeclared identifier 'PyInt_Check'             if (PyFloat_Check(item) || PyInt_Check(item)) {
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 28 21:30:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     O. Hartmann
>Release:        FreeBSD 9.1-PRERELEASE #0 r244482: Thu Dec 20 08:36:19 CET 2012 amd64
>Organization:
FU Berlin
>Environment:
>Description:
Updating of port graphics/opencv fails on several boxes, either FreeBSD 10.0-CURRENT or FreeBSD 9.1-PRE.

There are also systems which can successfully compile graphics/opencv.

The error indicates some Python problems. I realized, that graphics/blender requires Python 3.2. These days blender 2.65 was commited to the ports and the port reeled in Python 3.3 without deleting Python 3.2! So I had on several machines both python32 and python33 - but the only port requiring python3 is blender!

The problem is spread over a couple of boxes with FreeBSD 9.1 and 10.0 as well, they are all CLANG compiled. Some boxes compile the port very well (on FreeBSD 10 and 9.1).

I did, as recommended, this horrible and nasty updating for all ports relying on cyrus-sasl-2, pcre, icu and ImageMagick - in the order as the entries appeared. 


[...]
Scanning dependencies of target opencv_test_objdetect
[ 56%] Building CXX object modules/objdetect/CMakeFiles/opencv_test_objdetect.dir/test/test_main.o
[ 56%] Building CXX object modules/objdetect/CMakeFiles/opencv_test_objdetect.dir/test/test_latentsvmdetector.o
[ 56%] Building CXX object modules/objdetect/CMakeFiles/opencv_test_objdetect.dir/test/test_precomp.o
[ 57%] Building CXX object modules/objdetect/CMakeFiles/opencv_test_objdetect.dir/test/test_cascadeandhog.o
Linking CXX executable ../../bin/opencv_test_objdetect
[ 57%] Built target opencv_test_objdetect
[ 58%] Generating generated0.i
PolarToCart [False, False, False, False, True]
Generated 377 functions
[ 58%] Generating pyopencv_generated_funcs.h, pyopencv_generated_func_tab.h, pyopencv_generated_types.h, pyopencv_generated_type_reg.h, pyopencv_generated_const_reg.h
Scanning dependencies of target opencv_python
[ 58%] Building CXX object modules/python/CMakeFiles/opencv_python.dir/src2/cv2.o
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:270:40: error: use of undeclared identifier 'PyInt_Check'
            if (PyFloat_Check(item) || PyInt_Check(item)) {
                                       ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:279:33: error: use of undeclared identifier 'PyInt_Check'
        if (PyFloat_Check(o) || PyInt_Check(o)) {
                                ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:317:12: error: use of undeclared identifier 'PyInt_FromLong'; did you mean
      'PyLong_FromLong'?
    return PyInt_FromLong(value);
           ^~~~~~~~~~~~~~
           PyLong_FromLong
/usr/local/include/python3.3m/longobject.h:18:24: note: 'PyLong_FromLong' declared here
PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
                       ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:324:18: error: use of undeclared identifier 'PyInt_AsLong'; did you mean
      'PyLong_AsLong'?
    value = (int)PyInt_AsLong(obj);
                 ^~~~~~~~~~~~
                 PyLong_AsLong
/usr/local/include/python3.3m/longobject.h:23:18: note: 'PyLong_AsLong' declared here
PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
                 ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:337:8: error: use of undeclared identifier 'PyInt_CheckExact'
    if(PyInt_CheckExact(obj))
       ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:338:25: error: use of undeclared identifier 'PyInt_AS_LONG'
        value = (double)PyInt_AS_LONG(obj);
                        ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:353:8: error: use of undeclared identifier 'PyInt_CheckExact'
    if(PyInt_CheckExact(obj))
       ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:354:24: error: use of undeclared identifier 'PyInt_AS_LONG'
        value = (float)PyInt_AS_LONG(obj);
                       ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:367:12: error: use of undeclared identifier 'PyString_FromString'
    return PyString_FromString(value.empty() ? "" : value.c_str());
           ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:374:17: error: use of undeclared identifier 'PyString_AsString'
    char* str = PyString_AsString(obj);
                ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:562:21: error: use of undeclared identifier 'PyInt_Check'
                if( PyInt_Check(item_ij))
                    ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:564:29: error: use of undeclared identifier 'PyInt_AsLong'; did you mean
      'PyLong_AsLong'?
                    int v = PyInt_AsLong(item_ij);
                            ^~~~~~~~~~~~
                            PyLong_AsLong
/usr/local/include/python3.3m/longobject.h:23:18: note: 'PyLong_AsLong' declared here
PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
                 ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:745:30: error: use of undeclared identifier 'PyInt_FromLong'; did you mean
      'PyLong_FromLong'?
    return value == ivalue ? PyInt_FromLong(ivalue) : PyFloat_FromDouble(value);
                             ^~~~~~~~~~~~~~
                             PyLong_FromLong
/usr/local/include/python3.3m/longobject.h:18:24: note: 'PyLong_FromLong' declared here
PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
                       ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:761:18: error: use of undeclared identifier 'PyString_Check'; did you mean
      'PyMapping_Check'?
            if( !PyString_Check(key) )
                 ^~~~~~~~~~~~~~
                 PyMapping_Check
/usr/local/include/python3.3m/abstract.h:1129:22: note: 'PyMapping_Check' declared here
     PyAPI_FUNC(int) PyMapping_Check(PyObject *o);
                     ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:763:29: error: use of undeclared identifier 'PyString_AsString'
            std::string k = PyString_AsString(key);
                            ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:764:17: error: use of undeclared identifier 'PyString_Check'; did you mean
      'PyMapping_Check'?
            if( PyString_Check(item) )
                ^~~~~~~~~~~~~~
                PyMapping_Check
/usr/local/include/python3.3m/abstract.h:1129:22: note: 'PyMapping_Check' declared here
     PyAPI_FUNC(int) PyMapping_Check(PyObject *o);
                     ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:766:37: error: use of undeclared identifier 'PyString_AsString'
                const char* value = PyString_AsString(item);
                                    ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:771:22: error: use of undeclared identifier 'PyInt_Check'
            else if( PyInt_Check(item) )
                     ^
/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/python/src2/cv2.cpp:773:34: error: use of undeclared identifier 'PyInt_AsLong'; did you mean
      'PyLong_AsLong'?
                int value = (int)PyInt_AsLong(item);
                                 ^~~~~~~~~~~~
                                 PyLong_AsLong
/usr/local/include/python3.3m/longobject.h:23:18: note: 'PyLong_AsLong' declared here
PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** [modules/python/CMakeFiles/opencv_python.dir/src2/cv2.o] Error code 1

Stop in /usr/ports/graphics/opencv/work/OpenCV-2.3.1.
*** [modules/python/CMakeFiles/opencv_python.dir/all] Error code 1

Stop in /usr/ports/graphics/opencv/work/OpenCV-2.3.1.
*** [all] Error code 1

Stop in /usr/ports/graphics/opencv/work/OpenCV-2.3.1.
*** [do-build] Error code 1

Stop in /usr/ports/graphics/opencv.
*** [build] Error code 1

Stop in /usr/ports/graphics/opencv.

===>>> make failed for graphics/opencv
===>>> Aborting update

===>>> Update for opencv-2.3.1_4 failed
===>>> Aborting update

Terminated
===>>> The following actions were performed:
        Re-installation of opencv-core-2.3.1_5


===>>> You can restart from the point of failure with this command line:
       portmaster <flags> graphics/opencv 

>How-To-Repeat:
Update any port that requires graphics/opencv (i.e. graphics/blender).
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212282120.qBSLKbtb049842>