Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions .github/workflows/buildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,36 +120,38 @@ jobs:
- run: pip install --no-index --find-links wheelhouse python_flint
- run: python -m flint.test --verbose

test_pip_vcs_sdist:
name: pip install ${{ matrix.target }} on ${{ matrix.python-version }}
runs-on: ubuntu-22.04
# On new enough Ubuntu we can build against the system deb.
test_pip_flint_deb:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13-dev']
# '.' means install from python-flint git checkout
# 'python-flint' means install from PyPI sdist
target: ['.', 'python-flint']
os: [ubuntu-24.04]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: bin/pip_install_ubuntu.sh ${{ matrix.target }}
python-version: '3.12'
- run: sudo apt-get update
- run: sudo apt-get install libflint-dev
- run: pip install .
- run: python -m flint.test --verbose

# For older Ubuntu we have to build Flint >= 3.0.0
test_flint_versions:
name: Test flint ${{ matrix.flinttag }}
name: Test flint ${{ matrix.flint-tag }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# Supported versions and latest git
flinttag: ['v3.0.0', 'v3.0.1', 'v3.1.0', 'main']
flint-tag: ['v3.0.0', 'v3.0.1', 'v3.1.0', 'v3.1.1', 'v3.1.2', 'main']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- run: bin/pip_install_ubuntu.sh . ${{ matrix.flinttag }}
python-version: '3.12'
- run: bin/install_flint_ubuntu.sh ${{ matrix.flint-tag }}
- run: pip install .
- run: python -m flint.test --verbose
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,20 @@ First install FLINT 3. Starting with python-flint 0.5.0 older versions of Flint
such as 2.9 are not supported any more. Note that as of Flint 3 Arb no longer
needs to be built separately as it is now merged into Flint.

See here for instructions on building FLINT:
As of e.g. Ubuntu 24.04 a new enough version of FLINT (at least version 3) can
be installed from the Ubuntu repos like

sudo apt-get install libflint-dev

For older distros the version in the repos is too old and a newer version of
FLINT needs to be built. See here for instructions on building FLINT:

* http://flintlib.org/

A script that builds and installs FLINT on Ubuntu can be found here:

* https://github.com/flintlib/python-flint/blob/master/bin/install_flint_ubuntu.sh

The latest release of Python-FLINT can then be built from source and installed
using:

Expand All @@ -54,11 +64,6 @@ as follows:

pip install .

A script that builds and installs FLINT and python-flint that is tested on
Ubuntu can be found in the git repo here:

* https://github.com/flintlib/python-flint/blob/master/bin/pip_install_ubuntu.sh

See the documentation for further notes on building and installing
python-flint:

Expand Down
52 changes: 52 additions & 0 deletions bin/install_flint_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

set -o errexit

#
# This script should work to build and install Flint from git on Ubuntu
#
# $ git clone https://github.com/flintlib/python-flint.git
# $ cd python-flint
# $ bin/install_flint_ubuntu.sh v3.1.0
#
# The version is a tag or branch in the Flint repository.
#
# Then to install an sdist from PyPI, use
#
# $ pip install python-flint
#
# To install python-flint from the git checkout
#
# $ pip install .
#

echo "Building from git: $1"
GIT_REF=$1

# Install runtime and build dependencies

# First install their dependencies and build dependencies
sudo apt-get update
sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build

#
# 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
# If $PREFIX is not 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
#
echo "Installing Flint from git: $GIT_REF"
git clone https://github.com/flintlib/flint.git
cd flint
git checkout $GIT_REF
./bootstrap.sh
./configure --disable-static
make -j
sudo make install
cd ..

ls -l /usr/local/lib
sudo ldconfig /usr/local/lib
78 changes: 0 additions & 78 deletions bin/pip_install_ubuntu.sh

This file was deleted.