10.10. GMP-6.0.0

GMP is a library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers.

10.10.1. Installation of GMP

[Note]

Note

If you are compiling this package on a different CPU than you plan to run the CLFS system on, you must replace GMP's config.guess and config.sub wrappers with the originals. This will prevent GMP from optimizing for the wrong CPU. You can make this change with the following command:

mv -v config{fsf,}.guess
mv -v config{fsf,}.sub

Prepare GMP for compilation:

CC="gcc -isystem /usr/include" \
CXX="g++ -isystem /usr/include" \
LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib" \
  ./configure --prefix=/usr --enable-cxx \
  --docdir=/usr/share/doc/gmp-6.0.0

Compile the package:

make

Build the HTML documentation:

make html
[Important]

Important

The test suite for GMP is considered critical. Do not skip it under any circumstance.

Test the results:

make check

Install the package:

make install

Install the documentation:

make install-html

10.10.2. Contents of GMP

Installed libraries: libgmp.[a,so], libgmpxx.[a,so]
Installed directory: /usr/share/doc/gmp-6.0.0

Short Descriptions

libgmp

Contains the definitions for GNU multiple precision functions.

libgmpxx

Contains a C++ class wrapper for GMP types.