invesalius/invesalius3

Building Cython modules fails in Ubuntu

okahilak opened this issue · 3 comments

After commit 80fe768, running python3 setup.py build_ext --inplace seems to fail with the following error:

[1/5] Cythonizing invesalius_cy/cy_mesh.pyx

Error compiling Cython file:
------------------------------------------------------------
...
        pd.SetPoints(points)
        pd.SetPolys(triangles)

        return pd

    cdef vector[vertex_id_t]* get_faces_by_vertex(self, int v_id) noexcept nogil:
                                                                 ^
------------------------------------------------------------

invesalius_cy/cy_mesh.pyx:143:66: Syntax error in C variable declaration
Traceback (most recent call last):
  File "/home/mtms/mtms/ros2_ws/src/neuronavigation/neuronavigation/invesalius3/setup.py", line 76, in <module>
    ext_modules=cythonize(
  File "/usr/lib/python3/dist-packages/Cython/Build/Dependencies.py", line 1127, in cythonize
    cythonize_one(*args)
  File "/usr/lib/python3/dist-packages/Cython/Build/Dependencies.py", line 1250, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: invesalius_cy/cy_mesh.pyx

I'm using Ubuntu 22.04.3 LTS. I installed Cython by running: sudo apt-get install -y cython3.

Running cython3 --version returns:

Cython version 0.29.28

@tfmoraes Hi, we got this problem while trying to build InVesalius in Ubuntu 22.04. Would you be able to check it out?
Thanks!

Hi @okahilak and @sotodela . Try to install Cython from pip. I updated the requirements.txt to use Cython 3.

Hi @tfmoraes it worked and also for our purposes in docker thanks!