[pypy-issue] Issue #2677: PyBuffer_ToContiguous: undeclared identifier when building `dlib` (pypy/pypy)

Jacek Szpot issues-reply at bitbucket.org
Tue Oct 10 11:02:57 EDT 2017


New issue 2677: PyBuffer_ToContiguous: undeclared identifier when building `dlib`
https://bitbucket.org/pypy/pypy/issues/2677/pybuffer_tocontiguous-undeclared

Jacek Szpot:

Hey guys!

> **TL;DR:** `undeclared identifier 'PyBuffer_ToContiguous'` when trying to build `dlib`

I bumped into this when trying to install `dlib` (`pip3 install dlib`):

```
   In file included from /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/tools/python/src/matrix.cpp:4:
    In file included from /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python.h:9:
    /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python/numpy.h:109:17: error: use of undeclared identifier 'PyBuffer_ToContiguous'
                if (PyBuffer_ToContiguous(&contig_buf[0], &pybuf, pybuf.len, 'C'))
                    ^
    /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python/numpy_image.h:22:9: note: in instantiation of function template specialization 'get_numpy_ndarray_parts<unsigned char, 2>' requested here
            get_numpy_ndarray_parts(img, _data, _contig_buf, shape);
            ^
    In file included from /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/tools/python/src/matrix.cpp:4:
    In file included from /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python.h:9:
    /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python/numpy.h:109:17: error: use of undeclared identifier 'PyBuffer_ToContiguous'
                if (PyBuffer_ToContiguous(&contig_buf[0], &pybuf, pybuf.len, 'C'))
                    ^
    /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python/numpy_image.h:76:9: note: in instantiation of function template specialization 'get_numpy_ndarray_parts<dlib::rgb_pixel, 3>' requested here
            get_numpy_ndarray_parts(img, _data, _contig_buf, shape);
            ^
    2 errors generated.
    make[2]: *** [CMakeFiles/dlib_.dir/src/matrix.cpp.o] Error 1
    make[1]: *** [CMakeFiles/dlib_.dir/all] Error 2
    make: *** [all] Error 2
    error: cmake build failed!
```

More details:
```
Python 3.5.3 (d72f9800a42b46a8056951b1da2426d2c2d8d502, Oct 07 2017, 08:21:16)
[PyPy 5.9.0-beta0 with GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
```

The CPython interpreter has this symbol defined somewhere in `abstract.h` - I see that for my `pypy3` installation (and inside a virtualenv), the `include/abstract.h` is way shorter and only contains like two symbols.

Is this simply something that's not yet implemented, or am I miss something?

Let me know if you need more info.




More information about the pypy-issue mailing list