-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from oscarbenjamin/pr_pip_linux
Add tests for installing on Linux
- Loading branch information
Showing
15 changed files
with
300 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,4 @@ install: | |
- pip install . | ||
|
||
script: | ||
- python test/test.py | ||
- python -m flint.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,25 +18,43 @@ Author: Fredrik Johansson <[email protected]> | |
Installation | ||
------------ | ||
|
||
First install both FLINT (version 2.5 or later) and Arb (version 2.15 or later). | ||
See: | ||
On Windows (x86-64) or OSX (x86-64 or arm64) there are prebuilt wheels for | ||
python-flint 0.4.1 that can be installed from PyPI using pip | ||
|
||
pip install python-flint | ||
|
||
There is currently a problem with the Linux wheels and so for now Linux wheels | ||
are not available on PyPI. Instead for Linux first install both FLINT 2.9.0 and | ||
Arb 2.23. Note that as of python-flint 0.4.1 only these *exact* versions of | ||
FLINT and Arb will work. While some Linux distributions may provide FLINT and | ||
Arb it is unlikely that they will provide the exact versions required (e.g. | ||
for Ubuntu only Ubuntu 23.04 provides these versions at the time of writing). | ||
|
||
See here for instructions on building FLINT and Arb: | ||
|
||
* http://flintlib.org/ | ||
* http://arblib.org/ | ||
|
||
The latest release of Python-FLINT can then be installed using: | ||
The latest release of Python-FLINT can then be built and installed using: | ||
|
||
pip install python-flint | ||
pip install 'cython>=3' numpy wheel | ||
pip install --no-build-isolation python-flint | ||
|
||
Python-FLINT can also be installed git checkout or a source archive | ||
Python-FLINT can also be installed from a git checkout or a source archive | ||
as follows: | ||
|
||
pip install . | ||
pip install 'cython>=3' numpy wheel | ||
pip install --no-build-isolation . | ||
|
||
A script that builds and installs FLINT, Arb and Python-FLINT that is tested on | ||
Ubuntu can be found in the git repo here: | ||
|
||
* https://github.com/fredrik-johansson/python-flint/blob/master/bin/pip_install_ubuntu.sh | ||
|
||
See the documentation for further notes on building and installing | ||
Python-FLINT: | ||
|
||
https://fredrikj.net/python-flint/setup.html | ||
* https://fredrikj.net/python-flint/setup.html | ||
|
||
Examples | ||
------------------------------------- | ||
|
@@ -95,7 +113,6 @@ To do | |
* Conversions to and from external types (numpy, sage, sympy, mpmath, gmpy) | ||
* Improved printing and string input/output | ||
* IPython hooks (TeX pretty-printing etc.) | ||
* Windows support | ||
|
||
License | ||
------------ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
# This script should work to install python-flint on Ubuntu from a VCS checkout | ||
# | ||
# $ git checkout https://github.com/fredrik-johansson/python-flint.git | ||
# $ bin/pip_install_ubuntu.sh . | ||
# | ||
# To install an sdist from PyPI, use | ||
# | ||
# $ bin/pip_install_ubuntu.sh python-flint | ||
# | ||
|
||
# Install runtime and build dependencies | ||
|
||
# The commented commands below would attempt to build python-flint against a | ||
# system installation of Flint and Arb in Ubuntu. | ||
# | ||
# Ubuntu 23.04 has Flint 2.9.0 and Arb 2.23.0, so this script might work there | ||
# (for python-flint 0.4.1). That is untested though (23.04 not available in CI). | ||
# | ||
# With Ubuntu 22.04, this will build but then crashes when running the tests. | ||
# most likely this is because the versions of flint and flint-arb are too old. | ||
# At the time of writing in Ubuntu 22.04 there is Flint 2.8.4 and Arb 2.22. The | ||
# main CI tests and wheels for python-flint 0.4.1 are built with Flint 2.9.0 | ||
# and Arb 2.23.0. | ||
# | ||
# Link against libflint-arb instead of libarb on Ubuntu | ||
# export PYTHON_FLINT_LIBFLINT_ARB=1 | ||
# sudo apt-get update | ||
# sudo apt-get install libflint-dev libflint-arb-dev | ||
|
||
|
||
# Build Flint and Arb manually | ||
# | ||
# First install their dependencies and build dependencies | ||
sudo apt-get update | ||
sudo apt-get install libgmp-dev libmpfr-dev xz-utils | ||
|
||
# Only these *EXACT* versions will work. | ||
FLINTVER=2.9.0 | ||
ARBVER=2.23.0 | ||
|
||
# This will default to installing in /usr/local. If you want to install in a | ||
# non-standard location then configure flint with | ||
# ./configure --disable-static --prefix=$PREFIX | ||
# and arb with | ||
# ./configure --disable-static --prefix=$PREFIX --with-flint=$PREFIX | ||
# If $PREFIX is no in default search paths, then at build time set | ||
# export C_INCLUDE_PATH=$PREFIX/include | ||
# and at runtime set | ||
# export LD_LIBRARY_PATH=$PREFIX/lib | ||
|
||
curl -O -L https://www.flintlib.org/flint-$FLINTVER.tar.gz | ||
tar xf flint-$FLINTVER.tar.gz | ||
cd flint-$FLINTVER | ||
./configure --disable-static | ||
make -j | ||
sudo make install | ||
cd .. | ||
|
||
curl -O -L https://github.com/fredrik-johansson/arb/archive/refs/tags/$ARBVER.tar.gz | ||
mv $ARBVER.tar.gz arb-$ARBVER.tar.gz | ||
tar xf arb-$ARBVER.tar.gz | ||
cd arb-$ARBVER | ||
./configure --disable-static | ||
make -j | ||
sudo make install | ||
cd .. | ||
|
||
ls -l /usr/local/lib | ||
sudo ldconfig /usr/local/lib | ||
|
||
# Python build requirements. Ideally these would be in pyprojec.toml, but | ||
# first need to migrate from setup.py to pyproject.toml. | ||
pip install 'cython>=3' numpy wheel | ||
|
||
# Install from checkout (or sdist). | ||
echo ----------------------------------------------------------- | ||
echo | ||
echo Running: | ||
echo $ pip install --no-build-isolation $1 | ||
echo | ||
echo ----------------------------------------------------------- | ||
|
||
pip install --no-build-isolation $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,13 @@ | |
# For the MSVC toolchain link with mpir instead of gmp | ||
libraries = ["arb", "flint", "mpir", "mpfr", "pthreads"] | ||
else: | ||
libraries = ["arb", "flint"] | ||
# On Ubuntu libarb.so is called libflint-arb.so | ||
if os.getenv('PYTHON_FLINT_LIBFLINT_ARB'): | ||
arb = 'flint-arb' | ||
else: | ||
arb = 'arb' | ||
|
||
libraries = [arb, "flint"] | ||
(opt,) = get_config_vars('OPT') | ||
os.environ['OPT'] = " ".join(flag for flag in opt.split() if flag != '-Wstrict-prototypes') | ||
|
||
|
@@ -75,10 +81,12 @@ | |
cmdclass={'build_ext': build_ext}, | ||
ext_modules=cythonize(ext_modules, compiler_directives=compiler_directives), | ||
#ext_modules=cythonize(ext_modules, compiler_directives=compiler_directives, annotate=True), | ||
packages=['flint'], | ||
packages=['flint', 'flint.test'], | ||
package_dir={'': 'src'}, | ||
description='Bindings for FLINT and Arb', | ||
version='0.4.0', | ||
long_description=open('README.md').read(), | ||
long_description_content_type='text/markdown', | ||
version='0.4.1', | ||
url='https://github.com/python-flint/python-flint', | ||
author='Fredrik Johansson', | ||
author_email='[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from ._flint import * | ||
|
||
__version__ = '0.4.0' | ||
__version__ = '0.4.1' |
Empty file.
Oops, something went wrong.