The GMP package contains math libraries. These have useful functions for arbitrary precision arithmetic.
Update helper scripts to allow compilation on loongarch:
tar xf ../config-20210826.tar.xz --strip-components=1
Prepare GMP for compilation:
./configure --prefix=/usr \ --enable-cxx \ --disable-static \ --docdir=/usr/share/doc/gmp-6.2.1
The meaning of the new configure options:
--enable-cxx
This parameter enables C++ support
--docdir=/usr/share/doc/gmp-6.2.1
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
The code in gmp is highly optimized for the processor where it is built. Occasionally, the code that detects the processor misidentifies the system capabilities and there will be errors in the tests or other applications using the gmp libraries with the message "Illegal instruction". In this case, gmp should be reconfigured with the option --build=x86_64-pc-linux-gnu and rebuilt.
Ensure that all 197 tests in the test suite passed. Check the results by issuing the following command:
awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
Install the package and its documentation:
make install make install-html