Skip to content

Commit 610e300

Browse files
committed
Merge branch 'master' into return-int-fraction_free_gauss_jordan_solve
2 parents 2fc3006 + 4052cf6 commit 610e300

21 files changed

+249
-149
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,28 @@ jobs:
3737
CC: gcc
3838

3939
- BUILD_TYPE: Release
40-
PYTHON_VERSION: '3.8'
40+
PYTHON_VERSION: '3.13'
4141
BUILD_SHARED_LIBS: yes
4242
OS: ubuntu-20.04
4343
CC: gcc
4444

4545
- BUILD_TYPE: Release
46-
PYTHON_VERSION: '3.8'
46+
PYTHON_VERSION: '3.13'
4747
WITH_MPFR: yes
4848
INTEGER_CLASS: gmpxx
4949
WITH_NUMPY: no
5050
OS: ubuntu-20.04
5151
CC: gcc
5252

5353
- BUILD_TYPE: Release
54-
PYTHON_VERSION: '3.8'
54+
PYTHON_VERSION: '3.13'
5555
WITH_MPC: yes
5656
OS: ubuntu-20.04
5757
CC: gcc
5858

5959
- BUILD_TYPE: Release
6060
WITH_MPFR: yes
61-
PYTHON_VERSION: '3.8'
61+
PYTHON_VERSION: '3.13'
6262
OS: ubuntu-20.04
6363
CC: gcc
6464

@@ -84,14 +84,14 @@ jobs:
8484
# CC: gcc
8585

8686
- BUILD_TYPE: Debug
87-
PYTHON_VERSION: '3.8'
87+
PYTHON_VERSION: '3.13'
8888
WITH_BFD: yes
8989
BUILD_SHARED_LIBS: yes
9090
OS: ubuntu-20.04
9191
CC: clang
9292

9393
- BUILD_TYPE: Release
94-
PYTHON_VERSION: '3.8'
94+
PYTHON_VERSION: '3.13'
9595
WITH_NUMPY: yes
9696
OS: ubuntu-20.04
9797
CC: clang
@@ -108,27 +108,27 @@ jobs:
108108
EXTRA_APT_PACKAGES: 'llvm-14'
109109

110110
- BUILD_TYPE: Debug
111-
PYTHON_VERSION: '3.8'
111+
PYTHON_VERSION: '3.13'
112112
WITH_SCIPY: yes
113113
WITH_LLVM: 5.0
114-
OS: macos-latest
114+
OS: macos-13
115115
CC: clang
116116

117117
- BUILD_TYPE: Release
118118
PYTHON_VERSION: '3.9'
119119
WITH_NUMPY: no
120-
OS: macos-latest
120+
OS: macos-13
121121
CC: clang
122122

123123
- BUILD_TYPE: Debug
124-
PYTHON_VERSION: '3.8'
124+
PYTHON_VERSION: '3.13'
125125
WITH_NUMPY: no
126-
OS: macos-latest
126+
OS: macos-13
127127
CC: gcc
128128

129129
- BUILD_TYPE: Release
130-
PYTHON_VERSION: '3.8'
131-
OS: macos-latest
130+
PYTHON_VERSION: '3.13'
131+
OS: macos-13
132132
CC: gcc
133133

134134
- BUILD_TYPE: Release

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ Abhinav Agarwal <[email protected]>
2121
Nilay Pochhi <[email protected]>
2222
Björn Dahlgren <[email protected]>
2323
Richard Otis <[email protected]> richardotis
24+
Firat Bezir <[email protected]>
25+

AUTHORS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ Garming Sam <[email protected]>
3535
Pieter Eendebak <[email protected]>
3636
Ayush Kumar <[email protected]>
3737
Christian Clauss <[email protected]>
38+
39+
Aaron Miller <[email protected]>
40+
Firat Bezir <[email protected]>
41+
Adrian Ostrowski <[email protected]>

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.12)
1+
cmake_minimum_required(VERSION 2.8.12...4.0.0)
22

33
if (POLICY CMP0057)
44
cmake_policy(SET CMP0057 NEW) # needed for llvm >= 16
@@ -13,7 +13,7 @@ set(CMAKE_PREFIX_PATH ${SymEngine_DIR} ${CMAKE_PREFIX_PATH})
1313

1414
include(GNUInstallDirs)
1515

16-
find_package(SymEngine 0.8.1 REQUIRED CONFIG
16+
find_package(SymEngine 0.14.0 REQUIRED CONFIG
1717
PATH_SUFFIXES lib/cmake/symengine cmake/symengine CMake/)
1818
message("SymEngine_DIR : " ${SymEngine_DIR})
1919
message("SymEngine Version : " ${SymEngine_VERSION})

README.md

Lines changed: 86 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,79 +3,116 @@
33
Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine),
44
a fast C++ symbolic manipulation library.
55

6-
[![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)
6+
[![Build Status](https://travis-ci.org/symengine/symengine.py.svg)](https://travis-ci.org/symengine/symengine.py)
7+
[![Build status](https://ci.appveyor.com/api/projects/status/sl189l9ck3gd8qvk/branch/master?svg=true)](https://ci.appveyor.com/project/symengine/symengine-py/branch/master)
78

89
## Installation
910

1011
### Pip
1112

1213
See License section for information about wheels
1314

14-
pip install symengine --user
15+
```bash
16+
pip install symengine --user
17+
```
1518

1619
### Conda package manager
1720

18-
conda install python-symengine -c symengine -c conda-forge
19-
20-
optionally, you may choose to install an early [developer preview](https://github.com/symengine/python-symengine-feedstock):
21-
22-
conda install python-symengine -c symengine/label/dev -c conda-forge
21+
```bash
22+
conda install python-symengine -c conda-forge
23+
```
2324

2425
### Build from source
2526

2627
Install prerequisites.
2728

28-
CMake >= 2.8.12
29-
Python3 >= 3.8
30-
Cython >= 0.29.24
31-
SymEngine >= 0.7.0
29+
```bash
30+
CMake >= 2.8.12
31+
Python3 >= 3.8
32+
Cython >= 0.29.24
33+
SymEngine >= 0.7.0
34+
```
3235

33-
For SymEngine, only a specific commit/tag (see symengine_version.txt) is supported.
34-
Latest git master branch may not work as there may be breaking changes in SymEngine.
36+
For **SymEngine**, only a specific commit/tag (see `symengine_version.txt`) is
37+
supported. The latest git master branch may not work as there may be breaking
38+
changes in **SymEngine**.
3539

3640
Python wrappers can be installed by,
3741

38-
python setup.py install
42+
```bash
43+
python setup.py install
44+
```
3945

40-
Additional options to setup.py are
46+
Additional options to `setup.py` are:
4147

42-
python setup.py install build_ext
43-
--symengine-dir=/path/to/symengine/install/dir # Path to SymEngine install directory or build directory
44-
--compiler=mingw32|msvc|cygwin # Select the compiler for Windows
45-
--generator=cmake-generator # CMake Generator
46-
--build-type=Release|Debug # Set build-type for multi-configuration generators like MSVC
47-
--define="var1=value1;var2=value2" # Give options to CMake
48-
--inplace # Build the extension in source tree
48+
```bash
49+
python setup.py install build_ext
50+
--symengine-dir=/path/to/symengine/install/dir # Path to SymEngine install directory or build directory
51+
--compiler=mingw32|msvc|cygwin # Select the compiler for Windows
52+
--generator=cmake-generator # CMake Generator
53+
--build-type=Release|Debug # Set build-type for multi-configuration generators like MSVC
54+
--define="var1=value1;var2=value2" # Give options to CMake
55+
--inplace # Build the extension in source tree
56+
```
4957

50-
Standard options to setup.py like `--user`, `--prefix` can be used to
51-
configure install location. NumPy is used if found by default, if you wish
58+
Standard options to `setup.py` like `--user`, `--prefix` can be used to
59+
configure install location. NumPy is used if found by default, if you wish
5260
to make your choice of NumPy use explicit: then add
53-
e.g. ``WITH_NUMPY=False`` to ``--define``.
54-
55-
Use SymEngine from Python as follows:
56-
57-
>>> from symengine import var
58-
>>> var("x y z")
59-
(x, y, z)
60-
>>> e = (x+y+z)**2
61-
>>> e.expand()
62-
2*x*y + 2*x*z + 2*y*z + x**2 + y**2 + z**2
63-
64-
You can read Python tests in `symengine/tests` to see what features are
65-
implemented.
66-
61+
e.g. `WITH_NUMPY=False` to `--define`.
62+
63+
### Notes on Dependencies
64+
65+
If you intend to evaluate floating-point expressions (using **lambdify**),
66+
you should consider linking against **LLVM**. Many users might also benefit
67+
from linking against **FLINT**, as it is now LGPL-licensed.
68+
69+
In general, **sudo** is only required if you are installing to the default
70+
prefix (`/usr/local`). We recommend specifying a custom prefix
71+
(`--prefix=$HOME/.local`) to avoid requiring administrative privileges,
72+
which most users can do without using **sudo**.
73+
74+
If you're uncomfortable specifying the prefix manually, we suggest using
75+
**Conda** or installing the pre-built wheels via **pip** instead of building
76+
from source.
77+
78+
## Verification
79+
80+
You can verify the installation of **SymEngine** by using the provided code
81+
snippet in this README. This snippet ensures that the installation works as
82+
expected and that basic functionality is available.
83+
84+
```python
85+
from symengine import var
86+
x, y, z = var('x y z')
87+
e = (x + y + z)**2
88+
expanded_e = e.expand()
89+
print(expanded_e)
90+
```
91+
This will output:
92+
```python
93+
x**2 + y**2 + z**2 + 2*x*y + 2*x*z + 2*y*z
94+
```
95+
96+
Note: The verification code provided above checks the functionality of
97+
SymEngine. For additional verification specific to SymEngine, please refer to
98+
the [official SymEngine Python bindings repository](https://github.com/symengine/symengine.py)
99+
for further tests and examples.
67100

68101
## License
69102

70-
symengine.py is MIT licensed and uses several LGPL, BSD-3 and MIT licensed libraries
71-
72-
Licenses for the dependencies of pip wheels are as follows,
73-
74-
pip wheels on Unix use GMP (LGPL-3.0-or-later), MPFR (LGPL-3.0-or-later),
75-
MPC (LGPL-3.0-or-later), LLVM (Apache-2.0), zlib (Zlib), libxml2 (MIT),
76-
zstd (BSD-3-Clause) and symengine (MIT AND BSD-3-Clause).
77-
pip wheels on Windows use MPIR (LGPL-3.0-or-later) instead of GMP above and
78-
pthreads-win32 (LGPL-3.0-or-later) additionally.
79-
NumPy (BSD-3-Clause) and SymPy (BSD-3-Clause) are optional dependencies.
80-
Sources for these binary dependencies can be found on https://github.com/symengine/symengine-wheels/releases
103+
symengine.py is MIT licensed and uses several LGPL, BSD-3, and MIT licensed
104+
libraries.
105+
106+
Licenses for the dependencies of pip wheels are as follows:
107+
108+
- pip wheels on Unix use **GMP** (LGPL-3.0-or-later),
109+
**MPFR** (LGPL-3.0-or-later), **MPC** (LGPL-3.0-or-later),
110+
**LLVM** (Apache-2.0), **zlib** (Zlib), **libxml2** (MIT),
111+
**zstd** (BSD-3-Clause), and **symengine** (MIT AND BSD-3-Clause).
112+
- pip wheels on Windows use **MPIR** (LGPL-3.0-or-later) instead of **GMP**
113+
above and **pthreads-win32** (LGPL-3.0-or-later) additionally.
114+
- **NumPy** (BSD-3-Clause) and **SymPy** (BSD-3-Clause) are optional
115+
dependencies.
116+
- Sources for these binary dependencies can be found on
117+
[symengine-wheels](https://github.com/symengine/symengine-wheels/releases).
81118

appveyor.yml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,37 @@ environment:
77
PLATFORMTOOLSET: "v140"
88

99
matrix:
10+
- BUILD_TYPE: "Release"
11+
COMPILER: MSVC15
12+
PLATFORM: "Win32"
13+
PYTHON_VERSION: 39
14+
CONDA_INSTALL_LOCN: C:\\Miniconda38-x64
15+
WITH_MPFR: yes
16+
WITH_MPC: yes
1017
- BUILD_TYPE: "Release"
1118
COMPILER: MSVC15
1219
PLATFORM: "x64"
1320
PYTHON_VERSION: 310-x64
14-
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
21+
CONDA_INSTALL_LOCN: C:\\Miniconda38-x64
1522
WITH_MPFR: yes
1623
WITH_MPC: yes
1724
- BUILD_TYPE: "Release"
1825
COMPILER: MSVC15
1926
PLATFORM: "x64"
20-
PYTHON_VERSION: 38-x64
21-
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
27+
PYTHON_VERSION: 312-x64
28+
CONDA_INSTALL_LOCN: C:\\Miniconda38-x64
2229
- BUILD_TYPE: "Release"
2330
COMPILER: MSVC15
2431
PLATFORM: "x64"
2532
PYTHON_VERSION: 39-x64
2633
WITH_SYMPY: no
27-
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
34+
CONDA_INSTALL_LOCN: C:\\Miniconda38-x64
2835
- BUILD_TYPE: "Release"
2936
COMPILER: MSVC15
3037
PLATFORM: "x64"
3138
PYTHON_VERSION: 311-x64
3239
WITH_NUMPY: no
33-
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
40+
CONDA_INSTALL_LOCN: C:\\Miniconda38-x64
3441
#- BUILD_TYPE: "Debug"
3542
# COMPILER: MinGW-w64
3643
# PYTHON_VERSION: 39-x64
@@ -42,38 +49,33 @@ environment:
4249
# COMPILER: MinGW-w64
4350
# PYTHON_VERSION: 39-x64
4451
# WITH_SYMPY: no
45-
- BUILD_TYPE: "Release"
46-
COMPILER: MSVC15
47-
PLATFORM: "Win32"
48-
PYTHON_VERSION: 39
49-
CONDA_INSTALL_LOCN: C:\\Miniconda36
50-
WITH_MPFR: yes
51-
WITH_MPC: yes
5252
- BUILD_TYPE: "Release"
5353
COMPILER: MSVC15
5454
PLATFORM: "x64"
5555
PYTHON_VERSION: 310-x64
56-
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
56+
CONDA_INSTALL_LOCN: C:\\Miniconda38-x64
5757
WITH_MPFR: yes
5858
WITH_MPC: yes
5959
WITH_LLVM: yes
6060

6161
install:
6262
- set PYTHON_SOURCE_DIR=%CD%
6363
- git clone https://github.com/sympy/symengine symengine-cpp
64+
- if [%PLATFORM%]==[Win32] set "CONDA_SUBDIR=win-32"
6465

6566
- if [%COMPILER%]==[MSVC15] call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
66-
- if [%COMPILER%]==[MSVC15] conda install --yes --quiet conda python=3.6
67-
- if [%COMPILER%]==[MSVC15] conda config --add channels conda-forge
68-
- if [%COMPILER%]==[MSVC15] if [%BUILD_TYPE%]==[Debug] conda config --add channels symengine/label/debug
69-
- if [%COMPILER%]==[MSVC15] conda install --yes mpir=3.0.0 vc=14
67+
- if [%COMPILER%]==[MSVC15] set "CONDA_DEPS=mpir=3.0.0 vc=14"
68+
- if [%COMPILER%]==[MSVC15] if [%WITH_MPFR%]==[yes] set "CONDA_DEPS=%CONDA_DEPS% mpfr=3.1.5"
69+
- if [%COMPILER%]==[MSVC15] if [%WITH_MPC%]==[yes] set "CONDA_DEPS=%CONDA_DEPS% mpc=1.0.3"
70+
- if [%COMPILER%]==[MSVC15] if [%WITH_LLVM%]==[yes] set "CONDA_DEPS=%CONDA_DEPS% llvmdev=4.0"
71+
- if [%COMPILER%]==[MSVC15] set "CONDA_DEPS=%CONDA_DEPS% -c conda-forge"
72+
- if [%COMPILER%]==[MSVC15] if [%BUILD_TYPE%]==[Debug] set "CONDA_DEPS=%CONDA_DEPS% -c symengine/label/debug"
73+
- if [%COMPILER%]==[MSVC15] conda create -n deps --yes %CONDA_DEPS%
74+
- if [%COMPILER%]==[MSVC15] call conda activate deps
7075
- if [%COMPILER%]==[MSVC15] echo %CONDA_PREFIX%
7176
- if [%COMPILER%]==[MSVC15] echo %PATH%
7277
- if [%COMPILER%]==[MSVC15] set "PATH=%PATH%;%CONDA_PREFIX%\\Library\\bin;%CONDA_PREFIX%"
7378
- if [%COMPILER%]==[MSVC15] echo %PATH%
74-
- if [%COMPILER%]==[MSVC15] if [%WITH_MPFR%]==[yes] conda install --yes mpfr=3.1.5
75-
- if [%COMPILER%]==[MSVC15] if [%WITH_MPC%]==[yes] conda install --yes mpc=1.0.3
76-
- if [%COMPILER%]==[MSVC15] if [%WITH_LLVM%]==[yes] conda install --yes llvmdev=4.0
7779

7880
- if [%COMPILER%]==[MinGW] set "PATH=C:\MinGW\bin;%PATH%"
7981
- if [%COMPILER%]==[MinGW] mingw-get update
@@ -95,7 +97,7 @@ install:
9597

9698
- set "PATH=C:\Python%PYTHON_VERSION%;C:\Python%PYTHON_VERSION%\Scripts;%PATH%"
9799
- echo %PATH%
98-
- pip install nose pytest cython
100+
- pip install nose pytest cython setuptools
99101
- if NOT [%WITH_NUMPY%]==[no] pip install numpy
100102
- if NOT [%WITH_SYMPY%]==[no] pip install sympy
101103

bin/install_travis.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# symengine's bin/install_travis.sh will install miniconda
44

5-
export conda_pkgs="python=${PYTHON_VERSION} pip 'cython>=0.29.24' pytest gmp mpfr"
5+
export conda_pkgs="python=${PYTHON_VERSION} pip pytest setuptools gmp mpfr"
66

77
if [[ "${WITH_NUMPY}" != "no" ]]; then
88
export conda_pkgs="${conda_pkgs} numpy";
@@ -27,7 +27,7 @@ if [[ "${WITH_SAGE}" == "yes" ]]; then
2727
export conda_pkgs="${conda_pkgs} sage=8.1";
2828
fi
2929

30-
conda install -q ${conda_pkgs}
30+
conda install -q ${conda_pkgs} "cython>=0.29.24"
3131

3232
if [[ "${WITH_SYMPY}" != "no" ]]; then
3333
pip install sympy;

0 commit comments

Comments
 (0)