Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building issue #30

Open
spreiter opened this issue Jul 16, 2024 · 2 comments
Open

Building issue #30

spreiter opened this issue Jul 16, 2024 · 2 comments

Comments

@spreiter
Copy link

spreiter commented Jul 16, 2024

Hi,

I recently tried to install pylandau and found two issues. I forked the repo to our own GitLab instances, so I could build packages with different Python versions using the manylinux images and found the following two problems.

  1. does not compile with Python 3.12
  2. does not compile with Cython 3

I could fix (2) quite easily by changing pyproject.toml:

-    "cython>=0.29",
+    "cython<3,>=0.29",

The issue for Python 3.12 seems more complex and I was not able to dig through.

PS: I also realized that the package builds for Python 3.7. Is there a reason to not support it? There is also no demand from my side, I am just curious ;)

@cuddandr
Copy link

cuddandr commented Aug 7, 2024

I also encountered this issue with using Python 3.11 and had to downgrade the Cython version to 0.29.34 to get pylandau to compile.

There also seems to be some complaints from setuptools complaining about the pyproject.toml, however that seems to go away when using the downgraded Cython.

For reference, I get the following compilation errors when using Cython 3+

pyLandau/cpp/pylandau.cpp: In function ‘PyObject* __pyx_pf_8pylandau_6landau_pdf(PyObject*, PyArrayObject*, PyObject*, PyObject*)’:
      pyLandau/cpp/pylandau.cpp:6622:36: error: invalid cast of a prvalue expression of type ‘char*’ to type ‘double*&’
       6622 |     __pyx_t_10 = getLandauPDFData(((double *&)__pyx_f_5numpy_7ndarray_4data_data(((PyArrayObject *)__pyx_v_array))), ((unsigned int const &)(__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_array))[0])), ((double const &)__pyx_t_8), ((double const &)__pyx_t_9));
            |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      pyLandau/cpp/pylandau.cpp: In function ‘PyObject* __pyx_pf_8pylandau_8langau_pdf(PyObject*, PyArrayObject*, PyObject*, PyObject*, PyObject*)’:
      pyLandau/cpp/pylandau.cpp:6974:36: error: invalid cast of a prvalue expression of type ‘char*’ to type ‘double*&’
       6974 |     __pyx_t_11 = getLangauPDFData(((double *&)__pyx_f_5numpy_7ndarray_4data_data(((PyArrayObject *)__pyx_v_array))), ((unsigned int const &)(__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_array))[0])), ((double const &)__pyx_t_8), ((double const &)__pyx_t_9), ((double const &)__pyx_t_10));
            |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@cbespin
Copy link
Collaborator

cbespin commented Aug 22, 2024

Thanks for looking into this. I could not get pylandau to work with python 3.12 for myself, but the problem seems far from trivial. Might even be connected to the cython3 problem, which I have not tried yet. I have to dig into this further, but ideally I will move the whole package to numba or pybind instead of cython that gave me a lot of headaches since I took over the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants