Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 294778

Summary: dev-python/pycrypto-2.1.0_beta1 fails to build with USE="gmp"
Product: Gentoo/Alt Reporter: Stuart Shelton <srcshelton>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: OS X   
Whiteboard:
Package list:
Runtime testing required: ---

Description Stuart Shelton 2009-11-26 23:59:49 UTC
The following packages built correctly on 64bit OS X 10.6.2 with USE="gmp":

sys-apps/coreutils-8.1
dev-libs/openssl-0.9.8l-r1

... but dev-python/pycrypto-2.1.0_beta1 fails with:

running build_ext
error: GMP library not found.
 * ERROR: dev-python/pycrypto-2.1.0_beta1 failed:
 *   Building failed with Python 2.6 in building() function
 * 
 * Call stack:
 *     ebuild.sh, line   51:  Called call-ebuildshell 'src_compile'
 *   environment, line  493:  Called src_compile
 *   environment, line 3561:  Called distutils_src_compile
 *   environment, line  893:  Called python_execute_function 'building'
 *   environment, line 3119:  Called die
 * The specific snippet of code:
 *                       die "${failure_message}";

The code in pycrypto's setup.py seems to be:

        if os.environ.get("USE_GMP", "1") == "1":
            # Detect libgmp and don't build _fastmath if it is missing.
            lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib']
            if not (self.compiler.find_library_file(lib_dirs, 'gmp')):
                print >>sys.stderr, "error: GMP library not found."
                sys.exit(1)

dev-libs/gmp-4.3.1 itself installs:

${EPREFIX}/usr/lib/libgmp.3.5.0.dylib
${EPREFIX}/usr/lib/libgmp.3.dylib -> libgmp.3.5.0.dylib
${EPREFIX}/usr/lib/libgmp.a
${EPREFIX}/usr/lib/libgmp.dylib -> libgmp.3.5.0.dylib
${EPREFIX}/usr/lib/libgmp.la

... so is this a case of pycrypto not handling prefix paths (e.g. should the "['/lib', '/usr/lib']" from above be eprefixified?) or is it looking for .so files rather than .dylib?

Looking at distutils/unixccompiler.py, dylib extensions seem to be considered - so it looks as if those paths need to be altered.
Comment 1 Thomas Raschbacher gentoo-dev 2009-12-03 07:20:13 UTC

*** This bug has been marked as a duplicate of bug 291949 ***