Skip to content

Commit 4908ebe

Browse files
authored
Merge pull request #501 from firatbezir/update-readme
Update README with verification instructions
2 parents e21a4e9 + a3a9ce8 commit 4908ebe

File tree

1 file changed

+86
-49
lines changed

1 file changed

+86
-49
lines changed

README.md

+86-49
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

0 commit comments

Comments
 (0)