1
- Build from source
2
- =================
1
+ Install/ Build from source
2
+ =========================
3
3
4
4
.. note ::
5
5
The instructions here are for building ``python-flint `` from source. For
@@ -8,13 +8,15 @@ Build from source
8
8
is not available for the platform. See :ref: `install_pip_conda `.
9
9
10
10
11
+ .. _simple_build_instructions :
12
+
11
13
Simple build instructions
12
14
-------------------------
13
15
14
16
The simple explanation of how to build ``python-flint `` from source is that
15
17
there are two steps:
16
18
17
- - Install ``FLINT >= 3.0 `` (see :ref: `install_dependencies ` below).
19
+ - Install ``FLINT >= 3.0 `` (see :ref: `installing_the_dependencies ` below).
18
20
- Run ``pip install --no-binary python-flint python-flint ``.
19
21
20
22
For example on Ubuntu 24.04 (but not older versions of Ubuntu) and when installing
@@ -38,10 +40,15 @@ If you have the source code locally then you can build and install with::
38
40
After installing from source it is recommended to run the tests to check that
39
41
everything is working correctly as described in :ref: `test_installation `.
40
42
41
- The remainder of this page provides more detailed instructions for building
42
- ``python-flint `` from source including how to install the dependencies, how to
43
- build older versions of ``python-flint `` (``< 0.7.0 ``), how to install from
44
- git, and other more advanced topics.
43
+ The remainder of this page provides more detailed instructions for:
44
+
45
+ - :ref: `supported_versions `.
46
+ - :ref: `building_from_source `.
47
+ - :ref: `building_older_versions `.
48
+ - :ref: `installing_the_dependencies `.
49
+ - :ref: `building_on_windows `.
50
+ - :ref: `non_standard_location `.
51
+ - :ref: `editable_install `.
45
52
46
53
.. note ::
47
54
If you have more than one Python environment in your system then you need to
@@ -142,10 +149,10 @@ It is also possible to build and use python-flint for PyPy. Other Python
142
149
implementations may work but are not tested.
143
150
144
151
145
- .. _ build_from_source :
152
+ .. _ building_from_source :
146
153
147
- Building python-flint from source
148
- ---------------------------------
154
+ Installing python-flint from source
155
+ -----------------------------------
149
156
150
157
.. note ::
151
158
The instructions here are for building ``python-flint `` from source. For
@@ -154,18 +161,18 @@ Building python-flint from source
154
161
is not available for the platform. See :ref: `install_pip_conda `.
155
162
156
163
Also if you are working on ``python-flint `` itself then it is not
157
- recommended to install the package
158
-
159
- - XXX: Add link to separate development page...
164
+ recommended to install the package as described here. Instead see the
165
+ :ref: `development_workflow ` page for how to work on ``python-flint ``.
160
166
161
167
The source code for ``python-flint `` is available on `GitHub
162
168
<https://github.com/flintlib/python-flint/tags> `_ and source distributions can
163
169
be downloaded from PyPI.
164
170
165
171
To build from source you must first install the dependencies (see
166
- :ref: `install_dependencies ` below for instructions). Once the dependencies are
167
- installed the following command will download the ``python-flint `` source code
168
- from PyPI, then build and install it into the active Python environment::
172
+ :ref: `installing_the_dependencies ` below for instructions). Once the
173
+ dependencies are installed the following command will download the
174
+ ``python-flint `` source code from PyPI, then build and install it into the
175
+ active Python environment::
169
176
170
177
pip install python-flint
171
178
@@ -223,8 +230,10 @@ example if you want to build ``python-flint`` against the latest git version of
223
230
and Cython that are supported by each version of ``python-flint ``.
224
231
225
232
226
- Building older versions of python-flint
227
- ---------------------------------------
233
+ .. _building_older_versions :
234
+
235
+ Installing older versions from source
236
+ -------------------------------------
228
237
229
238
For ``python-flint < 0.6.0 `` the source distribution did not include
230
239
``pyproject.toml `` and did not list the build requirements. Also for
@@ -244,7 +253,7 @@ If the build fails during the Cython step then it is likely that a different
244
253
version of Cython is needed.
245
254
246
255
247
- .. _ install_dependencies :
256
+ .. _ installing_the_dependencies :
248
257
249
258
Installing the dependencies
250
259
---------------------------
@@ -321,34 +330,19 @@ again be able to install ``python-flint`` with::
321
330
322
331
pip install .
323
332
324
- In the ``python-flint `` git repo there is a script
325
- `bin/build_dependencies_unix.sh
326
- <https://github.com/flintlib/python-flint/blob/master/bin/build_dependencies_unix.sh> `_
327
- which will download and build GMP, MPFR and FLINT and install them in the
328
- current directory under ``~/.local ``. The versions used and the installation
329
- directory can be changed by editing the `bin/build_variables.sh
330
- <https://github.com/flintlib/python-flint/blob/master/bin/build_variables.sh> `_
331
- script. This script is useful for building ``python-flint `` on systems where
332
- the system-wide ``FLINT `` is too old or if precise control over the versions of
333
- GMP, MPFR and FLINT is needed. This script is used for building the binaries
334
- for PyPI and also takes care of ensuring that ``GMP `` and ``FLINT `` are built
335
- as redistributable shared libraries (this is not the default behaviour of the
336
- ``configure `` scripts for these libraries and disables some optimisation
337
- features of ``FLINT `` on some ``x86_64 `` micro-architectures). Since this
338
- installation is not system-wide, see :ref: `non_standard_location ` below for
339
- instructions on how to build and use ``python-flint `` in this case.
340
-
341
-
342
- Building on Windows
343
- -------------------
333
+
334
+ .. _building_on_windows :
335
+
336
+ Installing from source on Windows
337
+ ---------------------------------
344
338
345
339
.. note ::
346
340
Building from source is not the recommended way for most users to install
347
341
``python-flint ``, especially on Windows. For most users it is recommended to
348
342
use the binaries from ``PyPI `` or ``conda-forge `` except in cases where a
349
343
binary is not available for the platform. See :ref: `install_pip_conda `.
350
344
351
- The instructions in :ref: `install_dependencies ` above are for Unix-like systems
345
+ The instructions in :ref: `installing_the_dependencies ` above are for Unix-like systems
352
346
(e.g. Linux or MacOS). On Windows the dependencies can be built in a similar
353
347
way using MSYS2 or under WSL. It is also possible to build ``python-flint `` and
354
348
its dependencies using MSVC but we do not currently provide instructions for
@@ -464,18 +458,17 @@ perhaps it could be possible to link ``FLINT`` and the other libraries
464
458
statically into ``python-flint ``.
465
459
466
460
467
- Editable install
468
- ----------------
469
-
470
- .. note ::
471
- For working on ``python-flint `` itself it is not recommended to install the
472
- package into the active Python environment. Instead the development
473
- workflow uses ``spin `` and ``meson `` to manage a local build of
474
- ``python-flint ``. See
461
+ .. _editable_install :
475
462
476
- - XXX: Add link to separate development page...
463
+ Installing in editable mode
464
+ ---------------------------
477
465
478
- for more information on how to develop ``python-flint ``.
466
+ .. note ::
467
+ For working on ``python-flint `` itself it is not recommended to install the
468
+ package into the active Python environment. Instead the development workflow
469
+ uses ``spin `` and ``meson `` to manage a local build of ``python-flint ``. See
470
+ the :ref: `development_workflow ` page for more information on how to develop
471
+ ``python-flint ``.
479
472
480
473
If you are building and testing ``python-flint `` while working on another
481
474
project then it may be useful to install ``python-flint `` in editable mode.
0 commit comments