From b131af835fbb1e4b7df38615d199b6e535c26b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Tue, 28 May 2024 16:41:21 +0200 Subject: [PATCH 01/40] Bump one CI config to ubuntu-24.04 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6993dd9e..33c2dceb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: WITH_BFD: yes PYTHON_VERSION: '3.12' TEST_SYMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-24.04 CC: gcc - BUILD_TYPE: Debug From 02bd6d4a37ef62a9bd8588e100b040459f70b40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Tue, 28 May 2024 16:49:43 +0200 Subject: [PATCH 02/40] try to work around hardcoded versions in symengine's install_travis.sh --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33c2dceb..4a44aa8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: PYTHON_VERSION: '3.12' TEST_SYMPY: yes OS: ubuntu-24.04 - CC: gcc + CC: 'ccache gcc' # symengine's bin/install_travis.sh needs refactoring... - BUILD_TYPE: Debug WITH_BFD: yes From fdff48def4d936eb9f7935b3bfef35096aadd83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Tue, 28 May 2024 16:54:42 +0200 Subject: [PATCH 03/40] try another workaround --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a44aa8a..9cddcb2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: PYTHON_VERSION: '3.12' TEST_SYMPY: yes OS: ubuntu-24.04 - CC: 'ccache gcc' # symengine's bin/install_travis.sh needs refactoring... + CC: 'gcc -v' # symengine's bin/install_travis.sh needs refactoring... - BUILD_TYPE: Debug WITH_BFD: yes From 8a4f3b895050c6164ba5ee1ee19d7fa13238d1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Tue, 28 May 2024 16:58:18 +0200 Subject: [PATCH 04/40] also set CXX --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cddcb2b..b4156101 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ jobs: TEST_SYMPY: yes OS: ubuntu-24.04 CC: 'gcc -v' # symengine's bin/install_travis.sh needs refactoring... + CXX: 'g++ -v' - BUILD_TYPE: Debug WITH_BFD: yes From de69b995e9116356823960253de046fee294f43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Fri, 31 May 2024 10:19:53 +0200 Subject: [PATCH 05/40] test against symengine/symengine#2026 --- .github/workflows/ci.yml | 3 +-- bin/test_symengine_unix.sh | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4156101..33c2dceb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,7 @@ jobs: PYTHON_VERSION: '3.12' TEST_SYMPY: yes OS: ubuntu-24.04 - CC: 'gcc -v' # symengine's bin/install_travis.sh needs refactoring... - CXX: 'g++ -v' + CC: gcc - BUILD_TYPE: Debug WITH_BFD: yes diff --git a/bin/test_symengine_unix.sh b/bin/test_symengine_unix.sh index 976f305d..63e3f6ca 100644 --- a/bin/test_symengine_unix.sh +++ b/bin/test_symengine_unix.sh @@ -2,10 +2,10 @@ export PYTHON_SOURCE_DIR=`pwd` export TEST_CPP="no" export MAKEFLAGS="-j2" -git clone https://github.com/symengine/symengine symengine-cpp +git clone -b update-CI https://github.com/bjodah/symengine symengine-cpp cd symengine-cpp export SOURCE_DIR=`pwd` -git checkout `cat ../symengine_version.txt` +#git checkout `cat ../symengine_version.txt` cd .. # Setup travis for C++ library From b4933abc696fcd7d68dc999db66888b264cad26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Fri, 31 May 2024 10:50:21 +0200 Subject: [PATCH 06/40] use gcc-13 & llvm-18 under ubuntu-24.04 --- .github/workflows/ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33c2dceb..55c844f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: WITH_BFD: yes PYTHON_VERSION: '3.12' TEST_SYMPY: yes - OS: ubuntu-24.04 + OS: ubuntu-20.04 CC: gcc - BUILD_TYPE: Debug @@ -97,15 +97,16 @@ jobs: CC: clang - BUILD_TYPE: Debug - PYTHON_VERSION: '3.10' + PYTHON_VERSION: '3.12' WITH_SYMPY: yes - WITH_LLVM: 14 + WITH_LLVM: 18 WITH_SCIPY: yes INTEGER_CLASS: 'boostmp' PYTEST_ADDOPTS: '-k "not integer_nthroot"' - OS: ubuntu-22.04 - EXTRA_APT_REPOSITORY: 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main' - EXTRA_APT_PACKAGES: 'llvm-14' + OS: ubuntu-24.04 + CC: gcc # ubuntu nobel uses gcc-13 + #EXTRA_APT_REPOSITORY: 'deb http://apt.llvm.org/jammy/ llvm-toolchain-nobel-18 main' + EXTRA_APT_PACKAGES: 'llvm-18' - BUILD_TYPE: Debug PYTHON_VERSION: '3.8' From 43f282a8111970ed06ee813f75bf591edd257338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Fri, 31 May 2024 11:16:29 +0200 Subject: [PATCH 07/40] long is not a built-in --- symengine/lib/symengine_wrapper.in.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symengine/lib/symengine_wrapper.in.pyx b/symengine/lib/symengine_wrapper.in.pyx index 76b8288d..61cb4d6b 100644 --- a/symengine/lib/symengine_wrapper.in.pyx +++ b/symengine/lib/symengine_wrapper.in.pyx @@ -1214,7 +1214,7 @@ cdef class Basic(object): return int(float(self)) def __long__(self): - return long(float(self)) + return int(float(self)) def __complex__(self): f = self.n(real=False) From 1e47d959c4edd9c15e1f893a570e4b0082a39501 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 29 Sep 2024 16:25:26 -0500 Subject: [PATCH 08/40] cython 3.1 fixes --- cmake/cython_test.pyx | 3 --- symengine/lib/symengine_wrapper.in.pyx | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cmake/cython_test.pyx b/cmake/cython_test.pyx index 22cdb17c..cb803c60 100644 --- a/cmake/cython_test.pyx +++ b/cmake/cython_test.pyx @@ -1,6 +1,3 @@ -# Test that numpy works in Cython: -from numpy cimport ndarray - # Test that libcpp module is present: from libcpp.vector cimport vector from libcpp.string cimport string diff --git a/symengine/lib/symengine_wrapper.in.pyx b/symengine/lib/symengine_wrapper.in.pyx index 8bb9f9cb..26c31ad8 100644 --- a/symengine/lib/symengine_wrapper.in.pyx +++ b/symengine/lib/symengine_wrapper.in.pyx @@ -5135,24 +5135,24 @@ cdef class _Lambdify(object): return result -cdef double _scipy_callback_lambda_real(int n, double *x, void *user_data) nogil: +cdef double _scipy_callback_lambda_real(int n, double *x, void *user_data) noexcept nogil: cdef symengine.LambdaRealDoubleVisitor* lamb = user_data cdef double result deref(lamb).call(&result, x) return result -cdef void _ctypes_callback_lambda_real(double *output, const double *input, void *user_data) nogil: +cdef void _ctypes_callback_lambda_real(double *output, const double *input, void *user_data) noexcept nogil: cdef symengine.LambdaRealDoubleVisitor* lamb = user_data deref(lamb).call(output, input) IF HAVE_SYMENGINE_LLVM: - cdef double _scipy_callback_llvm_real(int n, double *x, void *user_data) nogil: + cdef double _scipy_callback_llvm_real(int n, double *x, void *user_data) noexcept nogil: cdef symengine.LLVMDoubleVisitor* lamb = user_data cdef double result deref(lamb).call(&result, x) return result - cdef void _ctypes_callback_llvm_real(double *output, const double *input, void *user_data) nogil: + cdef void _ctypes_callback_llvm_real(double *output, const double *input, void *user_data) noexcept nogil: cdef symengine.LLVMDoubleVisitor* lamb = user_data deref(lamb).call(output, input) From 845168d3683f28781b32577abf4f38ed93f0bc79 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 30 Sep 2024 11:38:54 -0500 Subject: [PATCH 09/40] Another cython 3.1 fix --- cmake/cython_test.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/cython_test.pyx b/cmake/cython_test.pyx index cb803c60..47f98476 100644 --- a/cmake/cython_test.pyx +++ b/cmake/cython_test.pyx @@ -75,8 +75,8 @@ cdef extern from "" namespace "SymEngine": string get_name() nogil cdef extern from "" namespace "SymEngine": - cdef RCP[Basic] add(RCP[Basic] &a, RCP[Basic] &b) nogil except+ - cdef RCP[Basic] sub(RCP[Basic] &a, RCP[Basic] &b) nogil except+ + cdef RCP[Basic] add(RCP[Basic] &a, RCP[Basic] &b) except+ nogil + cdef RCP[Basic] sub(RCP[Basic] &a, RCP[Basic] &b) except+ nogil cdef cppclass Add(Basic): void as_two_terms(const Ptr[RCP[Basic]] &a, const Ptr[RCP[Basic]] &b) From 170e7ded46b60ee43ec1e6ee997fd95205cad2f4 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 30 Sep 2024 11:39:06 -0500 Subject: [PATCH 10/40] freethreading support --- cmake/FindPython.cmake | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake index f3381327..2f54f509 100644 --- a/cmake/FindPython.cmake +++ b/cmake/FindPython.cmake @@ -22,26 +22,36 @@ execute_process( string(STRIP ${PYTHON_LIB_PATH} PYTHON_LIB_PATH) execute_process( - COMMAND ${PYTHON_BIN} -c "import sys; print(sys.prefix)" - OUTPUT_VARIABLE PYTHON_PREFIX_PATH - ) + COMMAND ${PYTHON_BIN} -c "import sys; print(sys.prefix)" + OUTPUT_VARIABLE PYTHON_PREFIX_PATH +) string(STRIP ${PYTHON_PREFIX_PATH} PYTHON_PREFIX_PATH) execute_process( - COMMAND ${PYTHON_BIN} -c "import sys; print('%s.%s' % sys.version_info[:2])" + COMMAND ${PYTHON_BIN} -c "import sys; print('%s.%s' % sys.version_info[:2])" OUTPUT_VARIABLE PYTHON_VERSION - ) +) string(STRIP ${PYTHON_VERSION} PYTHON_VERSION) message(STATUS "Python version: ${PYTHON_VERSION}") string(REPLACE "." "" PYTHON_VERSION_WITHOUT_DOTS ${PYTHON_VERSION}) +execute_process( + COMMAND ${PYTHON_BIN} -c "import sysconfig;print(bool(sysconfig.get_config_var('Py_GIL_DISABLED')))" + OUTPUT_VARIABLE PY_GIL_DISABLED +) +string(STRIP ${PY_GIL_DISABLED} PY_GIL_DISABLED) + +if ("${PY_GIL_DISABLED}" STREQUAL "True") + set (PY_THREAD "t") +endif() + if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") FIND_LIBRARY(PYTHON_LIBRARY NAMES - python${PYTHON_VERSION} + python${PYTHON_VERSION}${PY_THREAD} python${PYTHON_VERSION}m - python${PYTHON_VERSION_WITHOUT_DOTS} + python${PYTHON_VERSION_WITHOUT_DOTS}${PY_THREAD} PATHS ${PYTHON_LIB_PATH} ${PYTHON_PREFIX_PATH}/lib ${PYTHON_PREFIX_PATH}/libs PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE} NO_DEFAULT_PATH @@ -51,8 +61,8 @@ endif() execute_process( COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['purelib'])" - OUTPUT_VARIABLE PYTHON_INSTALL_PATH_tmp - ) + OUTPUT_VARIABLE PYTHON_INSTALL_PATH_tmp +) string(STRIP ${PYTHON_INSTALL_PATH_tmp} PYTHON_INSTALL_PATH_tmp) set(PYTHON_INSTALL_PATH ${PYTHON_INSTALL_PATH_tmp} CACHE BOOL "Python install path") @@ -129,5 +139,9 @@ macro(ADD_PYTHON_LIBRARY name) IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") target_link_libraries(${name} ${PYTHON_LIBRARY}) set_target_properties(${name} PROPERTIES SUFFIX ".pyd") + IF("${PY_GIL_DISABLED}" STREQUAL "True") + target_compile_definitions(${name} PRIVATE Py_GIL_DISABLED=1) + ENDIF() ENDIF() + endmacro(ADD_PYTHON_LIBRARY) From 8157e6a483b72a6278606ebf5c53f2fae414e734 Mon Sep 17 00:00:00 2001 From: Aaron Miller <78561124+aaron-skydio@users.noreply.github.com> Date: Fri, 20 Dec 2024 21:18:50 -0800 Subject: [PATCH 11/40] Fix build with spaces Building symenginepy as part of the SymForce build, I get an error currently if I try to build under a source directory with a space in the path: ``` [100%] Linking CXX shared library symengine_wrapper.cpython-38-x86_64-linux-gnu.so c++: error: test/build/symenginepy-prefix/src/symenginepy-build/build/lib.linux-x86_64-cpython-38/symengine/lib/version_script_symengine_wrapper.txt: No such file or directory make[5]: *** [symengine/lib/CMakeFiles/symengine_wrapper.dir/build.make:121: symengine/lib/symengine_wrapper.cpython-38-x86_64-linux-gnu.so] Error 1 make[4]: *** [CMakeFiles/Makefile2:132: symengine/lib/CMakeFiles/symengine_wrapper.dir/all] Error 2 make[3]: *** [Makefile:136: all] Error 2 error: error building project make[2]: *** [CMakeFiles/symenginepy.dir/build.make:86: symenginepy-prefix/src/symenginepy-stamp/symenginepy-build] Error 1 ``` This change seems to fix that. I'm not 100% sure in what scenarios this applies to a standalone build of symengine? But I figured I'd open a PR and propose this change Coming from here on the SymForce repo: https://github.com/symforce-org/symforce/pull/414 --- cmake/FindPython.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake index 2f54f509..df8bfdc1 100644 --- a/cmake/FindPython.cmake +++ b/cmake/FindPython.cmake @@ -130,7 +130,7 @@ macro(ADD_PYTHON_LIBRARY name) configure_file(${CMAKE_SOURCE_DIR}/cmake/version_script.txt ${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt @ONLY) set_property(TARGET ${name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt") + LINK_FLAGS " \"-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt\"") ELSE() add_library(${name} SHARED ${ARGN}) ENDIF() From 0bc912b865cc4ce643011c92d93c9ffb7670c67a Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 21 Dec 2024 14:46:10 +0530 Subject: [PATCH 12/40] Fix CI --- bin/install_travis.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/install_travis.sh b/bin/install_travis.sh index 8176202d..572bb0d2 100644 --- a/bin/install_travis.sh +++ b/bin/install_travis.sh @@ -2,7 +2,7 @@ # symengine's bin/install_travis.sh will install miniconda -export conda_pkgs="python=${PYTHON_VERSION} pip 'cython>=0.29.24' pytest gmp mpfr" +export conda_pkgs="python=${PYTHON_VERSION} pip pytest gmp mpfr" if [[ "${WITH_NUMPY}" != "no" ]]; then export conda_pkgs="${conda_pkgs} numpy"; @@ -27,7 +27,7 @@ if [[ "${WITH_SAGE}" == "yes" ]]; then export conda_pkgs="${conda_pkgs} sage=8.1"; fi -conda install -q ${conda_pkgs} +conda install -q ${conda_pkgs} "cython>=0.29.24" if [[ "${WITH_SYMPY}" != "no" ]]; then pip install sympy; From 21485318d0ba4ece84df8fb9b2cc646fd2fea06c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Mon, 13 Jan 2025 15:16:48 +0100 Subject: [PATCH 13/40] normlize cython syntax: cython/cython#5430 --- cmake/cython_test.pyx | 4 +- symengine/lib/symengine.pxd | 304 ++++++++++++++++++------------------ 2 files changed, 154 insertions(+), 154 deletions(-) diff --git a/cmake/cython_test.pyx b/cmake/cython_test.pyx index 47f98476..e97be0b4 100644 --- a/cmake/cython_test.pyx +++ b/cmake/cython_test.pyx @@ -75,8 +75,8 @@ cdef extern from "" namespace "SymEngine": string get_name() nogil cdef extern from "" namespace "SymEngine": - cdef RCP[Basic] add(RCP[Basic] &a, RCP[Basic] &b) except+ nogil - cdef RCP[Basic] sub(RCP[Basic] &a, RCP[Basic] &b) except+ nogil + cdef RCP[Basic] add(RCP[Basic] &a, RCP[Basic] &b) nogil except + + cdef RCP[Basic] sub(RCP[Basic] &a, RCP[Basic] &b) nogil except + cdef cppclass Add(Basic): void as_two_terms(const Ptr[RCP[Basic]] &a, const Ptr[RCP[Basic]] &b) diff --git a/symengine/lib/symengine.pxd b/symengine/lib/symengine.pxd index 3e2b5d08..65b3456a 100644 --- a/symengine/lib/symengine.pxd +++ b/symengine/lib/symengine.pxd @@ -51,11 +51,11 @@ cdef extern from "" namespace "SymEngine": cdef cppclass RCP[T]: T& operator*() nogil # Not yet supported in Cython: -# RCP[T]& operator=(RCP[T] &r_ptr) except+ nogil - void reset() except+ nogil +# RCP[T]& operator=(RCP[T] &r_ptr) nogil except + + void reset() nogil except + cdef cppclass Ptr[T]: - T& operator*() except+ nogil + T& operator*() nogil except + void print_stack_on_segfault() nogil @@ -65,7 +65,7 @@ cdef extern from "" namespace "SymEngine": ctypedef RCP[const_Basic] rcp_const_basic "SymEngine::RCP" #cdef cppclass rcp_const_basic "SymEngine::RCP": # Basic& operator*() nogil - # void reset() except+ nogil + # void reset() nogil except + # pass # Cython has broken support for the following: # ctypedef map[rcp_const_basic, rcp_const_basic] map_basic_basic @@ -112,8 +112,8 @@ cdef extern from "" namespace "SymEngine": ctypedef multiset[rcp_const_basic] multiset_basic "SymEngine::multiset_basic" cdef cppclass Basic: - string __str__() except+ nogil - unsigned int hash() except+ nogil + string __str__() nogil except + + unsigned int hash() nogil except + vec_basic get_args() nogil int __cmp__(const Basic &o) nogil @@ -124,11 +124,11 @@ cdef extern from "" namespace "SymEngine": ctypedef unordered_map[rcp_const_basic, rcp_const_number].iterator umap_basic_num_iterator "SymEngine::umap_basic_num::iterator" ctypedef vector[pair[rcp_const_basic, rcp_const_basic]] vec_pair "SymEngine::vec_pair" - bool eq(const Basic &a, const Basic &b) except+ nogil - bool neq(const Basic &a, const Basic &b) except+ nogil + bool eq(const Basic &a, const Basic &b) nogil except + + bool neq(const Basic &a, const Basic &b) nogil except + RCP[const Symbol] rcp_static_cast_Symbol "SymEngine::rcp_static_cast"(rcp_const_basic &b) nogil - RCP[const PySymbol] rcp_static_cast_PySymbol "SymEngine::rcp_static_cast"(rcp_const_basic &b) except+ nogil + RCP[const PySymbol] rcp_static_cast_PySymbol "SymEngine::rcp_static_cast"(rcp_const_basic &b) nogil except + RCP[const Integer] rcp_static_cast_Integer "SymEngine::rcp_static_cast"(rcp_const_basic &b) nogil RCP[const Rational] rcp_static_cast_Rational "SymEngine::rcp_static_cast"(rcp_const_basic &b) nogil RCP[const Complex] rcp_static_cast_Complex "SymEngine::rcp_static_cast"(rcp_const_basic &b) nogil @@ -162,18 +162,18 @@ cdef extern from "" namespace "SymEngine": bool is_a[T] (const Basic &b) nogil bool is_a_sub[T] (const Basic &b) nogil - rcp_const_basic expand(rcp_const_basic &o, bool deep) except+ nogil + rcp_const_basic expand(rcp_const_basic &o, bool deep) nogil except + void as_numer_denom(rcp_const_basic &x, const Ptr[RCP[Basic]] &numer, const Ptr[RCP[Basic]] &denom) nogil void as_real_imag(rcp_const_basic &x, const Ptr[RCP[Basic]] &real, const Ptr[RCP[Basic]] &imag) nogil - void cse(vec_pair &replacements, vec_basic &reduced_exprs, const vec_basic &exprs) except+ nogil + void cse(vec_pair &replacements, vec_basic &reduced_exprs, const vec_basic &exprs) nogil except + cdef extern from "" namespace "SymEngine": - rcp_const_basic msubs (rcp_const_basic &x, const map_basic_basic &x) except+ nogil - rcp_const_basic ssubs (rcp_const_basic &x, const map_basic_basic &x) except+ nogil - rcp_const_basic xreplace (rcp_const_basic &x, const map_basic_basic &x) except+ nogil + rcp_const_basic msubs (rcp_const_basic &x, const map_basic_basic &x) nogil except + + rcp_const_basic ssubs (rcp_const_basic &x, const map_basic_basic &x) nogil except + + rcp_const_basic xreplace (rcp_const_basic &x, const map_basic_basic &x) nogil except + cdef extern from "" namespace "SymEngine": - rcp_const_basic diff "SymEngine::sdiff"(rcp_const_basic &arg, rcp_const_basic &x) except+ nogil + rcp_const_basic diff "SymEngine::sdiff"(rcp_const_basic &arg, rcp_const_basic &x) nogil except + cdef extern from "" namespace "SymEngine": cdef cppclass Symbol(Basic): @@ -215,8 +215,8 @@ cdef extern from "pywrapper.h" namespace "SymEngine": PySymbol(string name, PyObject* pyobj, bool use_pickle) except + PyObject* get_py_object() except + - string wrapper_dumps(const Basic &x) except+ nogil - rcp_const_basic wrapper_loads(const string &s) except+ nogil + string wrapper_dumps(const Basic &x) nogil except + + rcp_const_basic wrapper_loads(const string &s) nogil except + cdef extern from "" namespace "SymEngine": cdef cppclass Integer(Number): @@ -286,9 +286,9 @@ cdef extern from "" namespace "SymEngine": pass cdef extern from "" namespace "SymEngine": - cdef rcp_const_basic add(rcp_const_basic &a, rcp_const_basic &b) except+ nogil - cdef rcp_const_basic sub(rcp_const_basic &a, rcp_const_basic &b) except+ nogil - cdef rcp_const_basic add(const vec_basic &a) except+ nogil + cdef rcp_const_basic add(rcp_const_basic &a, rcp_const_basic &b) nogil except + + cdef rcp_const_basic sub(rcp_const_basic &a, rcp_const_basic &b) nogil except + + cdef rcp_const_basic add(const vec_basic &a) nogil except + cdef cppclass Add(Basic): void as_two_terms(const Ptr[RCP[Basic]] &a, const Ptr[RCP[Basic]] &b) @@ -296,10 +296,10 @@ cdef extern from "" namespace "SymEngine": const umap_basic_num &get_dict() cdef extern from "" namespace "SymEngine": - cdef rcp_const_basic mul(rcp_const_basic &a, rcp_const_basic &b) except+ nogil - cdef rcp_const_basic div(rcp_const_basic &a, rcp_const_basic &b) except+ nogil - cdef rcp_const_basic neg(rcp_const_basic &a) except+ nogil - cdef rcp_const_basic mul(const vec_basic &a) except+ nogil + cdef rcp_const_basic mul(rcp_const_basic &a, rcp_const_basic &b) nogil except + + cdef rcp_const_basic div(rcp_const_basic &a, rcp_const_basic &b) nogil except + + cdef rcp_const_basic neg(rcp_const_basic &a) nogil except + + cdef rcp_const_basic mul(const vec_basic &a) nogil except + cdef cppclass Mul(Basic): void as_two_terms(const Ptr[RCP[Basic]] &a, const Ptr[RCP[Basic]] &b) @@ -308,9 +308,9 @@ cdef extern from "" namespace "SymEngine": cdef RCP[const Mul] mul_from_dict "SymEngine::Mul::from_dict"(RCP[const Number] coef, map_basic_basic &d) nogil cdef extern from "" namespace "SymEngine": - cdef rcp_const_basic pow(rcp_const_basic &a, rcp_const_basic &b) except+ nogil - cdef rcp_const_basic sqrt(rcp_const_basic &x) except+ nogil - cdef rcp_const_basic exp(rcp_const_basic &x) except+ nogil + cdef rcp_const_basic pow(rcp_const_basic &a, rcp_const_basic &b) nogil except + + cdef rcp_const_basic sqrt(rcp_const_basic &x) nogil except + + cdef rcp_const_basic exp(rcp_const_basic &x) nogil except + cdef cppclass Pow(Basic): rcp_const_basic get_base() nogil @@ -344,58 +344,58 @@ cdef extern from "" namespace "SymEngine": RCP[const PyFunctionClass] pyfunc_class, const PyObject* pyobject) nogil cdef extern from "" namespace "SymEngine": - cdef rcp_const_basic sin(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic cos(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic tan(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic cot(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic csc(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic sec(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic asin(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic acos(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic atan(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic acot(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic acsc(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic asec(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic sinh(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic cosh(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic tanh(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic coth(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic csch(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic sech(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic asinh(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic acosh(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic atanh(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic acoth(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic acsch(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic asech(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic function_symbol(string name, const vec_basic &arg) except+ nogil - cdef rcp_const_basic abs(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic max(const vec_basic &arg) except+ nogil - cdef rcp_const_basic min(const vec_basic &arg) except+ nogil - cdef rcp_const_basic gamma(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic atan2(rcp_const_basic &num, rcp_const_basic &den) except+ nogil - cdef rcp_const_basic lambertw(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic zeta(rcp_const_basic &s) except+ nogil - cdef rcp_const_basic zeta(rcp_const_basic &s, rcp_const_basic &a) except+ nogil - cdef rcp_const_basic dirichlet_eta(rcp_const_basic &s) except+ nogil - cdef rcp_const_basic kronecker_delta(rcp_const_basic &i, rcp_const_basic &j) except+ nogil - cdef rcp_const_basic levi_civita(const vec_basic &arg) except+ nogil - cdef rcp_const_basic erf(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic erfc(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic lowergamma(rcp_const_basic &s, rcp_const_basic &x) except+ nogil - cdef rcp_const_basic uppergamma(rcp_const_basic &s, rcp_const_basic &x) except+ nogil - cdef rcp_const_basic loggamma(rcp_const_basic &arg) except+ nogil - cdef rcp_const_basic beta(rcp_const_basic &x, rcp_const_basic &y) except+ nogil - cdef rcp_const_basic polygamma(rcp_const_basic &n, rcp_const_basic &x) except+ nogil - cdef rcp_const_basic digamma(rcp_const_basic &x) except+ nogil - cdef rcp_const_basic trigamma(rcp_const_basic &x) except+ nogil - cdef rcp_const_basic sign(rcp_const_basic &x) except+ nogil - cdef rcp_const_basic floor(rcp_const_basic &x) except+ nogil - cdef rcp_const_basic ceiling(rcp_const_basic &x) except+ nogil - cdef rcp_const_basic conjugate(rcp_const_basic &x) except+ nogil - cdef rcp_const_basic log(rcp_const_basic &x) except+ nogil - cdef rcp_const_basic log(rcp_const_basic &x, rcp_const_basic &y) except+ nogil - cdef rcp_const_basic unevaluated_expr(rcp_const_basic &x) except+ nogil + cdef rcp_const_basic sin(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic cos(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic tan(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic cot(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic csc(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic sec(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic asin(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic acos(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic atan(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic acot(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic acsc(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic asec(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic sinh(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic cosh(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic tanh(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic coth(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic csch(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic sech(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic asinh(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic acosh(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic atanh(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic acoth(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic acsch(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic asech(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic function_symbol(string name, const vec_basic &arg) nogil except + + cdef rcp_const_basic abs(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic max(const vec_basic &arg) nogil except + + cdef rcp_const_basic min(const vec_basic &arg) nogil except + + cdef rcp_const_basic gamma(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic atan2(rcp_const_basic &num, rcp_const_basic &den) nogil except + + cdef rcp_const_basic lambertw(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic zeta(rcp_const_basic &s) nogil except + + cdef rcp_const_basic zeta(rcp_const_basic &s, rcp_const_basic &a) nogil except + + cdef rcp_const_basic dirichlet_eta(rcp_const_basic &s) nogil except + + cdef rcp_const_basic kronecker_delta(rcp_const_basic &i, rcp_const_basic &j) nogil except + + cdef rcp_const_basic levi_civita(const vec_basic &arg) nogil except + + cdef rcp_const_basic erf(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic erfc(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic lowergamma(rcp_const_basic &s, rcp_const_basic &x) nogil except + + cdef rcp_const_basic uppergamma(rcp_const_basic &s, rcp_const_basic &x) nogil except + + cdef rcp_const_basic loggamma(rcp_const_basic &arg) nogil except + + cdef rcp_const_basic beta(rcp_const_basic &x, rcp_const_basic &y) nogil except + + cdef rcp_const_basic polygamma(rcp_const_basic &n, rcp_const_basic &x) nogil except + + cdef rcp_const_basic digamma(rcp_const_basic &x) nogil except + + cdef rcp_const_basic trigamma(rcp_const_basic &x) nogil except + + cdef rcp_const_basic sign(rcp_const_basic &x) nogil except + + cdef rcp_const_basic floor(rcp_const_basic &x) nogil except + + cdef rcp_const_basic ceiling(rcp_const_basic &x) nogil except + + cdef rcp_const_basic conjugate(rcp_const_basic &x) nogil except + + cdef rcp_const_basic log(rcp_const_basic &x) nogil except + + cdef rcp_const_basic log(rcp_const_basic &x, rcp_const_basic &y) nogil except + + cdef rcp_const_basic unevaluated_expr(rcp_const_basic &x) nogil except + cdef cppclass Function(Basic): pass @@ -632,7 +632,7 @@ cdef extern from "" namespace "SymEngine": const unsigned ncols() nogil rcp_const_basic get(unsigned i, unsigned j) nogil rcp_const_basic set(unsigned i, unsigned j, rcp_const_basic e) nogil - string __str__() except+ nogil + string __str__() nogil except + bool eq(const MatrixBase &) nogil rcp_const_basic det() nogil void inv(MatrixBase &) @@ -681,20 +681,20 @@ cdef extern from "" namespace "SymEngine": DenseMatrix* static_cast_DenseMatrix "static_cast"(const MatrixBase *a) void inverse_FFLU "SymEngine::inverse_fraction_free_LU"(const DenseMatrix &A, - DenseMatrix &B) except+ nogil - void pivoted_LU_solve (const DenseMatrix &A, const DenseMatrix &b, DenseMatrix &x) except+ nogil + DenseMatrix &B) nogil except + + void pivoted_LU_solve (const DenseMatrix &A, const DenseMatrix &b, DenseMatrix &x) nogil except + void inverse_GJ "SymEngine::inverse_gauss_jordan"(const DenseMatrix &A, - DenseMatrix &B) except+ nogil + DenseMatrix &B) nogil except + void FFLU_solve "SymEngine::fraction_free_LU_solve"(const DenseMatrix &A, - const DenseMatrix &b, DenseMatrix &x) except+ nogil + const DenseMatrix &b, DenseMatrix &x) nogil except + void FFGJ_solve "SymEngine::fraction_free_gauss_jordan_solve"(const DenseMatrix &A, - const DenseMatrix &b, DenseMatrix &x) except+ nogil + const DenseMatrix &b, DenseMatrix &x) nogil except + void LDL_solve "SymEngine::LDL_solve"(const DenseMatrix &A, const DenseMatrix &b, - DenseMatrix &x) except+ nogil + DenseMatrix &x) nogil except + void jacobian "SymEngine::sjacobian"(const DenseMatrix &A, - const DenseMatrix &x, DenseMatrix &result) except+ nogil + const DenseMatrix &x, DenseMatrix &result) nogil except + void diff "SymEngine::sdiff"(const DenseMatrix &A, - rcp_const_basic &x, DenseMatrix &result) except+ nogil + rcp_const_basic &x, DenseMatrix &result) nogil except + void eye (DenseMatrix &A, int k) nogil void diag(DenseMatrix &A, vec_basic &v, int k) nogil void ones(DenseMatrix &A) nogil @@ -707,7 +707,7 @@ cdef extern from "" namespace "SymEngine": void cross(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &C) nogil cdef extern from "": - void pivoted_LU (const DenseMatrix &A, DenseMatrix &L, DenseMatrix &U, vector[pair[int, int]] &P) except+ nogil + void pivoted_LU (const DenseMatrix &A, DenseMatrix &L, DenseMatrix &U, vector[pair[int, int]] &P) nogil except + cdef extern from "" namespace "SymEngine": int probab_prime_p(const Integer &a, int reps) @@ -716,10 +716,10 @@ cdef extern from "" namespace "SymEngine": RCP[const Integer] lcm(const Integer &a, const Integer &b) nogil void gcd_ext(const Ptr[RCP[Integer]] &g, const Ptr[RCP[Integer]] &s, const Ptr[RCP[Integer]] &t, const Integer &a, const Integer &b) nogil - RCP[const Integer] mod "SymEngine::mod_f"(const Integer &n, const Integer &d) except+ nogil - RCP[const Integer] quotient "SymEngine::quotient_f"(const Integer &n, const Integer &d) except+ nogil + RCP[const Integer] mod "SymEngine::mod_f"(const Integer &n, const Integer &d) nogil except + + RCP[const Integer] quotient "SymEngine::quotient_f"(const Integer &n, const Integer &d) nogil except + void quotient_mod "SymEngine::quotient_mod_f"(const Ptr[RCP[Integer]] &q, const Ptr[RCP[Integer]] &mod, - const Integer &n, const Integer &d) except+ nogil + const Integer &n, const Integer &d) nogil except + int mod_inverse(const Ptr[RCP[Integer]] &b, const Integer &a, const Integer &m) nogil bool crt(const Ptr[RCP[Integer]] &R, const vec_integer &rem, @@ -739,9 +739,9 @@ cdef extern from "" namespace "SymEngine": unsigned B, unsigned retries) nogil int factor_pollard_rho_method(const Ptr[RCP[Integer]] &f, const Integer &n, unsigned retries) nogil - void prime_factors(vec_integer &primes, const Integer &n) except+ nogil - void prime_factor_multiplicities(map_integer_uint &primes, const Integer &n) except+ nogil - RCP[const Number] bernoulli(unsigned long n) except+ nogil + void prime_factors(vec_integer &primes, const Integer &n) nogil except + + void prime_factor_multiplicities(map_integer_uint &primes, const Integer &n) nogil except + + RCP[const Number] bernoulli(unsigned long n) nogil except + bool primitive_root(const Ptr[RCP[Integer]] &g, const Integer &n) nogil void primitive_root_list(vec_integer &roots, const Integer &n) nogil RCP[const Integer] totient(RCP[const Integer] n) nogil @@ -769,15 +769,15 @@ cdef extern from "" namespace "SymEngine": unsigned next_prime() nogil cdef extern from "" namespace "SymEngine": - bool has_symbol(const Basic &b, const Basic &x) except+ nogil - rcp_const_basic coeff(const Basic &b, const Basic &x, const Basic &n) except+ nogil - set_basic free_symbols(const Basic &b) except+ nogil - set_basic free_symbols(const MatrixBase &b) except+ nogil + bool has_symbol(const Basic &b, const Basic &x) nogil except + + rcp_const_basic coeff(const Basic &b, const Basic &x, const Basic &n) nogil except + + set_basic free_symbols(const Basic &b) nogil except + + set_basic free_symbols(const MatrixBase &b) nogil except + unsigned count_ops(const vec_basic &a) nogil cdef extern from "" namespace "SymEngine": cdef cppclass Boolean(Basic): - RCP[const Boolean] logical_not() except+ nogil + RCP[const Boolean] logical_not() nogil except + cdef cppclass BooleanAtom(Boolean): bool get_val() nogil cdef cppclass Relational(Boolean): @@ -805,25 +805,25 @@ cdef extern from "" namespace "SymEngine": rcp_const_basic boolTrue rcp_const_basic boolFalse - cdef RCP[const Boolean] Eq(rcp_const_basic &lhs) except+ nogil - cdef RCP[const Boolean] Eq(rcp_const_basic &lhs, rcp_const_basic &rhs) except+ nogil - cdef RCP[const Boolean] Ne(rcp_const_basic &lhs, rcp_const_basic &rhs) except+ nogil - cdef RCP[const Boolean] Ge(rcp_const_basic &lhs, rcp_const_basic &rhs) except+ nogil - cdef RCP[const Boolean] Gt(rcp_const_basic &lhs, rcp_const_basic &rhs) except+ nogil - cdef RCP[const Boolean] Le(rcp_const_basic &lhs, rcp_const_basic &rhs) except+ nogil - cdef RCP[const Boolean] Lt(rcp_const_basic &lhs, rcp_const_basic &rhs) except+ nogil + cdef RCP[const Boolean] Eq(rcp_const_basic &lhs) nogil except + + cdef RCP[const Boolean] Eq(rcp_const_basic &lhs, rcp_const_basic &rhs) nogil except + + cdef RCP[const Boolean] Ne(rcp_const_basic &lhs, rcp_const_basic &rhs) nogil except + + cdef RCP[const Boolean] Ge(rcp_const_basic &lhs, rcp_const_basic &rhs) nogil except + + cdef RCP[const Boolean] Gt(rcp_const_basic &lhs, rcp_const_basic &rhs) nogil except + + cdef RCP[const Boolean] Le(rcp_const_basic &lhs, rcp_const_basic &rhs) nogil except + + cdef RCP[const Boolean] Lt(rcp_const_basic &lhs, rcp_const_basic &rhs) nogil except + ctypedef Boolean const_Boolean "const SymEngine::Boolean" ctypedef vector[pair[rcp_const_basic, RCP[const_Boolean]]] PiecewiseVec; ctypedef vector[RCP[Boolean]] vec_boolean "SymEngine::vec_boolean" ctypedef set[RCP[Boolean]] set_boolean "SymEngine::set_boolean" - cdef RCP[const Boolean] logical_and(set_boolean &s) except+ nogil - cdef RCP[const Boolean] logical_nand(set_boolean &s) except+ nogil - cdef RCP[const Boolean] logical_or(set_boolean &s) except+ nogil - cdef RCP[const Boolean] logical_not(RCP[const Boolean] &s) except+ nogil - cdef RCP[const Boolean] logical_nor(set_boolean &s) except+ nogil - cdef RCP[const Boolean] logical_xor(vec_boolean &s) except+ nogil - cdef RCP[const Boolean] logical_xnor(vec_boolean &s) except+ nogil - cdef rcp_const_basic piecewise(PiecewiseVec vec) except+ nogil + cdef RCP[const Boolean] logical_and(set_boolean &s) nogil except + + cdef RCP[const Boolean] logical_nand(set_boolean &s) nogil except + + cdef RCP[const Boolean] logical_or(set_boolean &s) nogil except + + cdef RCP[const Boolean] logical_not(RCP[const Boolean] &s) nogil except + + cdef RCP[const Boolean] logical_nor(set_boolean &s) nogil except + + cdef RCP[const Boolean] logical_xor(vec_boolean &s) nogil except + + cdef RCP[const Boolean] logical_xnor(vec_boolean &s) nogil except + + cdef rcp_const_basic piecewise(PiecewiseVec vec) nogil except + cdef RCP[const Boolean] contains(rcp_const_basic &expr, RCP[const Set] &set) nogil @@ -833,26 +833,26 @@ cdef extern from "" namespace "SymEngine": cdef EvalfDomain EvalfComplex "SymEngine::EvalfDomain::Complex" cdef EvalfDomain EvalfReal "SymEngine::EvalfDomain::Real" cdef EvalfDomain EvalfSymbolic "SymEngine::EvalfDomain::Symbolic" - rcp_const_basic evalf(const Basic &b, unsigned long bits, EvalfDomain domain) except+ nogil + rcp_const_basic evalf(const Basic &b, unsigned long bits, EvalfDomain domain) nogil except + cdef extern from "" namespace "SymEngine": - double eval_double(const Basic &b) except+ nogil - double complex eval_complex_double(const Basic &b) except+ nogil + double eval_double(const Basic &b) nogil except + + double complex eval_complex_double(const Basic &b) nogil except + cdef extern from "" namespace "SymEngine": cdef cppclass LambdaRealDoubleVisitor: LambdaRealDoubleVisitor() nogil - void init(const vec_basic &x, const vec_basic &b, bool cse) except+ nogil + void init(const vec_basic &x, const vec_basic &b, bool cse) nogil except + void call(double *r, const double *x) nogil cdef cppclass LambdaComplexDoubleVisitor: LambdaComplexDoubleVisitor() nogil - void init(const vec_basic &x, const vec_basic &b, bool cse) except+ nogil + void init(const vec_basic &x, const vec_basic &b, bool cse) nogil except + void call(double complex *r, const double complex *x) nogil cdef extern from "" namespace "SymEngine": cdef cppclass LLVMVisitor: LLVMVisitor() nogil - void init(const vec_basic &x, const vec_basic &b, bool cse, int opt_level) except+ nogil + void init(const vec_basic &x, const vec_basic &b, bool cse, int opt_level) nogil except + const string& dumps() nogil void loads(const string&) nogil @@ -868,27 +868,27 @@ cdef extern from "" namespace "SymEngine": cdef extern from "" namespace "SymEngine": cdef cppclass SeriesCoeffInterface: - rcp_const_basic as_basic() except+ nogil - umap_int_basic as_dict() except+ nogil - rcp_const_basic get_coeff(int) except+ nogil + rcp_const_basic as_basic() nogil except + + umap_int_basic as_dict() nogil except + + rcp_const_basic get_coeff(int) nogil except + ctypedef RCP[const SeriesCoeffInterface] rcp_const_seriescoeffinterface "SymEngine::RCP" - rcp_const_seriescoeffinterface series "SymEngine::series"(rcp_const_basic &ex, RCP[const Symbol] &var, unsigned int prec) except+ nogil + rcp_const_seriescoeffinterface series "SymEngine::series"(rcp_const_basic &ex, RCP[const Symbol] &var, unsigned int prec) nogil except + cdef extern from "" namespace "SymEngine": - void eval_mpfr(mpfr_t result, const Basic &b, mpfr_rnd_t rnd) except+ nogil + void eval_mpfr(mpfr_t result, const Basic &b, mpfr_rnd_t rnd) nogil except + cdef extern from "" namespace "SymEngine": - void eval_mpc(mpc_t result, const Basic &b, mpfr_rnd_t rnd) except+ nogil + void eval_mpc(mpc_t result, const Basic &b, mpfr_rnd_t rnd) nogil except + cdef extern from "" namespace "SymEngine": - rcp_const_basic parse(const string &n) except+ nogil + rcp_const_basic parse(const string &n) nogil except + cdef extern from "" namespace "SymEngine": cdef cppclass Set(Basic): - RCP[const Set] set_intersection(RCP[const Set] &o) except+ nogil - RCP[const Set] set_union(RCP[const Set] &o) except+ nogil - RCP[const Set] set_complement(RCP[const Set] &o) except+ nogil - RCP[const Boolean] contains(rcp_const_basic &a) except+ nogil + RCP[const Set] set_intersection(RCP[const Set] &o) nogil except + + RCP[const Set] set_union(RCP[const Set] &o) nogil except + + RCP[const Set] set_complement(RCP[const Set] &o) nogil except + + RCP[const Boolean] contains(rcp_const_basic &a) nogil except + cdef cppclass Interval(Set): pass cdef cppclass EmptySet(Set): @@ -912,24 +912,24 @@ cdef extern from "" namespace "SymEngine": cdef cppclass ImageSet(Set): pass ctypedef set[RCP[Set]] set_set "SymEngine::set_set" - cdef rcp_const_basic interval(RCP[const Number] &start, RCP[const Number] &end, bool l, bool r) except+ nogil - cdef RCP[const EmptySet] emptyset() except+ nogil - cdef RCP[const Reals] reals() except+ nogil - cdef RCP[const Rationals] rationals() except+ nogil - cdef RCP[const Integers] integers() except+ nogil - cdef RCP[const UniversalSet] universalset() except+ nogil - cdef RCP[const Set] finiteset(set_basic &container) except+ nogil - cdef RCP[const Set] set_union(set_set &a) except+ nogil - cdef RCP[const Set] set_intersection(set_set &a) except+ nogil - cdef RCP[const Set] set_complement_helper(RCP[const Set] &container, RCP[const Set] &universe) except+ nogil - cdef RCP[const Set] set_complement(RCP[const Set] &universe, RCP[const Set] &container) except+ nogil - cdef RCP[const Set] conditionset(rcp_const_basic &sym, RCP[const Boolean] &condition) except+ nogil - cdef RCP[const Set] imageset(rcp_const_basic &sym, rcp_const_basic &expr, RCP[const Set] &base) except+ nogil + cdef rcp_const_basic interval(RCP[const Number] &start, RCP[const Number] &end, bool l, bool r) nogil except + + cdef RCP[const EmptySet] emptyset() nogil except + + cdef RCP[const Reals] reals() nogil except + + cdef RCP[const Rationals] rationals() nogil except + + cdef RCP[const Integers] integers() nogil except + + cdef RCP[const UniversalSet] universalset() nogil except + + cdef RCP[const Set] finiteset(set_basic &container) nogil except + + cdef RCP[const Set] set_union(set_set &a) nogil except + + cdef RCP[const Set] set_intersection(set_set &a) nogil except + + cdef RCP[const Set] set_complement_helper(RCP[const Set] &container, RCP[const Set] &universe) nogil except + + cdef RCP[const Set] set_complement(RCP[const Set] &universe, RCP[const Set] &container) nogil except + + cdef RCP[const Set] conditionset(rcp_const_basic &sym, RCP[const Boolean] &condition) nogil except + + cdef RCP[const Set] imageset(rcp_const_basic &sym, rcp_const_basic &expr, RCP[const Set] &base) nogil except + cdef extern from "" namespace "SymEngine": - cdef RCP[const Set] solve(rcp_const_basic &f, RCP[const Symbol] &sym) except+ nogil - cdef RCP[const Set] solve(rcp_const_basic &f, RCP[const Symbol] &sym, RCP[const Set] &domain) except+ nogil - cdef vec_basic linsolve(const vec_basic &eqs, const vec_sym &syms) except+ nogil + cdef RCP[const Set] solve(rcp_const_basic &f, RCP[const Symbol] &sym) nogil except + + cdef RCP[const Set] solve(rcp_const_basic &f, RCP[const Symbol] &sym, RCP[const Set] &domain) nogil except + + cdef vec_basic linsolve(const vec_basic &eqs, const vec_sym &syms) nogil except + cdef extern from "symengine/tribool.h" namespace "SymEngine": cdef cppclass tribool: @@ -945,10 +945,10 @@ cdef extern from "symengine/tribool.h" namespace "SymEngine::tribool": cdef tribool tritrue cdef extern from "" namespace "SymEngine": - string ccode(const Basic &x) except+ nogil - string latex(const Basic &x) except+ nogil - string latex(const DenseMatrix &x, unsigned max_rows, unsigned max_cols) except+ nogil - string unicode(const Basic &x) except+ nogil + string ccode(const Basic &x) nogil except + + string latex(const Basic &x) nogil except + + string latex(const DenseMatrix &x, unsigned max_rows, unsigned max_cols) nogil except + + string unicode(const Basic &x) nogil except + ## Defined in 'symengine/cwrapper.cpp' cdef struct CRCPBasic: From cb92ff6a9190ada12daaff78ca31cb97bad2b618 Mon Sep 17 00:00:00 2001 From: firatbezir Date: Mon, 10 Feb 2025 22:01:51 +0300 Subject: [PATCH 14/40] Update README with verification instructions --- README.md | 108 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 847af7d6..d9141c7c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ + # SymEngine Python Wrappers -Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine), +Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine), a fast C++ symbolic manipulation library. -[![Build Status](https://travis-ci.org/symengine/symengine.py.svg)](https://travis-ci.org/symengine/symengine.py) [![Build status](https://ci.appveyor.com/api/projects/status/sl189l9ck3gd8qvk/branch/master?svg=true)](https://ci.appveyor.com/project/symengine/symengine-py/branch/master) +[![Build Status](https://travis-ci.org/symengine/symengine.py.svg)](https://travis-ci.org/symengine/symengine.py) +[![Build status](https://ci.appveyor.com/api/projects/status/sl189l9ck3gd8qvk/branch/master?svg=true)](https://ci.appveyor.com/project/symengine/symengine-py/branch/master) ## Installation @@ -11,71 +13,91 @@ a fast C++ symbolic manipulation library. See License section for information about wheels - pip install symengine --user +```bash +pip install symengine --user +``` ### Conda package manager - conda install python-symengine -c symengine -c conda-forge +```bash +conda install python-symengine -c symengine -c conda-forge +``` -optionally, you may choose to install an early [developer preview](https://github.com/symengine/python-symengine-feedstock): +Optionally, you may choose to install an early [developer preview](https://github.com/symengine/python-symengine-feedstock): - conda install python-symengine -c symengine/label/dev -c conda-forge +```bash +conda install python-symengine -c symengine/label/dev -c conda-forge +``` ### Build from source Install prerequisites. - CMake >= 2.8.12 - Python3 >= 3.8 - Cython >= 0.29.24 - SymEngine >= 0.7.0 +```bash +CMake >= 2.8.12 +Python3 >= 3.8 +Cython >= 0.29.24 +SymEngine >= 0.7.0 +``` -For SymEngine, only a specific commit/tag (see symengine_version.txt) is supported. -Latest git master branch may not work as there may be breaking changes in SymEngine. +For **SymEngine**, only a specific commit/tag (see `symengine_version.txt`) is supported. +The latest git master branch may not work as there may be breaking changes in **SymEngine**. Python wrappers can be installed by, - python setup.py install +```bash +python setup.py install +``` + +Additional options to `setup.py` are: + +```bash +python setup.py install build_ext + --symengine-dir=/path/to/symengine/install/dir # Path to SymEngine install directory or build directory + --compiler=mingw32|msvc|cygwin # Select the compiler for Windows + --generator=cmake-generator # CMake Generator + --build-type=Release|Debug # Set build-type for multi-configuration generators like MSVC + --define="var1=value1;var2=value2" # Give options to CMake + --inplace # Build the extension in source tree +``` + +Standard options to `setup.py` like `--user`, `--prefix` can be used to configure install location. +NumPy is used if found by default, if you wish to make your choice of NumPy use explicit: then add e.g. `WITH_NUMPY=False` to `--define`. + +### Notes on Dependencies -Additional options to setup.py are +If you intend to evaluate floating-point expressions (using **lambdify**), you should consider linking against **LLVM**. Many users might also benefit from linking against **FLINT**, as it is now LGPL-licensed. - python setup.py install build_ext - --symengine-dir=/path/to/symengine/install/dir # Path to SymEngine install directory or build directory - --compiler=mingw32|msvc|cygwin # Select the compiler for Windows - --generator=cmake-generator # CMake Generator - --build-type=Release|Debug # Set build-type for multi-configuration generators like MSVC - --define="var1=value1;var2=value2" # Give options to CMake - --inplace # Build the extension in source tree +In general, **sudo** is only required if you are installing to the default prefix (`/usr/local`). We recommend specifying a custom prefix (`--prefix=$HOME/.local`) to avoid requiring administrative privileges, which most users can do without using **sudo**. -Standard options to setup.py like `--user`, `--prefix` can be used to -configure install location. NumPy is used if found by default, if you wish -to make your choice of NumPy use explicit: then add -e.g. ``WITH_NUMPY=False`` to ``--define``. +If you're uncomfortable specifying the prefix manually, we suggest using **Conda** or installing the pre-built wheels via **pip** instead of building from source. -Use SymEngine from Python as follows: +## Verification - >>> from symengine import var - >>> var("x y z") - (x, y, z) - >>> e = (x+y+z)**2 - >>> e.expand() - 2*x*y + 2*x*z + 2*y*z + x**2 + y**2 + z**2 +You can verify the installation of **SymEngine** by using the provided code snippet in this README. This snippet ensures that the installation works as expected and that basic functionality is available. -You can read Python tests in `symengine/tests` to see what features are -implemented. +```python +from symengine import var +x, y, z = var('x y z') +e = (x + y + z)**2 +expanded_e = e.expand() +print(expanded_e) +``` +This will output: +```python +x**2 + y**2 + z**2 + 2*x*y + 2*x*z + 2*y*z +``` +Note: The verification code provided above checks the functionality of SymEngine. For additional verification specific to SymEngine, please refer to the [official SymEngine Python bindings repository](https://github.com/symengine/symengine.py) for further tests and examples. ## License -symengine.py is MIT licensed and uses several LGPL, BSD-3 and MIT licensed libraries +symengine.py is MIT licensed and uses several LGPL, BSD-3, and MIT licensed libraries. -Licenses for the dependencies of pip wheels are as follows, +Licenses for the dependencies of pip wheels are as follows: -pip wheels on Unix use GMP (LGPL-3.0-or-later), MPFR (LGPL-3.0-or-later), -MPC (LGPL-3.0-or-later), LLVM (Apache-2.0), zlib (Zlib), libxml2 (MIT), -zstd (BSD-3-Clause) and symengine (MIT AND BSD-3-Clause). -pip wheels on Windows use MPIR (LGPL-3.0-or-later) instead of GMP above and -pthreads-win32 (LGPL-3.0-or-later) additionally. -NumPy (BSD-3-Clause) and SymPy (BSD-3-Clause) are optional dependencies. -Sources for these binary dependencies can be found on https://github.com/symengine/symengine-wheels/releases +- pip wheels on Unix use **GMP** (LGPL-3.0-or-later), **MPFR** (LGPL-3.0-or-later), **MPC** (LGPL-3.0-or-later), **LLVM** (Apache-2.0), **zlib** (Zlib), **libxml2** (MIT), **zstd** (BSD-3-Clause), and **symengine** (MIT AND BSD-3-Clause). +- pip wheels on Windows use **MPIR** (LGPL-3.0-or-later) instead of **GMP** above and **pthreads-win32** (LGPL-3.0-or-later) additionally. +- **NumPy** (BSD-3-Clause) and **SymPy** (BSD-3-Clause) are optional dependencies. +- Sources for these binary dependencies can be found on [symengine-wheels](https://github.com/symengine/symengine-wheels/releases). From 984cb44b9b85c55b6e375b548b5665fd9183dece Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 16 Feb 2025 18:30:19 -0600 Subject: [PATCH 15/40] Remove symengine conda channel from isntructions --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index d9141c7c..6e6e624f 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,7 @@ pip install symengine --user ### Conda package manager ```bash -conda install python-symengine -c symengine -c conda-forge -``` - -Optionally, you may choose to install an early [developer preview](https://github.com/symengine/python-symengine-feedstock): - -```bash -conda install python-symengine -c symengine/label/dev -c conda-forge +conda install python-symengine -c conda-forge ``` ### Build from source From 63a7a0f6d3bde94b1fb21cd87874935478ee4875 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 16 Feb 2025 18:35:57 -0600 Subject: [PATCH 16/40] Update README.md --- README.md | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6e6e624f..2a89249e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # SymEngine Python Wrappers -Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine), +Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine), a fast C++ symbolic manipulation library. [![Build Status](https://travis-ci.org/symengine/symengine.py.svg)](https://travis-ci.org/symengine/symengine.py) @@ -34,8 +34,9 @@ Cython >= 0.29.24 SymEngine >= 0.7.0 ``` -For **SymEngine**, only a specific commit/tag (see `symengine_version.txt`) is supported. -The latest git master branch may not work as there may be breaking changes in **SymEngine**. +For **SymEngine**, only a specific commit/tag (see `symengine_version.txt`) is +supported. The latest git master branch may not work as there may be breaking +changes in **SymEngine**. Python wrappers can be installed by, @@ -55,20 +56,31 @@ python setup.py install build_ext --inplace # Build the extension in source tree ``` -Standard options to `setup.py` like `--user`, `--prefix` can be used to configure install location. -NumPy is used if found by default, if you wish to make your choice of NumPy use explicit: then add e.g. `WITH_NUMPY=False` to `--define`. +Standard options to `setup.py` like `--user`, `--prefix` can be used to +configure install location. NumPy is used if found by default, if you wish +to make your choice of NumPy use explicit: then add +e.g. `WITH_NUMPY=False` to `--define`. ### Notes on Dependencies -If you intend to evaluate floating-point expressions (using **lambdify**), you should consider linking against **LLVM**. Many users might also benefit from linking against **FLINT**, as it is now LGPL-licensed. +If you intend to evaluate floating-point expressions (using **lambdify**), +you should consider linking against **LLVM**. Many users might also benefit +from linking against **FLINT**, as it is now LGPL-licensed. -In general, **sudo** is only required if you are installing to the default prefix (`/usr/local`). We recommend specifying a custom prefix (`--prefix=$HOME/.local`) to avoid requiring administrative privileges, which most users can do without using **sudo**. +In general, **sudo** is only required if you are installing to the default +prefix (`/usr/local`). We recommend specifying a custom prefix +(`--prefix=$HOME/.local`) to avoid requiring administrative privileges, +which most users can do without using **sudo**. -If you're uncomfortable specifying the prefix manually, we suggest using **Conda** or installing the pre-built wheels via **pip** instead of building from source. +If you're uncomfortable specifying the prefix manually, we suggest using +**Conda** or installing the pre-built wheels via **pip** instead of building +from source. ## Verification -You can verify the installation of **SymEngine** by using the provided code snippet in this README. This snippet ensures that the installation works as expected and that basic functionality is available. +You can verify the installation of **SymEngine** by using the provided code +snippet in this README. This snippet ensures that the installation works as +expected and that basic functionality is available. ```python from symengine import var @@ -82,16 +94,26 @@ This will output: x**2 + y**2 + z**2 + 2*x*y + 2*x*z + 2*y*z ``` -Note: The verification code provided above checks the functionality of SymEngine. For additional verification specific to SymEngine, please refer to the [official SymEngine Python bindings repository](https://github.com/symengine/symengine.py) for further tests and examples. +Note: The verification code provided above checks the functionality of +SymEngine. For additional verification specific to SymEngine, please refer to +the [official SymEngine Python bindings repository](https://github.com/symengine/symengine.py) +for further tests and examples. ## License -symengine.py is MIT licensed and uses several LGPL, BSD-3, and MIT licensed libraries. +symengine.py is MIT licensed and uses several LGPL, BSD-3, and MIT licensed +libraries. Licenses for the dependencies of pip wheels are as follows: -- pip wheels on Unix use **GMP** (LGPL-3.0-or-later), **MPFR** (LGPL-3.0-or-later), **MPC** (LGPL-3.0-or-later), **LLVM** (Apache-2.0), **zlib** (Zlib), **libxml2** (MIT), **zstd** (BSD-3-Clause), and **symengine** (MIT AND BSD-3-Clause). -- pip wheels on Windows use **MPIR** (LGPL-3.0-or-later) instead of **GMP** above and **pthreads-win32** (LGPL-3.0-or-later) additionally. -- **NumPy** (BSD-3-Clause) and **SymPy** (BSD-3-Clause) are optional dependencies. -- Sources for these binary dependencies can be found on [symengine-wheels](https://github.com/symengine/symengine-wheels/releases). +- pip wheels on Unix use **GMP** (LGPL-3.0-or-later), + **MPFR** (LGPL-3.0-or-later), **MPC** (LGPL-3.0-or-later), + **LLVM** (Apache-2.0), **zlib** (Zlib), **libxml2** (MIT), + **zstd** (BSD-3-Clause), and **symengine** (MIT AND BSD-3-Clause). +- pip wheels on Windows use **MPIR** (LGPL-3.0-or-later) instead of **GMP** + above and **pthreads-win32** (LGPL-3.0-or-later) additionally. +- **NumPy** (BSD-3-Clause) and **SymPy** (BSD-3-Clause) are optional + dependencies. +- Sources for these binary dependencies can be found on + [symengine-wheels](https://github.com/symengine/symengine-wheels/releases). From a3a9ce81796a2b4defdc2b7f074d440c58158e39 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 16 Feb 2025 18:38:47 -0600 Subject: [PATCH 17/40] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 2a89249e..e13eb727 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # SymEngine Python Wrappers Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine), From 7c48a0d75dcdd543486587584ecaa0643fa9d6d4 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 16 Feb 2025 19:56:16 -0600 Subject: [PATCH 18/40] Update version --- CMakeLists.txt | 2 +- symengine_version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 418b6704..3c83e7cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_PREFIX_PATH ${SymEngine_DIR} ${CMAKE_PREFIX_PATH}) include(GNUInstallDirs) -find_package(SymEngine 0.8.1 REQUIRED CONFIG +find_package(SymEngine 0.14.0 REQUIRED CONFIG PATH_SUFFIXES lib/cmake/symengine cmake/symengine CMake/) message("SymEngine_DIR : " ${SymEngine_DIR}) message("SymEngine Version : " ${SymEngine_VERSION}) diff --git a/symengine_version.txt b/symengine_version.txt index 6345c216..6718d65f 100644 --- a/symengine_version.txt +++ b/symengine_version.txt @@ -1 +1 @@ -v0.13.0 +fac9314c78f2809570494017efc6603befeb4eda From 0a3e0af889785cb7ec489da2a96dd98b9a2aa138 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 16 Feb 2025 20:06:48 -0600 Subject: [PATCH 19/40] Use RCPBasicAware{Output,Input}Archive --- symengine/lib/pywrapper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/symengine/lib/pywrapper.cpp b/symengine/lib/pywrapper.cpp index 4f45a0b7..5ab5e586 100644 --- a/symengine/lib/pywrapper.cpp +++ b/symengine/lib/pywrapper.cpp @@ -292,7 +292,7 @@ PyObject* pickle_loads(const std::string &pickle_str) { return obj; } -RCP load_basic(cereal::PortableBinaryInputArchive &ar, RCP &) +RCP load_basic(RCPBasicAwareInputArchive &ar, RCP &) { bool is_pysymbol; bool store_pickle; @@ -324,7 +324,7 @@ std::string pickle_dumps(const PyObject * obj) { return std::string(buffer, size); } -void save_basic(cereal::PortableBinaryOutputArchive &ar, const Symbol &b) +void save_basic(RCPBasicAwareOutputArchive &ar, const Symbol &b) { bool is_pysymbol = is_a_sub(b); ar(is_pysymbol); @@ -344,7 +344,7 @@ std::string wrapper_dumps(const Basic &x) std::ostringstream oss; unsigned short major = SYMENGINE_MAJOR_VERSION; unsigned short minor = SYMENGINE_MINOR_VERSION; - cereal::PortableBinaryOutputArchive{oss}(major, minor, + RCPBasicAwareOutputArchive{oss}(major, minor, x.rcp_from_this()); return oss.str(); } @@ -354,7 +354,7 @@ RCP wrapper_loads(const std::string &serialized) unsigned short major, minor; RCP obj; std::istringstream iss(serialized); - cereal::PortableBinaryInputArchive iarchive{iss}; + RCPBasicAwareInputArchive iarchive{iss}; iarchive(major, minor); if (major != SYMENGINE_MAJOR_VERSION or minor != SYMENGINE_MINOR_VERSION) { throw SerializationError(StreamFmt() From 320c984c1a196c03dd8c9442935db9f610022737 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 16 Feb 2025 20:18:34 -0600 Subject: [PATCH 20/40] update version to 0.14.0 --- setup.py | 2 +- symengine/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f105b328..035471db 100644 --- a/setup.py +++ b/setup.py @@ -222,7 +222,7 @@ def finalize_options(self): ''' setup(name="symengine", - version="0.13.0", + version="0.14.0", description="Python library providing wrappers to SymEngine", setup_requires=['cython>=0.29.24'], long_description=long_description, diff --git a/symengine/__init__.py b/symengine/__init__.py index 97e9afd0..4ca4dd7c 100644 --- a/symengine/__init__.py +++ b/symengine/__init__.py @@ -63,7 +63,7 @@ def __getattr__(name): raise AttributeError(f"module 'symengine' has no attribute '{name}'") -__version__ = "0.13.0" +__version__ = "0.14.0" # To not expose internals From 248e6dc1747c8e69633fde3072527a61abe9049d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 17 Feb 2025 08:04:59 -0600 Subject: [PATCH 21/40] update symengine c++ to 0.14.0 --- symengine_version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symengine_version.txt b/symengine_version.txt index 6718d65f..4a29f93b 100644 --- a/symengine_version.txt +++ b/symengine_version.txt @@ -1 +1 @@ -fac9314c78f2809570494017efc6603befeb4eda +v0.14.0 From df4081db4a0167862e959cf3190e4dd54a269165 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 17 Feb 2025 12:15:17 -0600 Subject: [PATCH 22/40] Add Aaron and Firat to README. Welcome to SymEngine!! --- .mailmap | 1 + AUTHORS | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.mailmap b/.mailmap index 71840613..5a35cee3 100644 --- a/.mailmap +++ b/.mailmap @@ -21,3 +21,4 @@ Abhinav Agarwal Nilay Pochhi Björn Dahlgren Richard Otis richardotis +Firat Bezir diff --git a/AUTHORS b/AUTHORS index 427f83ad..19d0bd08 100644 --- a/AUTHORS +++ b/AUTHORS @@ -36,3 +36,5 @@ Pieter Eendebak Ayush Kumar Christian Clauss Moraxyc +Aaron Miller <78561124+aaron-skydio@users.noreply.github.com> +Firat Bezir From e108841338568d5bc8f2034aa70722d9b221c982 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 17 Feb 2025 15:33:22 -0600 Subject: [PATCH 23/40] Drop python 3.8 --- .github/workflows/ci.yml | 18 +++++++++--------- appveyor.yml | 2 +- setup.py | 8 ++++---- symengine/lib/symengine_wrapper.in.pyx | 6 ------ 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2763750c..ec7dc82a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,13 +37,13 @@ jobs: CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' BUILD_SHARED_LIBS: yes OS: ubuntu-20.04 CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_MPFR: yes INTEGER_CLASS: gmpxx WITH_NUMPY: no @@ -51,14 +51,14 @@ jobs: CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_MPC: yes OS: ubuntu-20.04 CC: gcc - BUILD_TYPE: Release WITH_MPFR: yes - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' OS: ubuntu-20.04 CC: gcc @@ -84,14 +84,14 @@ jobs: # CC: gcc - BUILD_TYPE: Debug - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_BFD: yes BUILD_SHARED_LIBS: yes OS: ubuntu-20.04 CC: clang - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_NUMPY: yes OS: ubuntu-20.04 CC: clang @@ -108,7 +108,7 @@ jobs: EXTRA_APT_PACKAGES: 'llvm-14' - BUILD_TYPE: Debug - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_SCIPY: yes WITH_LLVM: 5.0 OS: macos-13 @@ -121,13 +121,13 @@ jobs: CC: clang - BUILD_TYPE: Debug - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_NUMPY: no OS: macos-13 CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' OS: macos-13 CC: gcc diff --git a/appveyor.yml b/appveyor.yml index f21df0ae..1f02ccd7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,7 +24,7 @@ environment: - BUILD_TYPE: "Release" COMPILER: MSVC15 PLATFORM: "x64" - PYTHON_VERSION: 38-x64 + PYTHON_VERSION: 312-x64 CONDA_INSTALL_LOCN: C:\\Miniconda38-x64 - BUILD_TYPE: "Release" COMPILER: MSVC15 diff --git a/setup.py b/setup.py index 035471db..f76c5a0d 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,8 @@ import platform # Make sure the system has the right Python version. -if sys.version_info[:2] < (3, 8): - print("SymEngine requires Python 3.8 or newer. " +if sys.version_info[:2] < (3, 9): + print("SymEngine requires Python 3.9 or newer. " "Python %d.%d detected" % sys.version_info[:2]) sys.exit(-1) @@ -230,7 +230,7 @@ def finalize_options(self): author_email="symengine@googlegroups.com", license="MIT", url="https://github.com/symengine/symengine.py", - python_requires='>=3.8,<4', + python_requires='>=3.9,<4', zip_safe=False, packages=['symengine', 'symengine.lib', 'symengine.tests'], cmdclass = cmdclass, @@ -241,10 +241,10 @@ def finalize_options(self): 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Scientific/Engineering :: Physics', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ] ) diff --git a/symengine/lib/symengine_wrapper.in.pyx b/symengine/lib/symengine_wrapper.in.pyx index 26c31ad8..6fe0ffa5 100644 --- a/symengine/lib/symengine_wrapper.in.pyx +++ b/symengine/lib/symengine_wrapper.in.pyx @@ -1213,9 +1213,6 @@ cdef class Basic(object): def __int__(self): return int(float(self)) - def __long__(self): - return int(float(self)) - def __complex__(self): f = self.n(real=False) if not isinstance(f, (ComplexDouble, RealDouble)): @@ -1523,9 +1520,6 @@ cdef class BooleanTrue(BooleanAtom): def _sage_(self): return True - def __nonzero__(self): - return True - def __bool__(self): return True From 08f04ec1341b49e4562fc87fb9cc2140e7702dcb Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 18 Feb 2025 07:20:04 -0600 Subject: [PATCH 24/40] install setuptools --- bin/install_travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install_travis.sh b/bin/install_travis.sh index 572bb0d2..0460c58a 100644 --- a/bin/install_travis.sh +++ b/bin/install_travis.sh @@ -2,7 +2,7 @@ # symengine's bin/install_travis.sh will install miniconda -export conda_pkgs="python=${PYTHON_VERSION} pip pytest gmp mpfr" +export conda_pkgs="python=${PYTHON_VERSION} pip pytest setuptools gmp mpfr" if [[ "${WITH_NUMPY}" != "no" ]]; then export conda_pkgs="${conda_pkgs} numpy"; From 0fcebccafdbb35cc82ab1fcdbddd964dfdc65c6a Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 18 Feb 2025 08:09:39 -0600 Subject: [PATCH 25/40] install setuptools on win --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1f02ccd7..ce1c487c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -97,7 +97,7 @@ install: - set "PATH=C:\Python%PYTHON_VERSION%;C:\Python%PYTHON_VERSION%\Scripts;%PATH%" - echo %PATH% -- pip install nose pytest cython +- pip install nose pytest cython setuptools - if NOT [%WITH_NUMPY%]==[no] pip install numpy - if NOT [%WITH_SYMPY%]==[no] pip install sympy From ec3a60522c84ed2b2942dab67ca77a03d6cbbb73 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 18 Feb 2025 11:24:18 -0600 Subject: [PATCH 26/40] add setuptools to setup_requires --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f76c5a0d..c082f3ea 100644 --- a/setup.py +++ b/setup.py @@ -224,7 +224,7 @@ def finalize_options(self): setup(name="symengine", version="0.14.0", description="Python library providing wrappers to SymEngine", - setup_requires=['cython>=0.29.24'], + setup_requires=['cython>=0.29.24', 'setuptools'], long_description=long_description, author="SymEngine development team", author_email="symengine@googlegroups.com", From 5f924464cbf300748c3b9e4aebf32d78d54d1b5b Mon Sep 17 00:00:00 2001 From: Adrian Ostrowski <81568391+aostrowski-hbn@users.noreply.github.com> Date: Mon, 31 Mar 2025 13:25:46 -0700 Subject: [PATCH 27/40] Fix Fedora/RedHat installation location Those OSes have separate platlib and purelib directories. Symengine was installed partially into both from version 0.10.0 onwards. This change marks some of it's packages as ext_modules, which makes setuptools treat the wheel as platform specific and install if fully into platlib (lib64) instead of purelib (lib). This should solve #474. --- cmake/FindPython.cmake | 2 +- setup.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake index df8bfdc1..c1f6c439 100644 --- a/cmake/FindPython.cmake +++ b/cmake/FindPython.cmake @@ -60,7 +60,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") endif() execute_process( - COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['purelib'])" + COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['platlib'])" OUTPUT_VARIABLE PYTHON_INSTALL_PATH_tmp ) string(STRIP ${PYTHON_INSTALL_PATH_tmp} PYTHON_INSTALL_PATH_tmp) diff --git a/setup.py b/setup.py index c082f3ea..fcd97ec9 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ if use_setuptools: try: - from setuptools import setup + from setuptools import Extension, setup from setuptools.command.install import install as _install from setuptools.command.build_ext import build_ext as _build_ext except ImportError: @@ -36,7 +36,7 @@ from distutils.command.build import build as _build if not use_setuptools: - from distutils.core import setup + from distutils.core import Extension, setup from distutils.command.install import install as _install from distutils.command.build_ext import build_ext as _build_ext from distutils.command.build import build as _build @@ -232,7 +232,8 @@ def finalize_options(self): url="https://github.com/symengine/symengine.py", python_requires='>=3.9,<4', zip_safe=False, - packages=['symengine', 'symengine.lib', 'symengine.tests'], + ext_modules=[Extension(name='symengine.lib', sources=[])], + packages=['symengine', 'symengine.tests'], cmdclass = cmdclass, classifiers=[ 'License :: OSI Approved :: MIT License', From 6da52ebc8687f6477d54963524c8c841ce37f582 Mon Sep 17 00:00:00 2001 From: Adrian Ostrowski Date: Tue, 1 Apr 2025 16:34:43 +0200 Subject: [PATCH 28/40] Fix CMake 4.0.0 build break --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fcd97ec9..5adb759f 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,8 @@ from distutils.command.build import build as _build cmake_opts = [("PYTHON_BIN", sys.executable), - ("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "yes")] + ("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "yes"), + ("CMAKE_POLICY_VERSION_MINIMUM", "3.5")] cmake_generator = [None] cmake_build_type = ["Release"] From 03918d1183d65a2cde1fb8809f2467ebed633257 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 1 Apr 2025 10:34:11 -0500 Subject: [PATCH 29/40] install py files from cmake --- setup.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 5adb759f..28d05bce 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ if use_setuptools: try: - from setuptools import Extension, setup + from setuptools import setup from setuptools.command.install import install as _install from setuptools.command.build_ext import build_ext as _build_ext except ImportError: @@ -36,14 +36,13 @@ from distutils.command.build import build as _build if not use_setuptools: - from distutils.core import Extension, setup + from distutils.core import setup from distutils.command.install import install as _install from distutils.command.build_ext import build_ext as _build_ext from distutils.command.build import build as _build cmake_opts = [("PYTHON_BIN", sys.executable), - ("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "yes"), - ("CMAKE_POLICY_VERSION_MINIMUM", "3.5")] + ("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "yes")] cmake_generator = [None] cmake_build_type = ["Release"] @@ -118,7 +117,7 @@ def cmake_build(self): cmake_cmd = ["cmake", source_dir, "-DCMAKE_BUILD_TYPE=" + cmake_build_type[0], - "-DSYMENGINE_INSTALL_PY_FILES=OFF", + "-DSYMENGINE_INSTALL_PY_FILES=ON", ] cmake_cmd.extend(process_opts(cmake_opts)) if not path.exists(path.join(build_dir, "CMakeCache.txt")): @@ -233,8 +232,7 @@ def finalize_options(self): url="https://github.com/symengine/symengine.py", python_requires='>=3.9,<4', zip_safe=False, - ext_modules=[Extension(name='symengine.lib', sources=[])], - packages=['symengine', 'symengine.tests'], + packages=[], cmdclass = cmdclass, classifiers=[ 'License :: OSI Approved :: MIT License', From fe654772f35b6bd2d285d26e6136ab3dd081a903 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 1 Apr 2025 10:39:47 -0500 Subject: [PATCH 30/40] fix cmake_minimum_required --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c83e7cf..e83c95b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 2.8.12...4.0.0) if (POLICY CMP0057) cmake_policy(SET CMP0057 NEW) # needed for llvm >= 16 From b93259288c8e36ff22d43c17d35e3a42e442ce0e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 1 Apr 2025 22:12:45 -0500 Subject: [PATCH 31/40] fix installing --- symengine/CMakeLists.txt | 19 +++++++++++++------ symengine/tests/CMakeLists.txt | 19 ++++++++++++------- symengine_version.txt | 2 +- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/symengine/CMakeLists.txt b/symengine/CMakeLists.txt index 907e6f64..bedec397 100644 --- a/symengine/CMakeLists.txt +++ b/symengine/CMakeLists.txt @@ -1,10 +1,17 @@ add_subdirectory(lib) if (SYMENGINE_INSTALL_PY_FILES) - add_subdirectory(tests) - - set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine) - install(FILES __init__.py utilities.py sympy_compat.py functions.py printing.py - DESTINATION ${PY_PATH} - ) + add_subdirectory(tests) + set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine) + install( + FILES + __init__.py + functions.py + printing.py + sympy_compat.py + test_utilities.py + utilities.py + DESTINATION + ${PY_PATH} +) endif () diff --git a/symengine/tests/CMakeLists.txt b/symengine/tests/CMakeLists.txt index ebd4dfaa..4f19093b 100644 --- a/symengine/tests/CMakeLists.txt +++ b/symengine/tests/CMakeLists.txt @@ -1,13 +1,19 @@ set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine/tests) -install(FILES __init__.py +install( + FILES + __init__.py test_arit.py + test_cse.py test_dict_basic.py test_eval.py test_expr.py test_functions.py - test_number.py + test_lambdify.py + test_logic.py test_matrices.py test_ntheory.py + test_number.py + test_pickling.py test_printing.py test_sage.py test_series_expansion.py @@ -16,10 +22,9 @@ install(FILES __init__.py test_subs.py test_symbol.py test_sympify.py + test_sympy_compat.py test_sympy_conv.py test_var.py - test_lambdify.py - test_sympy_compat.py - test_logic.py - DESTINATION ${PY_PATH} - ) + DESTINATION + ${PY_PATH} +) diff --git a/symengine_version.txt b/symengine_version.txt index 4a29f93b..549ada38 100644 --- a/symengine_version.txt +++ b/symengine_version.txt @@ -1 +1 @@ -v0.14.0 +153b7e98f310bccaae586dab6b49284ccd5f4174 From a924eeffc62a094a58f976b5213bf3d1d83fb099 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 3 Apr 2025 11:35:59 -0500 Subject: [PATCH 32/40] bump to 0.14.1 --- setup.py | 2 +- symengine/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 28d05bce..23d948ef 100644 --- a/setup.py +++ b/setup.py @@ -222,7 +222,7 @@ def finalize_options(self): ''' setup(name="symengine", - version="0.14.0", + version="0.14.1", description="Python library providing wrappers to SymEngine", setup_requires=['cython>=0.29.24', 'setuptools'], long_description=long_description, diff --git a/symengine/__init__.py b/symengine/__init__.py index 4ca4dd7c..e9545baf 100644 --- a/symengine/__init__.py +++ b/symengine/__init__.py @@ -63,7 +63,7 @@ def __getattr__(name): raise AttributeError(f"module 'symengine' has no attribute '{name}'") -__version__ = "0.14.0" +__version__ = "0.14.1" # To not expose internals From 6b35fd056a976d002d71c45ae233ab095563f056 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 3 Apr 2025 11:37:15 -0500 Subject: [PATCH 33/40] Add Adrian to AUTHORS. Welcome to SymEngine!! --- .mailmap | 1 + AUTHORS | 1 + 2 files changed, 2 insertions(+) diff --git a/.mailmap b/.mailmap index 5a35cee3..11654a9b 100644 --- a/.mailmap +++ b/.mailmap @@ -22,3 +22,4 @@ Nilay Pochhi Björn Dahlgren Richard Otis richardotis Firat Bezir +Adrian Ostrowski <81568391+aostrowski-hbn@users.noreply.github.com> diff --git a/AUTHORS b/AUTHORS index 19d0bd08..484d38be 100644 --- a/AUTHORS +++ b/AUTHORS @@ -38,3 +38,4 @@ Christian Clauss Moraxyc Aaron Miller <78561124+aaron-skydio@users.noreply.github.com> Firat Bezir +Adrian Ostrowski From 4a8b629da7b5d14901f129de6eee4379d17cf654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Fri, 11 Jul 2025 17:52:59 +0200 Subject: [PATCH 34/40] bump ubuntu-20.04 -> 22.04 --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13e3399b..d8a8f085 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,34 +12,34 @@ jobs: WITH_BFD: yes PYTHON_VERSION: '3.12' TEST_SYMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Debug WITH_BFD: yes PYTHON_VERSION: '3.11' TEST_SYMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Debug WITH_BFD: yes PYTHON_VERSION: '3.10' TEST_SYMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Debug WITH_BFD: yes PYTHON_VERSION: '3.9' TEST_SYMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release PYTHON_VERSION: '3.13' BUILD_SHARED_LIBS: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release @@ -47,25 +47,25 @@ jobs: WITH_MPFR: yes INTEGER_CLASS: gmpxx WITH_NUMPY: no - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release PYTHON_VERSION: '3.13' WITH_MPC: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release WITH_MPFR: yes PYTHON_VERSION: '3.13' - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release PYTHON_VERSION: '3.9' WITH_MPC: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release @@ -73,27 +73,27 @@ jobs: WITH_MPC: yes INTEGER_CLASS: flint WITH_FLINT: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc #- BUILD_TYPE: Debug # PYTHON_VERSION: '3.9' # WITH_BFD: yes # WITH_PIRANHA: yes - # OS: ubuntu-20.04 + # OS: ubuntu-22.04 # CC: gcc - BUILD_TYPE: Debug PYTHON_VERSION: '3.13' WITH_BFD: yes BUILD_SHARED_LIBS: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: clang - BUILD_TYPE: Release PYTHON_VERSION: '3.13' WITH_NUMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: clang - BUILD_TYPE: Debug @@ -134,7 +134,7 @@ jobs: - BUILD_TYPE: Release PYTHON_VERSION: '3.11' - OS: ubuntu-20.04 + OS: ubuntu-22.04 WITH_MPC: yes WITH_MPFR: yes WITH_FLINT: yes From a42760575fa06aa608222372456fe68dbda28126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Fri, 11 Jul 2025 20:36:23 +0200 Subject: [PATCH 35/40] revert temporary changes in ci script --- bin/test_symengine_unix.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/test_symengine_unix.sh b/bin/test_symengine_unix.sh index 63e3f6ca..976f305d 100644 --- a/bin/test_symengine_unix.sh +++ b/bin/test_symengine_unix.sh @@ -2,10 +2,10 @@ export PYTHON_SOURCE_DIR=`pwd` export TEST_CPP="no" export MAKEFLAGS="-j2" -git clone -b update-CI https://github.com/bjodah/symengine symengine-cpp +git clone https://github.com/symengine/symengine symengine-cpp cd symengine-cpp export SOURCE_DIR=`pwd` -#git checkout `cat ../symengine_version.txt` +git checkout `cat ../symengine_version.txt` cd .. # Setup travis for C++ library From 0cf427709abe1ce45a1998ff804e2cb1c5312445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ingvar=20Dahlgren?= Date: Sat, 12 Jul 2025 11:19:56 +0200 Subject: [PATCH 36/40] attempt updating CI scripts to match upstream --- .github/workflows/ci.yml | 10 ++++++++++ bin/test_symengine_unix.sh | 2 +- symengine_version.txt | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8a8f085..d0954617 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,6 +146,16 @@ jobs: CC: gcc steps: + + - uses: conda-incubator/setup-miniconda@v3 + if: matrix.MSYS_ENV == '' + with: + activate-environment: symengine + channel-priority: strict + architecture: x86_64 + channels: conda-forge + conda-remove-defaults: "true" + - name: Checkout code uses: actions/checkout@v4 diff --git a/bin/test_symengine_unix.sh b/bin/test_symengine_unix.sh index 976f305d..0c62b7d1 100644 --- a/bin/test_symengine_unix.sh +++ b/bin/test_symengine_unix.sh @@ -10,7 +10,7 @@ cd .. # Setup travis for C++ library cd $SOURCE_DIR -source bin/test_symengine_unix.sh +source bin/test_symengine.sh # Setup travis for Python wrappers cd $PYTHON_SOURCE_DIR diff --git a/symengine_version.txt b/symengine_version.txt index 549ada38..52a9266b 100644 --- a/symengine_version.txt +++ b/symengine_version.txt @@ -1 +1 @@ -153b7e98f310bccaae586dab6b49284ccd5f4174 +17871adbd8366d18fc8f372f23f07e508571de46 From 6b920b63966d784e3c0eba9932adb35379d0e665 Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Mon, 14 Jul 2025 13:50:22 +0200 Subject: [PATCH 37/40] add -el {0} to bash command (required by setup-miniconda) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0954617..77578d0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,7 +160,7 @@ jobs: uses: actions/checkout@v4 - name: Build and test symengine - shell: bash + shell: bash -el {0} run: | source bin/test_symengine_unix.sh env: From 40a91073c35f85cff54a5632a12b3c6675349dba Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Mon, 14 Jul 2025 13:59:31 +0200 Subject: [PATCH 38/40] remove activate - conda env should already be active --- bin/install_travis.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/install_travis.sh b/bin/install_travis.sh index 0460c58a..f63a4747 100644 --- a/bin/install_travis.sh +++ b/bin/install_travis.sh @@ -33,5 +33,4 @@ if [[ "${WITH_SYMPY}" != "no" ]]; then pip install sympy; fi -conda clean --all -source activate $our_install_dir; +conda clean --all \ No newline at end of file From 94e136126075daa4263d676d68bd0d400f99c09c Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Mon, 14 Jul 2025 14:05:58 +0200 Subject: [PATCH 39/40] use WITH_LATEST_GCC on ubuntu-24.04 job to avoid symengine CI script trying to use gcc-9 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77578d0d..c176f13e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,6 +101,7 @@ jobs: WITH_SYMPY: yes WITH_LLVM: 18 WITH_SCIPY: yes + WITH_LATEST_GCC: yes INTEGER_CLASS: 'boostmp' PYTEST_ADDOPTS: '-k "not integer_nthroot"' OS: ubuntu-24.04 From 50682e97e748c135d0143ce02a830b080fff2730 Mon Sep 17 00:00:00 2001 From: Bjorn Date: Mon, 14 Jul 2025 14:41:00 +0200 Subject: [PATCH 40/40] Update symengine_version.txt --- symengine_version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symengine_version.txt b/symengine_version.txt index 52a9266b..e49372be 100644 --- a/symengine_version.txt +++ b/symengine_version.txt @@ -1 +1 @@ -17871adbd8366d18fc8f372f23f07e508571de46 +c9510fb4b5c30b84adb993573a51f2a9a38a4cfe