Skip to content

Commit b07d7ca

Browse files
authored
Merge pull request #526 from isuruf/freethreading
Tell cython that we are freethreading compatible
2 parents 4f0775a + 46f2955 commit b07d7ca

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,24 +120,24 @@ jobs:
120120
PYTHON_VERSION: '3.13'
121121
WITH_SCIPY: yes
122122
WITH_LLVM: 5.0
123-
OS: macos-13
123+
OS: macos-15-intel
124124
CC: clang
125125

126126
- BUILD_TYPE: Release
127127
PYTHON_VERSION: '3.9'
128128
WITH_NUMPY: no
129-
OS: macos-13
129+
OS: macos-15-intel
130130
CC: clang
131131

132132
- BUILD_TYPE: Debug
133133
PYTHON_VERSION: '3.13'
134134
WITH_NUMPY: no
135-
OS: macos-13
135+
OS: macos-15-intel
136136
CC: gcc
137137

138138
- BUILD_TYPE: Release
139139
PYTHON_VERSION: '3.13'
140-
OS: macos-13
140+
OS: macos-15-intel
141141
CC: gcc
142142

143143
- BUILD_TYPE: Release

symengine/lib/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,16 @@ add_custom_command(
3131
COMMENT "Preprocessing symengine_wrapper.in.pyx"
3232
)
3333

34+
if ("${CYTHON_VERSION}" VERSION_GREATER_EQUAL "3.1")
35+
set(CYTHON_EXTRA_ARGS "-Xfreethreading_compatible=True")
36+
endif()
37+
3438
cython_transpile(
3539
${CMAKE_CURRENT_BINARY_DIR}/symengine_wrapper.pyx
3640
LANGUAGE CXX
3741
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/symengine_wrapper.cpp
3842
CYTHON_ARGS
43+
${CYTHON_EXTRA_ARGS}
3944
-I ${CMAKE_CURRENT_BINARY_DIR}
4045
-I ${CMAKE_CURRENT_SOURCE_DIR}
4146
)
@@ -101,7 +106,7 @@ install(
101106
FILES
102107
__init__.py
103108
symengine.pxd
104-
symengine_wrapper.pxd
109+
${CMAKE_CURRENT_BINARY_DIR}/symengine_wrapper.pxd
105110
pywrapper.h
106111
DESTINATION symengine/lib
107112
)

0 commit comments

Comments
 (0)