Skip to content

Commit

Permalink
sagemathgh-36677: symengine and symengine_py 0.11
Browse files Browse the repository at this point in the history
    
update symengine and symengine_py to the latest versions, support Cython
3

Also, provide spkg-configure for symengine and symengine_py. Closes
sagemath#32421

Promote symengine_py to optional
    
URL: sagemath#36677
Reported by: Dima Pasechnik
Reviewer(s): Dima Pasechnik, Isuru Fernando, Matthias Köppe, Tobias Diez
  • Loading branch information
Release Manager committed Dec 6, 2023
2 parents b088a97 + f65df40 commit 20430bf
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 10 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/symengine/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=symengine-VERSION.tar.gz
sha1=11885879ddcd0a9ab69e36a79b93aef836d6c95d
md5=4673c85b423241ce85a9df35a7ed61bb
cksum=1344562381
sha1=a2c8957f2099c9199751b165f107bf93d6823818
md5=fe3c3fee1bd8dfdb9576fc2d28cb1076
cksum=3544211225
upstream_url=https://github.com/symengine/symengine/releases/download/vVERSION/symengine-VERSION.tar.gz
1 change: 1 addition & 0 deletions build/pkgs/symengine/distros/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
symengine
1 change: 1 addition & 0 deletions build/pkgs/symengine/distros/homebrew.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
symengine
2 changes: 1 addition & 1 deletion build/pkgs/symengine/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.1
0.11.1
45 changes: 45 additions & 0 deletions build/pkgs/symengine/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
SAGE_SPKG_CONFIGURE([symengine], [
m4_pushdef(SAGE_SYMENGINE_VERSION_MAJOR, [0])
m4_pushdef(SAGE_SYMENGINE_VERSION_MINOR, [11])
SAGE_SPKG_DEPCHECK([gmp arb ecm flint mpc mpfr], [
AC_CHECK_HEADER([symengine/symengine_config.h], [], [sage_spkg_install_symengine=yes])
AC_MSG_CHECKING([whether we can link a program using symengine])
SYMENGINE_SAVED_LIBS=$LIBS
LIBS="$LIBS -lsymengine"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <symengine/expression.h>]],
[[using SymEngine::Expression;
Expression x("x");
auto ex = pow(x+sqrt(Expression(2)), 6);]]
)], [AC_MSG_RESULT([yes])], [
AC_MSG_RESULT([no]); sage_spkg_install_symengine=yes
LIBS=$SYMENGINE_SAVED_LIBS
])
AC_MSG_CHECKING([symengine version >= ]SAGE_SYMENGINE_VERSION_MAJOR[.]SAGE_SYMENGINE_VERSION_MINOR)
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[#include <symengine/symengine_config.h>
#include <stdio.h>
]], [[
fprintf(stderr, "%s\n", SYMENGINE_VERSION);
if (SYMENGINE_MAJOR_VERSION >]] SAGE_SYMENGINE_VERSION_MAJOR[[) return 0;
else if (SYMENGINE_MAJOR_VERSION ==]] SAGE_SYMENGINE_VERSION_MAJOR[[ &&
SYMENGINE_MINOR_VERSION >=]] SAGE_SYMENGINE_VERSION_MINOR[[) return 0;
else return 1;
]])], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
sage_spkg_install_symengine=yes
], [
dnl assume that the person running cross-compiling
dnl knows what they are doing
AC_MSG_RESULT([yes])
])
])
m4_popdef([SAGE_SYMENGINE_VERSION_MAJOR])
m4_popdef([SAGE_SYMENGINE_VERSION_MINOR])
], [], [], []
)

8 changes: 4 additions & 4 deletions build/pkgs/symengine_py/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=symengine.py-VERSION.tar.gz
sha1=fbbf052e66077ec51df319444b71f94114f33d9e
md5=fc5d2d7f571a880aa2e040214aed2ff0
cksum=2535731241
upstream_url=https://github.com/symengine/symengine.py/archive/vVERSION.tar.gz
sha1=4a8da0d0a057c8709c5b28543dbb3d26a060f013
md5=d10f4ba5c27b09ef234fcafddf824ce5
cksum=1332096394
upstream_url=https://pypi.io/packages/source/p/symengine/symengine-VERSION.tar.gz
1 change: 1 addition & 0 deletions build/pkgs/symengine_py/distros/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-symengine
1 change: 1 addition & 0 deletions build/pkgs/symengine_py/distros/freebsd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
math/py-symengine
1 change: 1 addition & 0 deletions build/pkgs/symengine_py/distros/gentoo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dev-python/symengine
2 changes: 1 addition & 1 deletion build/pkgs/symengine_py/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.0
0.11.0
1 change: 1 addition & 0 deletions build/pkgs/symengine_py/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAGE_SPKG_CONFIGURE([symengine_py], [SAGE_PYTHON_PACKAGE_CHECK([symengine_py])])
2 changes: 1 addition & 1 deletion build/pkgs/symengine_py/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
experimental
optional
43 changes: 43 additions & 0 deletions src/sage/features/symengine_py.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
r"""
Check for symengine_py
"""

# ****************************************************************************
# Copyright (C) 2023 Dima Pasechnik
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************

from . import PythonModule
from .join_feature import JoinFeature


class symengine_py(JoinFeature):
r"""
A :class:`sage.features.Feature` describing the presence of the
Python package :ref:`symengine_py <spkg_symengine_py>`.
EXAMPLES::
sage: from sage.features.symengine_py import symengine_py
sage: symengine_py().is_present() # optional - symengine_py
FeatureTestResult('symengine_py', True)
"""
def __init__(self):
r"""
TESTS::
sage: from sage.features.symengine_py import symengine_py
sage: isinstance(symengine_py(), symengine_py)
True
"""
JoinFeature.__init__(self, 'symengine_py',
[PythonModule('symengine', spkg="symengine_py",
url="https://pypi.org/project/symengine")])

def all_features():
return [symengine_py()]

0 comments on commit 20430bf

Please sign in to comment.