Skip to content

Commit

Permalink
pyverbs: Adapt includes in Fedora 39
Browse files Browse the repository at this point in the history
Replace Cython includes with cimports to work around a Cython 3 bug
(#5860 on the Cython GitHub) that causes the following compilation
errors:

build/pyverbs/device.c:14743:18: error: redefinition of ‘__Pyx_Enum_enum__space_ibv_event_type_to_py’
14743 | static PyObject *__Pyx_Enum_enum__space_ibv_event_type_to_py(enum ibv_event_type __pyx_v_c_val) {
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/pyverbs/device.c:10914:18: note: previous definition of ‘__Pyx_Enum_enum__space_ibv_event_type_to_py’ with
type ‘PyObject *(enum ibv_event_type)’ {aka ‘struct _object *(enum ibv_event_type)’}
10914 | static PyObject *__Pyx_Enum_enum__space_ibv_event_type_to_py(enum ibv_event_type __pyx_v_c_val) {
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Edward Srouji <[email protected]>
  • Loading branch information
EdwardSro committed Jan 21, 2024
1 parent c0377a2 commit 4dbbf9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pyverbs/libibverbs.pxd
Expand Up @@ -3,9 +3,10 @@

#cython: language_level=3

include 'libibverbs_enums.pxd'
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t
from posix.time cimport timespec
from pyverbs.libibverbs_enums cimport *


cdef extern from 'infiniband/verbs.h':

Expand Down
5 changes: 3 additions & 2 deletions pyverbs/librdmacm.pxd
Expand Up @@ -3,9 +3,10 @@

#cython: language_level=3

include 'libibverbs.pxd'
include 'librdmacm_enums.pxd'
from libc.stdint cimport uint8_t, uint32_t
from pyverbs.librdmacm_enums cimport *
from pyverbs.libibverbs cimport *


cdef extern from '<rdma/rdma_cma.h>':

Expand Down
3 changes: 1 addition & 2 deletions pyverbs/providers/mlx5/libmlx5.pxd
Expand Up @@ -3,13 +3,12 @@

#cython: language_level=3

include 'mlx5_enums.pxd'

from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t
from posix.types cimport off_t
from libcpp cimport bool
cimport libc.stdio as s

from pyverbs.providers.mlx5.mlx5_enums cimport *
cimport pyverbs.libibverbs as v


Expand Down

0 comments on commit 4dbbf9b

Please sign in to comment.