6.14. GMP-5.0.2

6.14.1. Installation of GMP

Note

If you are building for 32-bit x86, but you have a CPU which is
capable of running 64-bit code and you have specified CFLAGS in the environment, the configure script
will attempt to configure for 64-bits and fail. Avoid this by
invoking the configure command below with

ABI=32 ./configure ...

First, fix a minor error noted on the upstream web page:

sed -i 's/np + dn, qn/& - dn/' mpn/generic/dcpi1_bdiv_q.c

Prepare GMP for compilation:

./configure --prefix=/usr --enable-cxx --enable-mpbsd

The meaning of the new configure options:

--enable-cxx

This parameter enables C++ support

--enable-mpbsd

This builds the Berkeley MP compatibility library

Compile the package:

make

Important

The test suite for GMP in this section is considered critical. Do
not skip it under any circumstances.

Test the results:

make check 2>&1 | tee gmp-check-log

Ensure that all 162 tests in the test suite passed. Check the
results by issuing the following command: