Building GMP 5.0.2 & linking Nettle 2.4 to it (missing '__gmpz_getlimbn' symbol)

Morgan Aldridge morgant at
Tue Nov 8 17:57:23 CET 2011

On Tue, Nov 8, 2011 at 10:32 AM, Sam Rawlins <sam.rawlins at> wrote:
> I think the culprit is that the configure script is looking for
> gmpz_getlimbn(). Near as I can tell, no such function exists in GMP 5.0.2
> (but there is mpz_getlimbn,

mpz_getlimbn seems to be defined in my /usr/local/include/gmp.h as follows:

    #define mpz_getlimbn __gmpz_getlimbn

But, it is certainly very suspect that they're specifically testing
for __gmpz_getlimbn() instead of mpz_getlimbn() in their `configure`.

> You need contact the maintainers of Nettle and report that Nettle 2.4 does
> not play well with "recent" (last 5+ years?) versions of GMP. I don't know
> how far back you will have to go to find a version of GMP that unpatched
> Nettle 2.4 can use... (I assume at one time there was a gmpz_getlimbn...).

I'll definitely verify with the Nettle maintainer what the actual
requirements/compatibilities are.

On Tue, Nov 8, 2011 at 10:58 AM, Marc Glisse <marc.glisse at> wrote:
> On Tue, 8 Nov 2011, Morgan Aldridge wrote:
>>   ld warning: in /usr/local/lib/libgmp.dylib, file is not of
>> required architecture
> Now there's a nice and clear message about what's wrong.
> Looks like you have a 64bit GMP and are trying to compile a 32bit app using
> it (your compiler likely defaults to 32 bits).
> If you want a 32bit GMP, read the doc. If you want a 64bit Nettle, ask them.

I had suspected this as well as I've been unable to get Nettle to say
anything other than "ABI: standard", so it probably is stuck in

Many thanks to both of you, Sam & Marc, the process of writing all of
this out and your responses certainly are making me confident that
it's a Nettle issue and that my copy of GMP 5.0.2 is likely built


More information about the gmp-discuss mailing list