Using GMP library with STM32F103

Hi,

I wrote a C program, utilizing the GMP library, which I now want to run on my STM32F103 with mbed framework.

Just doing ‘#include <gmp.h>’ throws : Looking for gmp.h dependency? Check our library registry!

But GMP doesn’t seem to be available via the library registry. How do I install it manually?

So have you tried compiling GMP from source for your platform? If there’s no lib yet from someone else, you’ll have to do it yourself. https://gmplib.org/ has all the sources you need. Note that there’s also mini-gmp.c and mini-gmp.h there, which is a minimalistic implementation of a subset of GMP functions. If you want the full thing you have to copy and configure the subcomponents (multi-precision integer, arbitrary-precision floats etc.) yourself.

Depending on what exactly you want to do exactly (we don’t know) it might also be feasible to use mbedtls’s bignum library functions, which is readibly available for that platform. Or other libraries such as PlatformIO Registry.

Thanks for the answer.
I got it working with the mini-gmp, which I think is sufficent for my needs.