[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

py-crypto + gmp


perhaps someone can give me a pointer with my
following problem:
I try to use the _fastmath (which needs gmp) module
in py-crypto. I'm able to build it by including the following
in PCTBuildExt.build_extensions() in setup.py:

                    include_dirs=['src/', '/usr/local/include'],

I get no errors:

# python setup.py build_ext
running build_ext
building 'Crypto.PublicKey._fastmath' extension
cc -pthread -fno-strict-aliasing -DNDEBUG -O2 -pipe \
-DTHREAD_STACK_SIZE=0x20000 -fPIC -fPIC -Isrc/ \
-I/usr/local/include -I/usr/local/include/python2.4 \
-c src/_fastmath.c \
-o build/temp.openbsd-3.8-i386-2.4/src/_fastmath.o
cc -pthread -shared -fPIC \
-L/usr/obj/i386/python-2.4.1p0/Python-2.4.1 \
build/temp.openbsd-3.8-i386-2.4/src/_fastmath.o \
-o build/lib.openbsd-3.8-i386-2.4/Crypto/PublicKey/_fastmath.so

so it _seems_ alright. But when I try to use it I get the following:

$ python
Python 2.4.1 (#1, Sep  3 2005, 13:08:59)
[GCC 3.3.5 (propolice)] on openbsd3
Type "help", "copyright", "credits" or "license" for more information.
>>> from Crypto.PublicKey import RSA
>>> from Crypto.Util.randpool import RandomPool
>>> rp = RandomPool()
>>> a = RSA.generate(3072, rp.get_bytes)
undefined symbol '__gmpz_init'
lazy binding failed!
Segmentation fault (core dumped)

I'm not sure what to do now, I think it doesn't find libgmp,
symlinking libgmp into /usr/local/lib/python2.4/lib-dynload
doesn't help.

I use the python2.4.1p0 and gmp4.1.4 as packages on a
OpenBSD 3.8-stable. I build py-crypto (2.0.1) from source,
because the port doesn't have a flavor for building fastmath.

any ideas are welcome.