The GMP package contains math libraries. These have useful functions for arbitrary precision arithmetic.
Prepare GMP for 32-bit compilation:
ABI=32 ./configure --prefix=/usr --enable-cxx \ --libdir=/usr/lib32 \ CC="gcc -m32" CXX="g++ -m32"
The meaning of the new configure options:
ABI=32
Tells the configure script that we are building a 32-bit version of GMP.
--enable-cxx
This parameter enables C++ support
Compile the package:
make
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 188 tests in the test suite passed. Check the results by issuing the following command:
awk '/tests passed/{total+=$2} ; END{print total}' gmp-check-log
Install the package:
make install
Create the 32-bit header file:
mv -v /usr/include/gmp{,-32}.h
Clean up the build directory before moving on to the next platform:
make distclean
Prepare GMP for x32 ABI compilation:
ABI=x32 ./configure --prefix=/usr --enable-cxx \ --libdir=/usr/libx32 \ CC="gcc -mx32" CXX="g++ -mx32"
The meaning of the new configure options:
ABI=x32
Tells the configure script that we are building an x32 ABI version of GMP.
--enable-cxx
This parameter enables C++ support
Compile the package:
make
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 188 tests in the test suite passed. Check the results by issuing the following command:
awk '/tests passed/{total+=$2} ; END{print total}' gmp-check-log
Install the package:
make install
Create the x32 ABI header file:
mv -v /usr/include/gmp{,-x32}.h
Clean up the build directory before moving on to the next platform:
make distclean
Prepare GMP for 64-bit compilation:
./configure --prefix=/usr \ --enable-cxx \ --docdir=/usr/share/doc/gmp-6.0.0a
The meaning of the new configure options:
--enable-cxx
This parameter enables C++ support
--docdir=/usr/share/doc/gmp-6.0.0a
This variable specifies the correct place for the documentation.
Compile the package and generate the HTML documentation:
make make html
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 188 tests in the test suite passed. Check the results by issuing the following command:
awk '/tests passed/{total+=$2} ; END{print total}' gmp-check-log
Install the package and its documentation:
make install make install-html
Create the 64-bit header file:
mv -v /usr/include/gmp{,-64}.h
Finally, create a stub header in the place of the originals:
cat > /usr/include/gmp.h << "EOF" /* gmp.h - Stub Header */ #ifndef __STUB__GMP_H__ #define __STUB__GMP_H__ #if defined(__x86_64__) || \ defined(__sparc64__) || \ defined(__arch64__) || \ defined(__powerpc64__) || \ defined (__s390x__) # if defined (__ILP32__) # include "gmp-x32.h" # else # include "gmp-64.h" # endif #else # include "gmp-32.h" #endif #endif /* __STUB__GMP_H__ */ EOF