|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +set -o errexit |
| 4 | + |
| 5 | +# This script should work to install python-flint on Ubuntu from a VCS checkout |
| 6 | +# |
| 7 | +# $ git checkout https://github.com/fredrik-johansson/python-flint.git |
| 8 | +# $ bin/pip_install_ubuntu.sh . |
| 9 | +# |
| 10 | +# To install an sdist from PyPI, use |
| 11 | +# |
| 12 | +# $ bin/pip_install_ubuntu.sh python-flint |
| 13 | +# |
| 14 | + |
| 15 | +# Install runtime and build dependencies |
| 16 | + |
| 17 | +# The commented commands below would attempt to build python-flint against a |
| 18 | +# system installation of Flint and Arb in Ubuntu. |
| 19 | +# |
| 20 | +# Ubuntu 23.04 has Flint 2.9.0 and Arb 2.23.0, so this script might work there |
| 21 | +# (for python-flint 0.4.1). That is untested though (23.04 not available in CI). |
| 22 | +# |
| 23 | +# With Ubuntu 22.04, this will build but then crashes when running the tests. |
| 24 | +# most likely this is because the versions of flint and flint-arb are too old. |
| 25 | +# At the time of writing in Ubuntu 22.04 there is Flint 2.8.4 and Arb 2.22. The |
| 26 | +# main CI tests and wheels for python-flint 0.4.1 are built with Flint 2.9.0 |
| 27 | +# and Arb 2.23.0. |
| 28 | +# |
| 29 | +# Link against libflint-arb instead of libarb on Ubuntu |
| 30 | +# export PYTHON_FLINT_LIBFLINT_ARB=1 |
| 31 | +# sudo apt-get update |
| 32 | +# sudo apt-get install libflint-dev libflint-arb-dev |
| 33 | + |
| 34 | + |
| 35 | +# Build Flint and Arb manually |
| 36 | +# |
| 37 | +# First install their dependencies and build dependencies |
| 38 | +sudo apt-get update |
| 39 | +sudo apt-get install libgmp-dev libmpfr-dev xz-utils |
| 40 | + |
| 41 | +# Only these *EXACT* versions will work. |
| 42 | +FLINTVER=2.9.0 |
| 43 | +ARBVER=2.23.0 |
| 44 | + |
| 45 | +# This will default to installing in /usr/local. If you want to install in a |
| 46 | +# non-standard location then configure flint with |
| 47 | +# ./configure --disable-static --prefix=$PREFIX |
| 48 | +# and arb with |
| 49 | +# ./configure --disable-static --prefix=$PREFIX --with-flint=$PREFIX |
| 50 | +# If $PREFIX is no in default search paths, then at build time set |
| 51 | +# export C_INCLUDE_PATH=$PREFIX/include |
| 52 | +# and at runtime set |
| 53 | +# export LD_LIBRARY_PATH=$PREFIX/lib |
| 54 | + |
| 55 | +curl -O -L https://www.flintlib.org/flint-$FLINTVER.tar.gz |
| 56 | +tar xf flint-$FLINTVER.tar.gz |
| 57 | +cd flint-$FLINTVER |
| 58 | + ./configure --disable-static |
| 59 | + make -j |
| 60 | + sudo make install |
| 61 | +cd .. |
| 62 | + |
| 63 | +curl -O -L https://github.com/fredrik-johansson/arb/archive/refs/tags/$ARBVER.tar.gz |
| 64 | +mv $ARBVER.tar.gz arb-$ARBVER.tar.gz |
| 65 | +tar xf arb-$ARBVER.tar.gz |
| 66 | +cd arb-$ARBVER |
| 67 | + ./configure --disable-static |
| 68 | + make -j |
| 69 | + sudo make install |
| 70 | +cd .. |
| 71 | + |
| 72 | +ls -l /usr/local/lib |
| 73 | +sudo ldconfig /usr/local/lib |
| 74 | + |
| 75 | +# Python build requirements. Ideally these would be in pyprojec.toml, but |
| 76 | +# first need to migrate from setup.py to pyproject.toml. |
| 77 | +pip install 'cython>=3' numpy wheel |
| 78 | + |
| 79 | +# Install from checkout (or sdist). |
| 80 | +echo ----------------------------------------------------------- |
| 81 | +echo |
| 82 | +echo Running: |
| 83 | +echo $ pip install --no-build-isolation $1 |
| 84 | +echo |
| 85 | +echo ----------------------------------------------------------- |
| 86 | + |
| 87 | +pip install --no-build-isolation $1 |
0 commit comments