setup issue when PyOpencl not installed
When Cython is not installed you have the following error:
creating build/temp.linux-x86_64-3.8/PyHST/segment
compile options: '-I/users/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.8/site-packages/numpy/core/include -I/usr/include/openmpi/ -I/users/payno/.local/share/virtualenvs/tomwer_venv/include -I/usr/include/python3.8 -c'
extra options: 'gcc'
EXTRA {'gcc': ['-fopenmp', '-fPIC', '-O3']}
mpicc: PyHST/segment/segment_cy.cpp
EXTRA {'gcc': ['-fopenmp', '-fPIC', '-O3']}
mpicc: PyHST/segment/segment.cc
gcc: error: PyHST/segment/segment_cy.cpp: No such file or directory
gcc: fatal error: no input files
compilation terminated.
error: Command "mpicc -I/users/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.8/site-packages/numpy/core/include -I/usr/include/openmpi/ -I/users/payno/.local/share/virtualenvs/tomwer_venv/include -I/usr/include/python3.8 -c PyHST/segment/segment_cy.cpp -o build/temp.linux-x86_64-3.8/PyHST/segment/segment_cy.o -fopenmp -fPIC -O3" failed with exit status 1
This come from this part od the code
try:
from Cython.Distutils import build_ext, Extension
CYTHON = True
except ImportError:
CYTHON = False
where Extension is already imported from distutils (at the beginning of the code) So I guess you should use an alias or something like:
try:
from Cython.Distutils import build_ext
CYTHON = True
except ImportError:
CYTHON = False
from distutils.command.build_ext import build_ext
# this way you can remove line 329
else:
from Cython.Distutils import Extension