@@ -4,23 +4,39 @@ set -o errexit
44
55# This script should work to install python-flint on Ubuntu from a VCS checkout
66#
7- # $ git checkout https://github.com/flintlib/python-flint.git
7+ # $ git clone https://github.com/flintlib/python-flint.git
8+ # $ cd python-flint
89# $ bin/pip_install_ubuntu.sh .
910#
1011# To install an sdist from PyPI, use
1112#
1213# $ bin/pip_install_ubuntu.sh python-flint
1314#
15+ # The Flint version to build can be provided as an argument, e.g.
16+ #
17+ # $ bin/pip_install_ubuntu.sh python-flint v3.0.1
18+ #
19+ # The version is a tag or branch in the Flint repository. If not provided, the
20+ # script will default to downloading the release tarball hard-coded below. Only
21+ # Flint 3 or newer will work.
22+
23+ if [ -z " $2 " ]; then
24+ echo " Building from release tarball"
25+ FLINT_GIT=" "
26+ FLINTVER=3.0.1
27+ else
28+ echo " Building from git: $2 "
29+ FLINT_GIT=$2
30+ fi
31+ # Either . or python-flint. Passed to pip install
32+ PYTHON_FLINT=$1
1433
1534# Install runtime and build dependencies
1635
1736# First install their dependencies and build dependencies
1837sudo apt-get update
1938sudo apt-get install libgmp-dev libmpfr-dev xz-utils
2039
21- # Only Flint 3 or newer will work.
22- FLINTVER=3.0.1
23-
2440# This will default to installing in /usr/local. If you want to install in a
2541# non-standard location then configure flint with
2642# ./configure --disable-static --prefix=$PREFIX
@@ -29,24 +45,34 @@ FLINTVER=3.0.1
2945# and at runtime set
3046# export LD_LIBRARY_PATH=$PREFIX/lib
3147
32- curl -O -L https://www.flintlib.org/flint-$FLINTVER .tar.gz
33- tar xf flint-$FLINTVER .tar.gz
34- cd flint-$FLINTVER
35- ./bootstrap.sh
36- ./configure --disable-static
37- make -j
38- sudo make install
39- cd ..
48+ if [ -z " $FLINT_GIT " ]; then
49+ # Install from release tarball
50+ echo " Installing Flint $FLINTVER from release tarball"
51+ curl -O -L https://www.flintlib.org/flint-$FLINTVER .tar.gz
52+ tar xf flint-$FLINTVER .tar.gz
53+ cd flint-$FLINTVER
54+ else
55+ # Install from git
56+ echo " Installing Flint from git: $FLINT_GIT "
57+ git clone https://github.com/flintlib/flint.git
58+ cd flint
59+ git checkout $FLINT_GIT
60+ fi
61+
62+ ./bootstrap.sh
63+ ./configure --disable-static
64+ make -j
65+ sudo make install
4066
4167ls -l /usr/local/lib
4268sudo ldconfig /usr/local/lib
4369
44- # Install from checkout (or sdist).
70+ # Build python-flint from sdist
4571echo -----------------------------------------------------------
4672echo
4773echo Running:
48- echo $ pip install --no-binary :all: $1
74+ echo $ pip install --no-binary :all: $PYTHON_FLINT
4975echo
5076echo -----------------------------------------------------------
5177
52- pip install --no-binary :all: $1
78+ pip install --no-binary :all: $PYTHON_FLINT
0 commit comments