0

PIRT (Python Image Registration Toolkit ライブラリ) のビルドに問題があります。Mercurial ( ) を使用して bitbucket からダウンロードしましhg clone https://bitbucket.org/almarklein/pirtた。しかし、使用してビルドしようとするとpython setup.py、次のエラーが発生します。

Compiling pirt/splinegrid_.pyx because it changed.
[1/2] Cythonizing pirt/interp/interpolation_.pyx

Error compiling Cython file:
------------------------------------------------------------
...

    # Methods
    cdef void calculate_lut(self, spline_type, int N)
    cdef double* get_coef(self, double t) nogil
    cdef double* get_coef_from_index(self, int i)    
    cdef double spline_type_to_id(self, spline_type)
                                ^
------------------------------------------------------------

pirt/interp/interpolation_.pxd:23:33: C method 'spline_type_to_id' is declared but not defined
Traceback (most recent call last):
  File "setup.py", line 49, in <module>
    extensions = cythonize(extensions)
  File "/home/osboxes/anaconda3/lib/python3.5/site-packages/Cython/Build/Dependencies.py", line 877, in cythonize
    cythonize_one(*args)
  File "/home/osboxes/anaconda3/lib/python3.5/site-packages/Cython/Build/Dependencies.py", line 997, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: pirt/interp/interpolation_.pyx

Cython と visvis は (Anaconda を介して) 既にインストールされていますが、ビルドはまだ失敗します。

4

1 に答える 1

1

残念ながら、関数のどの部分を.pxdファイルで宣言する必要があるかについてのドキュメントは見つかりませんでした。ありがたいことに、既存のものを表示してCython/Includes結論を​​導き出すことができます。

つまり、定義を次のように変更しますpirt/interp/interpolation_.pxd

cdef double spline_type_to_id(self, spline_type)

に:

cdef double spline_type_to_id(self, spline_type) except *

もう一度実行setup.pyします。

于 2016-05-30T17:50:05.217 に答える