[pycrypto] setup.py fails to find gmp on Debian/Ubuntu

Dwayne C. Litzenberger dlitz at dlitz.net
Mon Oct 10 22:07:38 CST 2011


On Sat, Sep 24, 2011 at 03:04:49PM +0200, Sebastian Ramacher wrote:
>Hi,
>
>Debian and Ubuntu recently started to implement Multiarch [1]. Because of this, 
>libgmp.so has been moved from /usr/lib/ to /usr/lib/<host-triplet>/ and setup.py 
>cannot find it anymore.
[snip]
>
>[1] https://wiki.ubuntu.com/MultiarchSpec

Oh, neat!  I'm still running Ubuntu 11.04 (natty) and Debian squeeze, so I 
never noticed.

On Tue, Sep 27, 2011 at 07:02:44PM +0200, Legrandin wrote:
>+def libgmp_exists():
>+    '''Verify that the compiler and the linker can reach libgmp'''
>+
>+    fname = tempfile.mktemp(".c")
>+    oname = tempfile.mktemp(".out")
>+    f = open(fname, 'w')
>+    f.write("""
>+    #include <gmp.h>
>+
>+    int main(void)
>+    {
>+        mpz_init((void*)0);
>+        return 0;
>+    }
>+    """)
>+    f.close()

Ok, this looks a lot like something an autoconf would do.  Rather than 
writing our own custom version of autoconf in setup.py, I've just added a 
configure script.  Can you try it out?

     https://github.com/dlitz/pycrypto.git

It works for me on Debian wheezy amd64 with libgmp-dev installed.

Note that it should also work with python3 now.

If it's good, I'll make a release this week.

Cheers,
- Dwayne

-- 
Dwayne C. Litzenberger <dlitz at dlitz.net>
  OpenPGP: 19E1 1FE8 B3CF F273 ED17  4A24 928C EC13 39C2 5CF7


More information about the pycrypto mailing list