Skip to content

Commit

Permalink
Documentation updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
casevh committed Nov 29, 2022
1 parent aa3ce59 commit a8f259f
Show file tree
Hide file tree
Showing 5 changed files with 417 additions and 164 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

# General information about the project.
project = u'gmpy2'
copyright = u'2012 - 2021, Case Van Horsen'
copyright = u'2012 - 2022, Case Van Horsen'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -50,7 +50,7 @@
# The short X.Y version.
version = '2.1'
# The full version, including alpha/beta/rc tags.
release = '2.1.0b6'
release = '2.1.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
140 changes: 4 additions & 136 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ The following libraries are supported:
* GMP for integer and rational arithmetic

Home page: http://gmplib.org
* MPIR is based on the GMP library but adds support for Microsoft's Visual
Studio compiler. It is used to create the Windows binaries.

Home page: http://www.mpir.org
* MPFR for correctly rounded real floating-point arithmetic

Home page: http://www.mpfr.org
Expand All @@ -34,142 +31,13 @@ The following libraries are supported:
gmpy2 Versions
--------------

This manual documents the two major versions of gmpy2. Sections that are
specific to a particular version will be identified as such.
gmpy2 2.1.3 is the last planned release that will support Python 2.7 and the
early Python 3 releases. Bugfixes may be released.

The 2.0 version is the stable release that only receives bug fixes and very
minor updates. Version 2.1 is currently under active development and includes
several new capabilities. Most gmpy2 2.0 code should run unchanged with
gmpy2 2.1.

The most significant change in gmpy2 2.1 is support for thread-safe contexts.
This change required extensive refactoring of almost all internal functions.

Please see the History chapter for a detail list of the changes.
Development will shift to gmpy2 2.2.x

Installation
============

Installing gmpy2 on Windows
---------------------------

Pre-compiled versions of gmpy2 2.0.8 are available at
`https://pypi.org/project/gmpy2/`.

A pre-compiled version of gmpy2 2.1.0a1 is available at
`https://pypi.org/project/gmpy2/2.1.0a1/`. Updated Windows versions should be
available again beginning with version 2.1.0b1.

Installing gmpy2 on Unix/Linux
------------------------------

Requirements
^^^^^^^^^^^^

gmpy2 has only been tested with the most recent versions of GMP, MPFR and MPC.
Specifically, for integer and rational support, gmpy2 requires GMP 5.0.x or
later. To support multiple-precision floating point arithmetic, MPFR 3.1.x or
later is required. MPC 1.0.1 or later is required for complex arithmetic.

Short Instructions
^^^^^^^^^^^^^^^^^^

gmpy2 requires the development files for GMP, MPFR, and MPC. The actual package
that provides these files varies between Linux distributions. Installing
"libmpc-dev" (or its equivalent) is usually sufficient.

If your system has the development libraries installed, compiling should be as
simple as:

::

cd <gmpy2 source directory>
python setup.py build_ext --force install --force

If this fails, read on.

Detailed Instructions
^^^^^^^^^^^^^^^^^^^^^

Note: You really shouldn't need to do this. Unless you need the capabilities
provided a newer GMP/MPFR/MPC, you should use the versions provided by your
distribution.

If your Linux distribution does not support recent versions of GMP, MPFR and
MPC, you will need to compile your own versions. To avoid any possible conflict
with existing libraries on your system, it is recommended to use a directory
not normally used by your distribution.

Create the desired destination directory for GMP, MPFR, and MPC.
::

$ mkdir /home/<<your username>>/local

Download and un-tar the GMP source code. Change to the GMP source directory and
compile GMP.
::

$ cd /home/<<your username>>/local/src/gmp-6.1.2
$ ./configure --prefix=/home/<<your username>>/local
$ make
$ make check
$ make install

Download and un-tar the MPFR source code. Change to the MPFR source directory
and compile MPFR.
::

$ cd /home/<<your username>>/local/src/mpfr-4.0.1
$ ./configure --prefix=/home/<<your username>>/local --with-gmp=/home/<<your username>>/local
$ make
$ make check
$ make install

Download and un-tar the MPC source code. Change to the MPC source directory
and compile MPC.
::

$ cd /home/<<your username>>/local/src/mpc-1.1.0
$ ./configure --prefix=/home/<<your username>>/local --with-gmp=/home/<<your username>>/local --with-mpfr=/home/<<your username>>/local
$ make
$ make check
$ make install

Compile gmpy2 and specify the location of GMP, MPFR and MPC. The location of
the GMP, MPFR, and MPC libraries is embedded into the gmpy2 library so the new
versions of GMP, MPFR, and MPC do not need to be installed the system library
directories. The prefix directory is added to the beginning of the directories
that are checked so it will be found first.
::

$ python setup.py install --prefix=/home/case/local

If you get a "permission denied" error message, you may need to use::

$ python setup.py build --prefix=/home/case/local
$ sudo python setup.py install --prefix=/home/case/local

Options for setup.py
^^^^^^^^^^^^^^^^^^^^

**--force**
Ignore the timestamps on all files and recompile. Normally, the results of a
previous compile are cached. To force gmpy2 to recognize external changes
(updated version of GMP, etc.), you will need to use this option.

**--mpir**
Force the use of MPIR instead of GMP. GMP is the default library on non-Windows
operating systems.

**--gmp**
Force the use of GMP instead of MPIR. MPIR is the default library on Windows
operating systems.

**--shared=<...>**
Add the specified directory prefix to the beginning of the list of
directories that are searched for GMP, MPFR, and MPC shared libraries.

**--static=<...>**
Create a statically linked library using libraries from the specified path,
or from the operating system's default library location if no path is specified
Pre-compiled binary wheels are available on PyPI for Linux, MacOS, and Windows.

Loading

0 comments on commit a8f259f

Please sign in to comment.