From Alexander.Biddulph at uon.edu.au Mon Feb 4 20:54:14 2019 From: Alexander.Biddulph at uon.edu.au (Alexander Biddulph) Date: Tue, 5 Feb 2019 01:54:14 +0000 Subject: [C++-sig] Boost 1.69 python3 module In-Reply-To: <0085ed16-8e3f-b3b2-5574-27d9143df32a@seefeld.name> References: <0085ed16-8e3f-b3b2-5574-27d9143df32a@seefeld.name> Message-ID: <2758d4c6-3213-7a56-930d-5783caaf18f8@uon.edu.au> Hi, Finally managed to get around to rebuilding this with "-d2" added to the command line. Here is a link to the build output https://drive.google.com/open?id=1tlwj3-uGd6wsZ5qJcrD4Ms4RbaVMbDmC As before, everything seems to be built and installed, except for the python library. As before, Boost.Build seems to find the python installation and says it is going to build the python library, but just doesn't seem to get around to doing it and there don't appear to be any errors that the build system encountered. On 30/1/19 1:08 am, stefan wrote: Hi Alexander, On 2019-01-28 9:02 p.m., Alexander Biddulph wrote: Hopefully this is the right list for this. It is, though the issue may be more related to the Boost build system (b2 / Boost.Build), so I'm cross-posting to try to get their attention, too. I have been struggling to get Boost 1.69 to build Boost.Python against Python 3.6.3. I have specified the location of the python binary, include, and library (due to a non-standard install location) in the project-config.jam file in the Boost source directory. Running bjam and specifying "--debug-configuration" results in "[python-cfg]" output indicating that boost has found my Python installation and is satisfied with it configuration, it also indicates that it found numpy. notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "3.6" notice: [python-cfg] user-specified cmd-or-prefix: "/nubots/toolchain" notice: [python-cfg] Checking interpreter command "/nubots/toolchain/bin/python3.6"... notice: [python-cfg] running command '/nubots/toolchain/bin/python3.6 -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1' notice: [python-cfg] ...requested configuration matched! notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "/nubots/toolchain/bin/python3.6" notice: [python-cfg] include path: "/nubots/toolchain/include/python3.6" notice: [python-cfg] library path: "/nubots/toolchain/lib/python3.6/config" "/nubots/toolchain/lib" notice: [python-cfg] Checking for NumPy... notice: [python-cfg] running command '/nubots/toolchain/bin/python3.6 -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"' notice: [python-cfg] NumPy enabled notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "3.6" notice: [python-cfg] user-specified cmd-or-prefix: "/nubots/toolchain/bin/python3" notice: [python-cfg] user-specified includes: "/nubots/toolchain/include/python3.6m" notice: [python-cfg] user-specified libraries: "/nubots/toolchain/lib" notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "/nubots/toolchain/bin/python3" notice: [python-cfg] include path: "/nubots/toolchain/include/python3.6m" notice: [python-cfg] library path: "/nubots/toolchain/lib" notice: [python-cfg] Checking for NumPy... notice: [python-cfg] running command '/nubots/toolchain/bin/python3 -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"' notice: [python-cfg] NumPy enabled During the component configuration output it says "- python : building". OK, so far all looks good / expected. Scanning through the build output there are numerous lines where boost.python header files are copied (lines starting with common.copy). However, the libboost_python appears to never be built or installed and there is no output indicating that there was an error with any stage of the build. Can you please attach the full output of your build ? (Perhaps even rerun with `-d2` to make the output more verbose ?) It looks as though all other Boost modules/libraries are built, just not Boost.Python. What is going on here? Thanks, [Stefan] -- ...ich hab' noch einen Koffer in Berlin... -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.png Type: image/png Size: 1478 bytes Desc: signature.png URL: From stefan at seefeld.name Wed Feb 6 09:22:25 2019 From: stefan at seefeld.name (stefan) Date: Wed, 6 Feb 2019 09:22:25 -0500 Subject: [C++-sig] Boost 1.69 python3 module In-Reply-To: <2758d4c6-3213-7a56-930d-5783caaf18f8@uon.edu.au> References: <0085ed16-8e3f-b3b2-5574-27d9143df32a@seefeld.name> <2758d4c6-3213-7a56-930d-5783caaf18f8@uon.edu.au> Message-ID: On 2019-02-04 8:54 p.m., Alexander Biddulph wrote: > > Hi, > > Finally managed to get around to rebuilding this with "-d2" added to > the command line. Here is a link to the build output > https://drive.google.com/open?id=1tlwj3-uGd6wsZ5qJcrD4Ms4RbaVMbDmC > > As before, everything seems to be built and installed, except for the > python library. > As before, Boost.Build seems to find the python installation and says > it is going to build the python library, but just doesn't seem to get > around to doing it and there don't appear to be any errors that the > build system encountered. > I don't see anything obvious either. Steve, can you help with this ? Thanks, Stefan -- ...ich hab' noch einen Koffer in Berlin... -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.png Type: image/png Size: 1478 bytes Desc: not available URL: From stefan at seefeld.name Wed Feb 6 12:26:44 2019 From: stefan at seefeld.name (stefan) Date: Wed, 6 Feb 2019 12:26:44 -0500 Subject: [C++-sig] [Boost-build] Boost 1.69 python3 module In-Reply-To: References: <0085ed16-8e3f-b3b2-5574-27d9143df32a@seefeld.name> <2758d4c6-3213-7a56-930d-5783caaf18f8@uon.edu.au> Message-ID: <06233baf-f2da-585d-2eb4-786828ea6a94@seefeld.name> Alexander, I'm replying by re-adding some addresses, just so you don't miss Steven's reply below. Can you please try that and report back what you get ? On 2019-02-06 12:13 p.m., Steven Watanabe via Boost-build wrote: > AMDG > > On 2/6/19 7:22 AM, stefan via Boost-build wrote: >> On 2019-02-04 8:54 p.m., Alexander Biddulph wrote: >>> Hi, >>> >>> Finally managed to get around to rebuilding this with "-d2" added to >>> the command line. Here is a link to the build output >>> https://drive.google.com/open?id=1tlwj3-uGd6wsZ5qJcrD4Ms4RbaVMbDmC >>> >>> As before, everything seems to be built and installed, except for the >>> python library. >>> As before, Boost.Build seems to find the python installation and says >>> it is going to build the python library, but just doesn't seem to get >>> around to doing it and there don't appear to be any errors that the >>> build system encountered. >>> >> I don't see anything obvious either. Steve, can you help with this ? >> > Try `--with-python --debug-building` (--debug-building > generates way too much output if you build everything) > I suspect that you'll see "no in common properties" > My best guess is that the problem is in python.require-py. > Maybe run under the debugger and set a breakpoint there. > > In Christ, > Steven Watanabe > _______________________________________________ > Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build Stefan -- ...ich hab' noch einen Koffer in Berlin... -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.png Type: image/png Size: 1478 bytes Desc: not available URL: From Alexander.Biddulph at uon.edu.au Wed Feb 6 18:21:25 2019 From: Alexander.Biddulph at uon.edu.au (Alexander Biddulph) Date: Wed, 6 Feb 2019 23:21:25 +0000 Subject: [C++-sig] [Boost-build] Boost 1.69 python3 module In-Reply-To: <06233baf-f2da-585d-2eb4-786828ea6a94@seefeld.name> References: <0085ed16-8e3f-b3b2-5574-27d9143df32a@seefeld.name> <2758d4c6-3213-7a56-930d-5783caaf18f8@uon.edu.au> <06233baf-f2da-585d-2eb4-786828ea6a94@seefeld.name> Message-ID: OK, I scrubbed the build folder and ran again. Here is a link to the output with -d2 --debug-configuration --with-python --debug-building on the command line (in that order) https://drive.google.com/open?id=1hINO1jHr5ikkVQ4o3EDexGGhhtpy2RTe On 7/2/19 4:26 am, stefan wrote: Alexander, I'm replying by re-adding some addresses, just so you don't miss Steven's reply below. Can you please try that and report back what you get ? On 2019-02-06 12:13 p.m., Steven Watanabe via Boost-build wrote: AMDG On 2/6/19 7:22 AM, stefan via Boost-build wrote: On 2019-02-04 8:54 p.m., Alexander Biddulph wrote: Hi, Finally managed to get around to rebuilding this with "-d2" added to the command line. Here is a link to the build output https://drive.google.com/open?id=1tlwj3-uGd6wsZ5qJcrD4Ms4RbaVMbDmC As before, everything seems to be built and installed, except for the python library. As before, Boost.Build seems to find the python installation and says it is going to build the python library, but just doesn't seem to get around to doing it and there don't appear to be any errors that the build system encountered. I don't see anything obvious either. Steve, can you help with this ? Try `--with-python --debug-building` (--debug-building generates way too much output if you build everything) I suspect that you'll see "no in common properties" My best guess is that the problem is in python.require-py. Maybe run under the debugger and set a breakpoint there. In Christ, Steven Watanabe _______________________________________________ Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build [Stefan] -- ...ich hab' noch einen Koffer in Berlin... -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.png Type: image/png Size: 1478 bytes Desc: signature.png URL: From c3124185 at uon.edu.au Thu Feb 7 17:55:22 2019 From: c3124185 at uon.edu.au (Alex Biddulph) Date: Thu, 7 Feb 2019 22:55:22 +0000 Subject: [C++-sig] [Boost-build] Boost 1.69 python3 module In-Reply-To: References: <0085ed16-8e3f-b3b2-5574-27d9143df32a@seefeld.name> <2758d4c6-3213-7a56-930d-5783caaf18f8@uon.edu.au> <06233baf-f2da-585d-2eb4-786828ea6a94@seefeld.name> Message-ID: <7b170fd6-9922-3d38-9e48-126cfde3ea10@uon.edu.au> > It looks like python was built in that run. > I also noticed: > project-config.jam:33: syntax error at EOF > which didn't appear in the previous log. > In addition, the new log shows configuration > of python 2.7 instead of python 3.6. It did indeed appear to build the python library in that case (although I missed a semicolon so it built python27 instead of python36). I corrected my error (also scrubbing the build folder again), and this time it correctly built and installed the python36 library. Here is the link to the output for this build https://drive.google.com/open?id=1UHzlwMfAlXlOEghqIFH41jnBlfPNAH51 So I went back to building everything (I left the --debug-building option on) and once again, it built everything but the python36 library. Here is the link to the build output for this build https://drive.google.com/open?id=14m9Jrwz8imrEi90HGkkmglVKEI3v6FHH On 7/2/19 10:21 am, Alexander Biddulph wrote: OK, I scrubbed the build folder and ran again. Here is a link to the output with -d2 --debug-configuration --with-python --debug-building on the command line (in that order) https://drive.google.com/open?id=1hINO1jHr5ikkVQ4o3EDexGGhhtpy2RTe On 7/2/19 4:26 am, stefan wrote: Alexander, I'm replying by re-adding some addresses, just so you don't miss Steven's reply below. Can you please try that and report back what you get ? On 2019-02-06 12:13 p.m., Steven Watanabe via Boost-build wrote: AMDG On 2/6/19 7:22 AM, stefan via Boost-build wrote: On 2019-02-04 8:54 p.m., Alexander Biddulph wrote: Hi, Finally managed to get around to rebuilding this with "-d2" added to the command line. Here is a link to the build output https://drive.google.com/open?id=1tlwj3-uGd6wsZ5qJcrD4Ms4RbaVMbDmC As before, everything seems to be built and installed, except for the python library. As before, Boost.Build seems to find the python installation and says it is going to build the python library, but just doesn't seem to get around to doing it and there don't appear to be any errors that the build system encountered. I don't see anything obvious either. Steve, can you help with this ? Try `--with-python --debug-building` (--debug-building generates way too much output if you build everything) I suspect that you'll see "no in common properties" My best guess is that the problem is in python.require-py. Maybe run under the debugger and set a breakpoint there. In Christ, Steven Watanabe _______________________________________________ Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build [Stefan] -- ...ich hab' noch einen Koffer in Berlin... _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig at python.org https://mail.python.org/mailman/listinfo/cplusplus-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.png Type: image/png Size: 1478 bytes Desc: signature.png URL: From stefan at seefeld.name Fri Feb 8 08:00:51 2019 From: stefan at seefeld.name (Stefan Seefeld) Date: Fri, 8 Feb 2019 08:00:51 -0500 Subject: [C++-sig] [Boost-build] Fwd: Re: Boost 1.69 python3 module In-Reply-To: <95ba9e5d-a8df-e2e5-775c-ef3824f06bbc@gmail.com> References: <7b170fd6-9922-3d38-9e48-126cfde3ea10@uon.edu.au> <31f8a06e-8725-cd53-e4a8-e7876d12d77c@uon.edu.au> <95ba9e5d-a8df-e2e5-775c-ef3824f06bbc@gmail.com> Message-ID: Steven, I'm not sure the author of the original mail is subscribed to the Boost-build list, so I'm cross-posting your reply. On 2019-02-08 1:56 a.m., Steven Watanabe via Boost-build wrote: > AMDG > > On 2/7/19 6:04 PM, Alex Biddulph via Boost-build wrote: >> >> >>> It looks like python was built in that run. >>> I also noticed: >>> project-config.jam:33: syntax error at EOF >>> which didn't appear in the previous log. >>> In addition, the new log shows configuration >>> of python 2.7 instead of python 3.6. >> It did indeed appear to build the python library in that case (although I missed a semicolon so it built python27 instead of python36). >> >> I corrected my error (also scrubbing the build folder again), and this time it correctly built and installed the python36 library. >> Here is the link to the output for this build >> https://drive.google.com/open?id=1UHzlwMfAlXlOEghqIFH41jnBlfPNAH51 >> > Well, at least you now have a workaround. > >> So I went back to building everything (I left the --debug-building option on) and once again, it built everything but the python36 library. Here is the link to the build output for this build >> https://drive.google.com/open?id=14m9Jrwz8imrEi90HGkkmglVKEI3v6FHH >> > That's really strange. I have no idea why that would happen. > There's definitely some kind of hidden global state somewhere. > That mostly confirms my suspicion that the offending rule is > python.require-py. Maybe if you add /debug/ into the call to > main-target.select-alternatives, it will reveal something: > > local py-ext-alternative = [ $(py-ext-target).select-alternatives > $(property-set) debug ] ; > > In Christ, > Steven Watanabe > _______________________________________________ > Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build -- Stefan -- ...ich hab' noch einen Koffer in Berlin... -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: .signature.png Type: image/png Size: 2754 bytes Desc: not available URL: From c3124185 at uon.edu.au Tue Feb 12 17:31:00 2019 From: c3124185 at uon.edu.au (Alex Biddulph) Date: Tue, 12 Feb 2019 22:31:00 +0000 Subject: [C++-sig] Boost 1.69 python3 module Message-ID: <4627ff3d-43e9-ab3b-0ce6-c217751d252b@uon.edu.au> > That's really strange. I have no idea why that would happen. > There's definitely some kind of hidden global state somewhere. > That mostly confirms my suspicion that the offending rule is > python.require-py. Maybe if you add /debug/ into the call to > main-target.select-alternatives, it will reveal something: > > local py-ext-alternative = [ $(py-ext-target).select-alternatives > $(property-set) debug ] ; This also results in a successful building and installation of the Boost.Python library (along with all the others). Here is the build output https://drive.google.com/open?id=1jNBu73JvFwcs8z0Om_o7bJ68x0KXCU4U From c3124185 at uon.edu.au Mon Feb 18 23:09:11 2019 From: c3124185 at uon.edu.au (Alex Biddulph) Date: Tue, 19 Feb 2019 04:09:11 +0000 Subject: [C++-sig] [Boost-build] Boost 1.69 python3 module In-Reply-To: <320fbca7-0340-74f1-3f7e-ae8579493b65@gmail.com> References: <4627ff3d-43e9-ab3b-0ce6-c217751d252b@uon.edu.au> <320fbca7-0340-74f1-3f7e-ae8579493b65@gmail.com> Message-ID: <197f2d1f-fad5-0400-181f-53cec5336f00@uon.edu.au> Not sure what happened there, I must have dirtied my build environment. I cleaned everything up and ran it again. Here is the output. https://drive.google.com/open?id=1u_8KHpjuAC2Cm0jGrVOdGvaqxFtslhNm On 16/2/19 5:39 am, Steven Watanabe via Boost-build wrote: > AMDG > > On 2/12/19 3:31 PM, Alex Biddulph via Boost-build wrote: >>> That's really strange. I have no idea why that would happen. >>> There's definitely some kind of hidden global state somewhere. >>> That mostly confirms my suspicion that the offending rule is >>> python.require-py. Maybe if you add /debug/ into the call to >>> main-target.select-alternatives, it will reveal something: >>> >>> local py-ext-alternative = [ $(py-ext-target).select-alternatives >>> $(property-set) debug ] ; >> This also results in a successful building and installation of the Boost.Python library (along with all the others). Here is the build output >> https://drive.google.com/open?id=1jNBu73JvFwcs8z0Om_o7bJ68x0KXCU4U >> > That makes no sense to me. The only thing that should be > affected by this change is a few ECHO calls. Are you > sure that everything else is the same? I see a new error: > /nubots/toolchain/bin/python3: error while loading shared libraries: > libpython3.6m.so.1.0: cannot open shared object file: No such file or > directory > > In Christ, > Steven Watanabe > _______________________________________________ > Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build From watanabesj at gmail.com Mon Feb 18 23:24:50 2019 From: watanabesj at gmail.com (Steven Watanabe) Date: Mon, 18 Feb 2019 21:24:50 -0700 Subject: [C++-sig] [Boost-build] Boost 1.69 python3 module In-Reply-To: <197f2d1f-fad5-0400-181f-53cec5336f00@uon.edu.au> References: <4627ff3d-43e9-ab3b-0ce6-c217751d252b@uon.edu.au> <320fbca7-0340-74f1-3f7e-ae8579493b65@gmail.com> <197f2d1f-fad5-0400-181f-53cec5336f00@uon.edu.au> Message-ID: AMDG On 2/18/19 9:09 PM, Alex Biddulph wrote: > Not sure what happened there, I must have dirtied my build environment. > > I cleaned everything up and ran it again. Here is the output. > https://drive.google.com/open?id=1u_8KHpjuAC2Cm0jGrVOdGvaqxFtslhNm > The problem is that you are configuring python twice. Please make sure that you only have one `using python` statement in your project-config.jam (or any other configuration file). This is a really obscure failure mode and I'll look into making a better message. You might file a ticket at https://github.com/boostorg/build/ In Christ, Steven Watanabe From c3124185 at uon.edu.au Thu Feb 21 17:31:26 2019 From: c3124185 at uon.edu.au (Alex Biddulph) Date: Thu, 21 Feb 2019 22:31:26 +0000 Subject: [C++-sig] [Boost-build] Boost 1.69 python3 module In-Reply-To: References: <4627ff3d-43e9-ab3b-0ce6-c217751d252b@uon.edu.au> <320fbca7-0340-74f1-3f7e-ae8579493b65@gmail.com> <197f2d1f-fad5-0400-181f-53cec5336f00@uon.edu.au> Message-ID: <6e5cafc0-4373-c125-6601-d997c4c3227b@uon.edu.au> Ok, I played around a bit more. It was indeed configuring python twice. Likely because the bootstrap.sh script adds this bit to project-config.jam # Python configuration import python ; if ! [ python.configured ] { ??? using python : 3.6 : /nubots/toolchain ; } which results in a non-working python configuration due to the incorrectly determined include path "{prefix}/include/python3.6". The correct include path should be "{prefix}/include/python3.6m". This was the root cause of my problem, which is why I added using python : 3.6 : "{prefix}/bin/python3" : "{prefix}/include/python3.6m" : "{prefix}/lib" ; to the end of project-config.jam, hoping it would override the previous configuration and use the correct paths for my installation. Which resulted in this discussion. On 19/2/19 3:24 pm, Steven Watanabe wrote: > AMDG > > On 2/18/19 9:09 PM, Alex Biddulph wrote: >> Not sure what happened there, I must have dirtied my build environment. >> >> I cleaned everything up and ran it again. Here is the output. >> https://drive.google.com/open?id=1u_8KHpjuAC2Cm0jGrVOdGvaqxFtslhNm >> > The problem is that you are configuring python twice. > Please make sure that you only have one `using python` > statement in your project-config.jam (or any other > configuration file). This is a really obscure failure > mode and I'll look into making a better message. You > might file a ticket at https://github.com/boostorg/build/ > > In Christ, > Steven Watanabe From torrin.jones at baesystems.com Thu Feb 28 19:52:56 2019 From: torrin.jones at baesystems.com (Jones, Torrin A (US)) Date: Fri, 1 Mar 2019 00:52:56 +0000 Subject: [C++-sig] Calling python function repr from C++ using boost.python (possible?) Message-ID: <449WC52LTNzndTf@mail.python.org> Is it possible to call repr from C++ on a C++ object that can be converted to python? Let me explain. I have an enum that I converted to python using boost::python::enum_(). That class already provides a good repr() to python (thanks to the boost::python developers for that). However that enum is used as a type on a member in another C++ class that I have where boost::python does not provide a good repr(). So I'm trying to provide one and thought, it sure would be nice if I could just call repr() on the member. I assume I have to convert the value on that member to python first, some kind of way then call repr? Is that possible? Or is there a better way? Example: Typedef enum { V1 = 0, V2 = 5, V3 = 6 } values; Class ValueExample { Public: ValueExample(const values& v) {m_value = v}; Values getValue() const { return m_value }; Private: Values m_value; } Std::string ValueExampleRepr(const ValueExample& object) { Std::stringstream ss; // What do I put here? // Ss << repr(object.getValue()); Return ss::str(); } Boost::python::enum_ values("values"); Values.value("V1", V1); Values.value("V2", V2); Values.value("V3", V3); Boost::python::class_ ValueExample("ValueExample"); ValueExample("__repr__", ValueExampleRepr); -------------- next part -------------- An HTML attachment was scrubbed... URL: