Skip to content

Commit 48ecdd8

Browse files
committed
Fix cython 3.1 and win
1 parent 56b8be1 commit 48ecdd8

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

recipe/0001-cython-3.1-fixes.patch

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From 1e47d959c4edd9c15e1f893a570e4b0082a39501 Mon Sep 17 00:00:00 2001
2+
From: Isuru Fernando <[email protected]>
3+
Date: Sun, 29 Sep 2024 16:25:26 -0500
4+
Subject: [PATCH] cython 3.1 fixes
5+
6+
---
7+
cmake/cython_test.pyx | 3 ---
8+
symengine/lib/symengine_wrapper.in.pyx | 8 ++++----
9+
2 files changed, 4 insertions(+), 7 deletions(-)
10+
11+
diff --git a/cmake/cython_test.pyx b/cmake/cython_test.pyx
12+
index 22cdb17..cb803c6 100644
13+
--- a/cmake/cython_test.pyx
14+
+++ b/cmake/cython_test.pyx
15+
@@ -1,6 +1,3 @@
16+
-# Test that numpy works in Cython:
17+
-from numpy cimport ndarray
18+
-
19+
# Test that libcpp module is present:
20+
from libcpp.vector cimport vector
21+
from libcpp.string cimport string
22+
diff --git a/symengine/lib/symengine_wrapper.in.pyx b/symengine/lib/symengine_wrapper.in.pyx
23+
index 8bb9f9c..26c31ad 100644
24+
--- a/symengine/lib/symengine_wrapper.in.pyx
25+
+++ b/symengine/lib/symengine_wrapper.in.pyx
26+
@@ -5135,24 +5135,24 @@ cdef class _Lambdify(object):
27+
return result
28+
29+
30+
-cdef double _scipy_callback_lambda_real(int n, double *x, void *user_data) nogil:
31+
+cdef double _scipy_callback_lambda_real(int n, double *x, void *user_data) noexcept nogil:
32+
cdef symengine.LambdaRealDoubleVisitor* lamb = <symengine.LambdaRealDoubleVisitor *>user_data
33+
cdef double result
34+
deref(lamb).call(&result, x)
35+
return result
36+
37+
-cdef void _ctypes_callback_lambda_real(double *output, const double *input, void *user_data) nogil:
38+
+cdef void _ctypes_callback_lambda_real(double *output, const double *input, void *user_data) noexcept nogil:
39+
cdef symengine.LambdaRealDoubleVisitor* lamb = <symengine.LambdaRealDoubleVisitor *>user_data
40+
deref(lamb).call(output, input)
41+
42+
IF HAVE_SYMENGINE_LLVM:
43+
- cdef double _scipy_callback_llvm_real(int n, double *x, void *user_data) nogil:
44+
+ cdef double _scipy_callback_llvm_real(int n, double *x, void *user_data) noexcept nogil:
45+
cdef symengine.LLVMDoubleVisitor* lamb = <symengine.LLVMDoubleVisitor *>user_data
46+
cdef double result
47+
deref(lamb).call(&result, x)
48+
return result
49+
50+
- cdef void _ctypes_callback_llvm_real(double *output, const double *input, void *user_data) nogil:
51+
+ cdef void _ctypes_callback_llvm_real(double *output, const double *input, void *user_data) noexcept nogil:
52+
cdef symengine.LLVMDoubleVisitor* lamb = <symengine.LLVMDoubleVisitor *>user_data
53+
deref(lamb).call(output, input)
54+
55+
--
56+
2.44.0
57+

recipe/bld.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type %RECIPE_DIR%\\UPSTREAM_LICENSES.txt >> LICENSE
3737
if errorlevel 1 exit 1
3838

3939
set dep_dir=%LIBRARY_BIN%
40-
python %RECIPE_DIR%\fix_windows_wheel.py ^
40+
%PYTHON% %RECIPE_DIR%\fix_windows_wheel.py ^
4141
%dep_dir%\mpir.dll ^
4242
%dep_dir%\mpfr.dll ^
4343
%dep_dir%\mpc.dll ^

0 commit comments

Comments
 (0)