[pdal] compile pdal with Python support

Luca Delucchi lucadeluge at gmail.com
Tue Dec 1 00:19:06 PST 2015


On 30 November 2015 at 17:33, Howard Butler <howard at hobu.co> wrote:
>
>
> you may need to install cython too
>
> $ pip install cython
>

cython is already installed (version 0.19)

>
>>
>>> Then the following command should work:
>>>
>>> $ python setup.py build; python setup.py install
>>>
>>
>> we tried but we got this error
>>
>> python setup.py build
>> Compiling pdal/libpdalpython.pyx because it changed.
>> Cythonizing pdal/libpdalpython.pyx
>>
>> Error compiling Cython file:
>> ------------------------------------------------------------
>> ...
>> cdef class PyPipeline:
>>    cdef Pipeline *thisptr      # hold a c++ instance which we're wrapping
>>    def __cinit__(self, unicode xml):
>>        cdef char* x
>>        if PY_MAJOR_VERSION >= 3:
>>            self.thisptr = new Pipeline(xml.encode('UTF-8'))
>>                                                 ^
>> ------------------------------------------------------------
>>
>> pdal/libpdalpython.pyx:28:50: Obtaining 'char const *' from temporary
>> Python value
>> Traceback (most recent call last):
>>  File "setup.py", line 140, in <module>
>>    extensions= cythonize(extensions, language="c++")
>>  File "/usr/lib64/python2.7/site-packages/Cython/Build/Dependencies.py",
>> line 713, in cythonize
>>    cythonize_one(*args[1:])
>>  File "/usr/lib64/python2.7/site-packages/Cython/Build/Dependencies.py",
>> line 780, in cythonize_one
>>    raise CompileError(None, pyx_file)
>> Cython.Compiler.Errors.CompileError: pdal/libpdalpython.pyx
>>
>> There is something strange because we are running Python 2.7.5 but it
>> seems to check Python >= 3
>>
>> -
>
> One gotcha I can think of is building PDAL against Python 2.x and then building the Python extension using Python 3.x. That scenario definitely will not work.
>

no we are compiling Python extension using Python 2.7, Python 3.x is
not installed in our machine (scientific linux 7)

> I wonder if the error you are seeing is due to Cython being missing though. Please try that first.
>

no it is not related to this, maybe an old cython version?

> Howard
>



-- 
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org


More information about the pdal mailing list