Boost.Python and python 3.x?
Hi, I'm trying to build Boost.Python to use Python 3.1, however I'm getting a bunch of errors (missing functions/members, etc.). I was able to get Boost.Python to compile correctly when using Python 2.6 so I don't think the problem is in my setup. I did a search and as far as I can tell there's no support for python 3.x being built at Boost 1.41, however I haven't found anything for Boost 1.45. There were references to a GSoC project to fix this, did this ever get finished? If so, is there something different between the Python 3.x and Python 2.x jam files that would cause this (other than referencing the correct includes & libs)? Here's my jam file for python 3.1 (C:\Python31 contains the source download of Python 3.1.2, built for Windows x64 release platforms): using msvc ; import os ; using python : 3.1 : # sources C:\\Python31 : # requirements <include>C:\\Python31\\Include <include>C:\\Python31\\PC <library-path>C:\\Python31\\PCBuild\\amd64 ; And I'm compile with this command: bjam link=static threading=multi address-model=64 variant=release toolset=msvc-9.0 -a --with-python
Hi Andrew, Yes, the GSoC project was finished. I checked in a few Python3 related fixes after the 1.45 release that may be important for you, in particular the one below, which you could easily apply manually to your installation. Ralf Index: boost/python/converter/builtin_converters.hpp =================================================================== --- boost/python/converter/builtin_converters.hpp (revision 67431) +++ boost/python/converter/builtin_converters.hpp (revision 67432) @@ -122,7 +122,7 @@ BOOST_PYTHON_TO_INT(int) BOOST_PYTHON_TO_INT(long) -# if defined(_MSC_VER) && defined(_WIN64) +# if defined(_MSC_VER) && defined(_WIN64) && PY_VERSION_HEX < 0x03000000 /* Under 64-bit Windows std::size_t is "unsigned long long". To avoid getting a Python long for each std::size_t the value is checked before the conversion. A std::size_t is converted to a simple Python int
From: Andrew Ho <andrew.ho@utah.edu> To: boost.python mailing list <cplusplus-sig@python.org> Sent: Thu, December 30, 2010 12:04:12 AM Subject: [C++-sig] Boost.Python and python 3.x?
Hi, I'm trying to build Boost.Python to use Python 3.1, however I'm getting a bunch of errors (missing functions/members, etc.). I was able to get Boost.Python to compile correctly when using Python 2.6 so I don't think the problem is in my setup. I did a search and as far as I can tell there's no support for python 3.x being built at Boost 1.41, however I haven't found anything for Boost 1.45. There were references to a GSoC project to fix this, did this ever get finished? If so, is there something different between the Python 3.x and Python 2.x jam files that would cause this (other than referencing the correct includes & libs)?
Here's my jam file for python 3.1 (C:\Python31 contains the source download of Python 3.1.2, built for Windows x64 release platforms):
using msvc ; import os ; using python : 3.1 : # sources C:\\Python31 : # requirements <include>C:\\Python31\\Include <include>C:\\Python31\\PC <library-path>C:\\Python31\\PCBuild\\amd64 ;
And I'm compile with this command: bjam link=static threading=multi address-model=64 variant=release toolset=msvc-9.0 -a --with-python
On Dec 30, 2010, at 9:33 AM, Ralf W. Grosse-Kunstleve wrote:
Hi Andrew,
Yes, the GSoC project was finished. I checked in a few Python3 related fixes after the 1.45 release that may be important for you, in particular the one below, which you could easily apply manually to your installation.
Ralf
Hi Ralf, Great stuff, thanks for doing this. I'm starting to use the new python3 support and that windows fix will surely help down the road. Curious if you could also take a look at https://svn.boost.org/trac/boost/ticket/4609 and see if it is viable for checkin? Thanks! Dane
participants (3)
-
Andrew Ho -
Dane Springmeyer -
Ralf W. Grosse-Kunstleve