diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4a6bcf..510f651 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,6 +72,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: + CIBW_ENABLE: cpython-freethreading CIBW_BUILD: "cp3*" CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*" diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt index 728204d..a98b7a5 100644 --- a/c/CMakeLists.txt +++ b/c/CMakeLists.txt @@ -41,4 +41,5 @@ add_library(qdldlamd STATIC ${amd_src} $) target_include_directories(qdldlamd PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/amd/include ${CMAKE_CURRENT_SOURCE_DIR}/qdldl/include + ${CMAKE_CURRENT_BINARY_DIR}/qdldl/include ) diff --git a/c/qdldl b/c/qdldl index df48100..af62a6f 160000 --- a/c/qdldl +++ b/c/qdldl @@ -1 +1 @@ -Subproject commit df481005111f2864770a3eccb05ed4120727eff6 +Subproject commit af62a6f2c62725b9bc09811177006de037a1e800 diff --git a/cpp/wrapper.cpp b/cpp/wrapper.cpp index e63e074..c2d5c39 100644 --- a/cpp/wrapper.cpp +++ b/cpp/wrapper.cpp @@ -123,9 +123,14 @@ PySolver::PySolver(py::object A, const bool upper=false){ } - - +// py:mod_gil_not_used() is only available on newer pybind versions, and +// is only needed when the GIL is disabled, so hide its use unless we actually +// need it. +#ifdef Py_GIL_DISABLED +PYBIND11_MODULE(qdldl, m, py::mod_gil_not_used()) { +#else PYBIND11_MODULE(qdldl, m) { +#endif m.doc() = "QDLDL wrapper"; py::class_(m, "Solver") .def(py::init(), py::arg("A"), py::arg("upper") = false) diff --git a/setup.py b/setup.py index edb50ed..d7fc98e 100644 --- a/setup.py +++ b/setup.py @@ -98,6 +98,7 @@ def build_extensions(self): sources=glob(os.path.join('cpp', '*.cpp')), include_dirs=[os.path.join('c'), os.path.join('c', 'qdldl', 'include'), + os.path.join(qdldl_build_dir, 'qdldl', 'include'), get_pybind_include(), get_pybind_include(user=False)], language='c++',