eGenix extensions / GMP

Alex Martelli aleax at aleax.it
Tue Dec 11 12:41:14 EST 2001


"Duncan Smith" <buzzard at urubu.freeserve.co.uk> wrote in message
news:9v5df1$tla$1 at newsg4.svr.pol.co.uk...
> I have recently installed the eGenix experimental extensions.  This
includes
> a Windows port of GMP 3.1.1.  That works fine.  But I would also like to
use
> GMP via PyInline (or C++), but the C compiler doesn't seem to recognise
that
> GMP is present.  I have also downloaded the Windows port separately from
> http://www.lemburg.com/files/python/, but I'm not sure where to go from
> here.  Anyone any idea how to sort this out (step by step)?  Python 2.1,
> Visual Studio 6 on Win 2000.  Thanks in advance.

I've regularly used the Windows GMP port that comes with gmpy (see
gmpy.sourceforge.net) on its own (not via PyInline -- never tried
that).  For that, you basically just need to have Visual C++ find
the .h file (for compilation) and .lib (for linking), either by
placing those files in existing VC++ recognized directories or by
adding to your environment suitable variables.

Take care, though: if you compile this way, each DLL you build
will be using its own copy of GMP.  I don't know if Lemburg's port
exposes a C-API (to let other Python-extension DLL's/PYD's share
just one GMP); gmpy's does, and there's an example distributed
with it of another C-coded Python extension using that API.  I
don't know about PyInline, though.


Alex






More information about the Python-list mailing list