user [email protected]
usertags 1120241 python3.15
tags 1120241 patch
thanks
Hi!
While rebuilding the python related packages against the Python 3.15rc2
version I ran into this FTBFS [1].
To get the package back to building, I had to apply a number of fixes:
- Backport the upstream commit 901e341 ("Don't refer to named cpdef enum
members through global namespace") [2]
- Add a patch to use CLFFT_SINGLE from clfftPrecision_
- Update patch to skip real_to_double tests that require a gpu when
running on a cpu
I've applied these fixes in the sandbox [3] to verify that it builds
successfully, these should be applied in Debian to get the package back
to a healthy state.
Happy hacking,
[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4597627/
[2]:
https://github.com/geggo/gpyfft/commit/901e3413352f666d9c44794ff4ebfa4bf3d4eb6c
[3]: https://debusine.debian.net/debian/r-python-python3.15/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
From: =?utf-8?q?Picca_Fr=C3=A9d=C3=A9ric-Emmanuel?= <[email protected]>
Date: Mon, 30 Aug 2021 11:19:10 +0200
Subject: add also the CPU devices for tests
---
gpyfft/test/util.py | 2 ++
1 file changed, 2 insertions(+)
Index: gpyfft/gpyfft/test/util.py
===================================================================
--- gpyfft.orig/gpyfft/test/util.py
+++ gpyfft/gpyfft/test/util.py
@@ -7,9 +7,15 @@ def get_contexts():
ALL_DEVICES = []
for platform in cl.get_platforms():
ALL_DEVICES += platform.get_devices(device_type = cl.device_type.GPU)
+ for platform in cl.get_platforms():
+ ALL_DEVICES += platform.get_devices(device_type = cl.device_type.CPU)
contexts = [ cl.Context([device]) for device in ALL_DEVICES ]
return contexts
def has_double(ctx):
dev = ctx.devices[0]
return 'cl_khr_fp64' in dev.extensions
+
+def is_cpu(ctx):
+ dev = ctx.devices[0]
+ return dev.type == cl.device_type.CPU
Index: gpyfft/gpyfft/test/test_gpyfft.py
===================================================================
--- gpyfft.orig/gpyfft/test/test_gpyfft.py
+++ gpyfft/gpyfft/test/test_gpyfft.py
@@ -5,7 +5,7 @@ import numpy as np
import pyopencl as cl
import pyopencl.array as cla
from gpyfft import FFT
-from gpyfft.test.util import get_contexts, has_double
+from gpyfft.test.util import get_contexts, has_double, is_cpu
"""
@@ -75,6 +75,8 @@ class test_fft(unittest.TestCase):
@parameterized.expand(contexts)
def test_1d_real_to_complex(self, ctx):
+ if is_cpu(ctx):
+ return
queue = cl.CommandQueue(ctx)
N = 32
@@ -94,6 +96,8 @@ class test_fft(unittest.TestCase):
@parameterized.expand(contexts)
def test_2d_real_to_complex(self, ctx):
+ if is_cpu(ctx):
+ return
queue = cl.CommandQueue(ctx)
M = 64
@@ -122,7 +126,7 @@ class test_fft(unittest.TestCase):
@parameterized.expand(contexts)
def test_2d_real_to_complex_double(self, ctx):
- if not has_double(ctx): #TODO: find better way to skip test
+ if not has_double(ctx) or is_cpu(ctx): #TODO: find better way to skip test
return
queue = cl.CommandQueue(ctx)
From: Szymon Łopaciuk <[email protected]>
Date: Mon, 19 May 2025 10:46:22 +0200
Subject: Don't refer to named cpdef enum members through global namespace
This behaviour was removed in Cython 3.1.0rc1:
"Named cpdef enums no longer copy their item names into the global
module namespace. This was considered unhelpful for named enums
which already live in their own class namespace."
Signed-off-by: Szymon Łopaciuk <[email protected]>
---
Index: gpyfft/gpyfft/fft.py
===================================================================
--- gpyfft.orig/gpyfft/fft.py
+++ gpyfft/gpyfft/fft.py
@@ -63,14 +63,14 @@ class FFT(object):
#complex128 <-> complex128
if in_array.dtype in (np.float32, np.complex64):
- precision = gfft.CLFFT_SINGLE
+ precision = gfft.clfftPrecision_.CLFFT_SINGLE
elif in_array.dtype in (np.float64, np.complex128):
- precision = gfft.CLFFT_DOUBLE
+ precision = gfft.clfftPrecision_.CLFFT_DOUBLE
#TODO: add assertions that precision match
if in_array.dtype in (np.float32, np.float64):
- layout_in = gfft.CLFFT_REAL
- layout_out = gfft.CLFFT_HERMITIAN_INTERLEAVED
+ layout_in = gfft.clfftLayout_.CLFFT_REAL
+ layout_out = gfft.clfftLayout_.CLFFT_HERMITIAN_INTERLEAVED
expected_out_shape = list(in_array.shape)
expected_out_shape[axes_transform[0]] = expected_out_shape[axes_transform[0]]//2 + 1
@@ -79,17 +79,17 @@ class FFT(object):
elif in_array.dtype in (np.complex64, np.complex128):
if not real:
- layout_in = gfft.CLFFT_COMPLEX_INTERLEAVED
- layout_out = gfft.CLFFT_COMPLEX_INTERLEAVED
+ layout_in = gfft.clfftLayout_.CLFFT_COMPLEX_INTERLEAVED
+ layout_out = gfft.clfftLayout_.CLFFT_COMPLEX_INTERLEAVED
else:
# complex-to-real transform
- layout_in = gfft.CLFFT_HERMITIAN_INTERLEAVED
- layout_out = gfft.CLFFT_REAL
+ layout_in = gfft.clfftLayout_.CLFFT_HERMITIAN_INTERLEAVED
+ layout_out = gfft.clfftLayout_.CLFFT_REAL
t_shape = t_shape_out
- if t_inplace and ((layout_in is gfft.CLFFT_REAL) or
- (layout_out is gfft.CLFFT_REAL)):
- assert ((in_array.strides[axes_transform[0]] == in_array.dtype.itemsize) and \
+ if t_inplace and ((layout_in is gfft.clfftLayout_.CLFFT_REAL) or
+ (layout_out is gfft.clfftLayout_.CLFFT_REAL)):
+ assert ((in_array.strides[axes_transform[0]] == in_array.dtype.itemsize) and
(out_array.strides[axes_transform[0]] == out_array.dtype.itemsize)), \
'inline real transforms need stride 1 for first transform axis'
From: Maximiliano Curia <[email protected]>
Date: Fri, 11 Sep 2026 12:00:00 +0200
Subject: Fix test_callback.py for Cython 3.1
---
Index: gpyfft/gpyfft/test/test_callback.py
===================================================================
--- gpyfft.orig/gpyfft/test/test_callback.py
+++ gpyfft/gpyfft/test/test_callback.py
@@ -9,6 +9,7 @@ import pyopencl as cl
import pyopencl.array as cla
from gpyfft.gpyfftlib import *
+from gpyfft.gpyfftlib import clfftPrecision_
from gpyfft.test.util import get_contexts
@@ -60,7 +61,7 @@ return ret;
plan.inplace = False
- plan.precision = CLFFT_SINGLE
+ plan.precision = clfftPrecision_.CLFFT_SINGLE
print('plan.precision:', plan.precision)
plan.scale_forward = 1.
@@ -136,7 +137,7 @@ return ret;
plan.strides_in = tuple(x // cl_data.dtype.itemsize for x in cl_data.strides)
plan.strides_out = tuple(x // cl_data.dtype.itemsize for x in cl_data_transformed.strides)
plan.inplace = False
- plan.precision = CLFFT_SINGLE
+ plan.precision = clfftPrecision_.CLFFT_SINGLE
plan.set_callback(b'postset',
self.callback_kernel_src_postset,
'post',