10.10. GMP-5.0.2 32 Bit Libraries

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:

CPPFLAGS=-fexceptions CC="gcc -isystem /usr/include ${BUILD32}" \
CXX="g++ -isystem /usr/include ${BUILD32}" \
LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib ${BUILD32}" \
  ABI=32 ./configure --prefix=/usr \
    -enable-cxx --enable-mpbsd

Compile the package:

make
[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

The header installed by GMP is architecture specific. Programs compiled as 32bit will require the header provided by the 32bit installation of GMP. The same applies for 64bit programs. Move the header so a wrapper can be put in its place later:

mv -v /usr/include/gmp{,-32}.h

Details on this package are located in Section 10.11.2, “Contents of GMP.”