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

[main] Add Cython3 support (still support Cytnon 0.29) #1571

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

narategithub
Copy link
Collaborator

@narategithub narategithub commented Jan 9, 2025

This patch addressed issues with Cython3. The patch does not break Cython 0.29 compatibility.

Cython3 became the stock package on Ubuntu 24.04. The change in Cython language policy requires explicit except directive on the C function pointer type; otherwise, the function pointer type was assumed noexcept but the actual function implementations without except directive is assumed except *, making them not able to be assigned as callback functions.

In addition, Cython 3.0.8 (stock package on Ubuntu 24.04) has Enum generation bug (multiple declarations of same Enum). When ldms_xprt_event_type type enum type is explicitly referred to in ldms_xprt_event struct, Cython 3.0.8 somehow generated the same Enum "type_to_py" functions twice -- leading to compilation error. By declaring the type field as int type, the redundant "type_to_py" functions of the same enum disappeared. The fix for this particular Cython3 bug was fixed in Cython 3.0.9
(cython/cython#5905). Since Ubuntu 24.04 shipped with Cython 3.0.8, I think we have to stick with this work-around for now.

@narategithub narategithub requested a review from tom95858 January 9, 2025 03:59
@narategithub
Copy link
Collaborator Author

@tom95858 I sniff test this on Ubuntu 24.04 (Cython3) and ldms-dev container (Ubuntu 22.04; Cython 0.29).

@narategithub narategithub changed the title Add Cython3 support (still support Cytnon 0.29) [main] Add Cython3 support (still support Cytnon 0.29) Jan 9, 2025
@narategithub narategithub added this to the v4.5.1 milestone Jan 9, 2025
This patch addressed issues with Cython3. The patch does not break
Cython 0.29 compatibility.

Cython3 became the stock package on Ubuntu 24.04. The change in Cython
language policy requires explicit `except` directive on the C function
pointer type; otherwise, the function pointer type was assumed
`noexcept` but the actual function implementations without `except`
directive is assumed `except *`, making them not able to be assigned as
callback functions.

In addition, Cython 3.0.8 (stock package on Ubuntu 24.04) has Enum
generation bug (multiple declarations of same Enum). When
`ldms_xprt_event_type type` enum type is explicitly referred to in
`ldms_xprt_event` struct, Cython 3.0.8 somehow generated the
same Enum "type_to_py" functions twice -- leading to compilation error.
By declaring the `type` field as `int type`, the redundant "type_to_py"
functions of the same enum disappeared. The fix for this particular
Cython3 bug was fixed in Cython 3.0.9
(cython/cython#5905). Since Ubuntu 24.04 shipped
with Cython 3.0.8, I think we have to stick with this work-around for
now.
@tom95858
Copy link
Collaborator

tom95858 commented Jan 9, 2025

@narategithub we need this same fix in b4.4.

@tom95858 tom95858 merged commit a844324 into ovis-hpc:main Jan 9, 2025
14 checks passed
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

Successfully merging this pull request may close these issues.

2 participants