How to compile GNU MPFR with mini-gmp ===================================== To build and test MPFR against mini-gmp: ./configure --with-mini-gmp=DIR [other configure options] make make check "make" will build mini-gmp with the same compiler as for MPFR. For "make check", tests that use features not supported by mini-gmp (mpq_t, mpf_t, and the gmp_*printf functions) are skipped. Note: To use this version of the MPFR library, you need to define the MPFR_USE_MINI_GMP macro before including mpfr.h (alternatively, you can modify mpfr.h to define this macro at the beginning). But this will currently not be usable since mini-gmp.h does not declare gmp_randstate_t (you need to modify either mini-gmp.h or mpfr.h). Remark: the random functions provided by MPFR configured with mini-gmp use the lrand48() function, thus one should avoid this configuration if one needs some really serious random functions. This was tested with MPFR svn r13226 and GMP 6.1.2 on x86_64 GNU/Linux: ============================================================================ Testsuite summary for MPFR 4.1.0-dev ============================================================================ # TOTAL: 183 # PASS: 173 # SKIP: 10 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================ How to use mini-gmp with reduced limb size ========================================== Following the idea of Micro-GMP [1], the GMP developers have adapted mini-gmp so that it can be used with a reduced limb size. For that, you have to take a GMP snapshot from December 09, 2018, or later (see https://gmplib.org/download/snapshot/). Then replace the "typedef unsigned long mp_limb_t;" line of mini-gmp.h to have for example: #include typedef uint8_t mp_limb_t; #define __GMP_SHORT_LIMB Then you can configure MPFR with that version of mini-gmp, as indicated above. [1] https://members.loria.fr/PZimmermann/talks/microgmp.pdf