[Q] Distributing extensions, compilers, and compatibility

Alex Martelli aleaxit at yahoo.com
Mon Apr 9 12:24:34 EDT 2001


"John Copella" <jcopella at cfl.rr.com> wrote in message
news:ZxkA6.14365$Qi6.1510340 at typhoon.tampabay.rr.com...
> I read in the SWIG documentation that extensions should be compiled with
the
> same compiler as that used to build Python itself.  In my application, I
> will be distributing an extension (as a shared lib) to customers where I
> cannot guarantee this to be so -- can anyone verify from experience that
> this is a necessary restriction?

It depends on your platform.  Executables and shared-libraries produced
by different compilers need not be interoperable on any given platform;
this is not a python-issue, per se, but one depending on the platform.


> FWIW, I will need to support the HP-UX and AIX environments, using the
> commercial compilers from HP and IBM.

In this case, you had probably better build and distribute binary
Python packages with the same compilers you want to use for your
extensions -- I am not sure whether a Python build with (e.g.) KCC,
gcc, older compilers than the current commercial ones (and so on
ad nauseam) can be guaranteed to interoperate with an extension
which is built with these compilers, but I'd bet that at least SOME
cases of incompatibility will probably exist (if nothing else, just
because of the sheer variety of possibilities!-).


Alex






More information about the Python-list mailing list