[C++-sig] compiling python extensions to work for multiple versions of python

Karl Kuehn kuehn.karl at gmail.com
Wed May 25 18:45:15 CEST 2011


On May 25, 2011, at 8:25 AM, Wichert Akkerman wrote:

>> 1) Is this a limitation of Boost.Python? A trick from MySQL that I can emulate? Am I missing something obvious? I have tried a large number of variations in build commands using combinations of the following:
> 
> This is a limitation of python, and I would be very afraid of using a MySQL module if it was compiled for another python version, even if it does load. Python versions do not offer a stable ABI: it will change depending on python version, OS, python configure options, compile flags, etc. You should always try to compile Python modules against the specific Python version you want to use.

	Thanks for the pointer. Obviously not what I wanted to hear, but valuable none-the-less. I will just have to go about compiling the modules with separate names, and just swallow the extra bandwidth required to have multiple binaries.

	From what you say, it is odd that the MySQL is working as well as it is then. A single compiled binary has been working very reliably for more than 2 years running on 10.4 (since dropped), 10.5, and 10.6… all of which default to different versions of python. Since this is a testing system we would have glaring holes in our data if it was not working reliably.

	Ah, well… off to start up a few compiles… Thanks much!

--
	Karl Kuehn
	larkost at softhome.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20110525/e6759de0/attachment.html>


More information about the Cplusplus-sig mailing list