From garyo at genarts.com Fri Oct 4 20:12:29 2013 From: garyo at genarts.com (Gary Oberbrunner) Date: Fri, 4 Oct 2013 14:12:29 -0400 (EDT) Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows Message-ID: <1372477591.1555377.1380910349772.JavaMail.root@genarts.com> Hi folks -- new to Boost.Python, old-school C/C++/Python developer. I'm trying to set up Boost.Python 1.54.0 on Windows 7, python 2.7.3, Visual Studio 2010. I installed boost_1_54_0 using the VS10 installer, then built bjam using 'bootstrap; .\b2 toolset=msvc', then copied bjam into my $PATH. I can build and run the quickstart and tutorial examples in the distribution (I had to add some MSVC lib dirs as library-path requirements in Jamroot, but that's OK). But when I copy the tutorial example to a different dir, not inside the boost distribution dir, to make it more like a real project, bjam gives build errors. I changed the use-project boost location in Jamroot to /local/boost_1_54_0/ which is where boost wanted to install itself, and added a simple one-line boost-build.jam (based on something I found online): boost-build C:/local/boost_1_54_0/tools/build/v2 ; but ultimately bjam gives me this error: % bjam notice: no Python configured in user-config.jam notice: will use default configuration C:/local/boost_1_54_0/tools/build/v2/build\project.jam:262: in find-jamfile from module project error: Unable to load Jamfile. error: Could not find a Jamfile in directory '/local/boost_1_54_0'. error: Attempted to find it with pattern '[Bb]uild.jam [Jj]amfile.v2 [Jj]amfile [Jj]amfile.jam'. error: Please consult the documentation at 'http://www.boost.org'. C:/local/boost_1_54_0/tools/build/v2/build\project.jam:280: in load-jamfile from module project C:/local/boost_1_54_0/tools/build/v2/build\project.jam:64: in load from module project C:/local/boost_1_54_0/tools/build/v2/build\project.jam:89: in load-used-projects from module project C:/local/boost_1_54_0/tools/build/v2/build\project.jam:75: in load from module project C:/local/boost_1_54_0/tools/build/v2/build\project.jam:145: in project.find from module project C:/local/boost_1_54_0/tools/build/v2\build-system.jam:535: in load from module build-system C:\local\boost_1_54_0\tools\build\v2/kernel\modules.jam:289: in import from module modules C:\local\boost_1_54_0\tools\build\v2/kernel/bootstrap.jam:139: in boost-build from module C:\tmp\tutorial\boost-build.jam:1: in module scope from module What else do I need to add, or what am I doing wrong? thanks, -- Gary Oberbrunner From wmamrak at gmail.com Sat Oct 5 15:42:27 2013 From: wmamrak at gmail.com (Wojciech Mamrak) Date: Sat, 5 Oct 2013 15:42:27 +0200 Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: <1372477591.1555377.1380910349772.JavaMail.root@genarts.com> References: <1372477591.1555377.1380910349772.JavaMail.root@genarts.com> Message-ID: hi, have you placed user-config.jam in your %HOMEDRIVE%%HOMEPATH% location, and configured Python inside it, e.g. using msvc : 10.0 : : ; using python : 2.7 #version : D:/Python27 # cmd-or-prefix : D:/Libs/Python273/include #includes : D:/Libs/Python273/libs #libraries ; as described here: http://www.boost.org/boost-build2/doc/html/bbv2/reference/tools.html http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html http://www.boost.org/boost-build2/doc/html/bbv2/overview/invocation.html ? regards 2013/10/4 Gary Oberbrunner : > Hi folks -- new to Boost.Python, old-school C/C++/Python developer. > > I'm trying to set up Boost.Python 1.54.0 on Windows 7, python 2.7.3, Visual Studio 2010. I installed boost_1_54_0 using the VS10 installer, then built bjam using 'bootstrap; .\b2 toolset=msvc', then copied bjam into my $PATH. I can build and run the quickstart and tutorial examples in the distribution (I had to add some MSVC lib dirs as library-path requirements in Jamroot, but that's OK). But when I copy the tutorial example to a different dir, not inside the boost distribution dir, to make it more like a real project, bjam gives build errors. I changed the use-project boost location in Jamroot to /local/boost_1_54_0/ which is where boost wanted to install itself, and added a simple one-line boost-build.jam (based on something I found online): > > boost-build C:/local/boost_1_54_0/tools/build/v2 ; > > but ultimately bjam gives me this error: > > % bjam > notice: no Python configured in user-config.jam > notice: will use default configuration > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:262: in find-jamfile from module project > error: Unable to load Jamfile. > error: Could not find a Jamfile in directory '/local/boost_1_54_0'. > error: Attempted to find it with pattern '[Bb]uild.jam [Jj]amfile.v2 [Jj]amfile [Jj]amfile.jam'. > error: Please consult the documentation at 'http://www.boost.org'. > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:280: in load-jamfile from module project > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:64: in load from module project > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:89: in load-used-projects from module project > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:75: in load from module project > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:145: in project.find from module project > C:/local/boost_1_54_0/tools/build/v2\build-system.jam:535: in load from module build-system > C:\local\boost_1_54_0\tools\build\v2/kernel\modules.jam:289: in import from module modules > C:\local\boost_1_54_0\tools\build\v2/kernel/bootstrap.jam:139: in boost-build from module > C:\tmp\tutorial\boost-build.jam:1: in module scope from module > > What else do I need to add, or what am I doing wrong? > > thanks, > > -- Gary Oberbrunner > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig at python.org > https://mail.python.org/mailman/listinfo/cplusplus-sig From raghavendra.jain at gmail.com Sat Oct 5 15:44:53 2013 From: raghavendra.jain at gmail.com (Raghvendra Jain) Date: Sat, 5 Oct 2013 22:44:53 +0900 Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: References: <1372477591.1555377.1380910349772.JavaMail.root@genarts.com> Message-ID: Hi, Placing user-config.jam in your %HOMEDRIVE%%HOMEPATH% location, and configured Python inside it, is very crucial step. I spent like 4 days while trying to build it without following this step. Please see the tutorial with the link below: http://garkavictor.blogspot.jp/2013/09/compiling-boost-and-boostpython-running.html Cheers, Raghav On Sat, Oct 5, 2013 at 10:42 PM, Wojciech Mamrak wrote: > hi, > > have you placed user-config.jam in your %HOMEDRIVE%%HOMEPATH% > location, and configured Python inside it, e.g. > > using msvc : 10.0 : : ; > > using python > : 2.7 #version > : D:/Python27 # cmd-or-prefix > : D:/Libs/Python273/include #includes > : D:/Libs/Python273/libs #libraries > ; > > as described here: > > http://www.boost.org/boost-build2/doc/html/bbv2/reference/tools.html > http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html > http://www.boost.org/boost-build2/doc/html/bbv2/overview/invocation.html > > ? > > regards > > 2013/10/4 Gary Oberbrunner : > > Hi folks -- new to Boost.Python, old-school C/C++/Python developer. > > > > I'm trying to set up Boost.Python 1.54.0 on Windows 7, python 2.7.3, > Visual Studio 2010. I installed boost_1_54_0 using the VS10 installer, then > built bjam using 'bootstrap; .\b2 toolset=msvc', then copied bjam into my > $PATH. I can build and run the quickstart and tutorial examples in the > distribution (I had to add some MSVC lib dirs as library-path requirements > in Jamroot, but that's OK). But when I copy the tutorial example to a > different dir, not inside the boost distribution dir, to make it more like > a real project, bjam gives build errors. I changed the use-project boost > location in Jamroot to /local/boost_1_54_0/ which is where boost wanted to > install itself, and added a simple one-line boost-build.jam (based on > something I found online): > > > > boost-build C:/local/boost_1_54_0/tools/build/v2 ; > > > > but ultimately bjam gives me this error: > > > > % bjam > > notice: no Python configured in user-config.jam > > notice: will use default configuration > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:262: in > find-jamfile from module project > > error: Unable to load Jamfile. > > error: Could not find a Jamfile in directory '/local/boost_1_54_0'. > > error: Attempted to find it with pattern '[Bb]uild.jam [Jj]amfile.v2 > [Jj]amfile [Jj]amfile.jam'. > > error: Please consult the documentation at 'http://www.boost.org'. > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:280: in > load-jamfile from module project > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:64: in load from > module project > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:89: in > load-used-projects from module project > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:75: in load from > module project > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:145: in > project.find from module project > > C:/local/boost_1_54_0/tools/build/v2\build-system.jam:535: in load from > module build-system > > C:\local\boost_1_54_0\tools\build\v2/kernel\modules.jam:289: in import > from module modules > > C:\local\boost_1_54_0\tools\build\v2/kernel/bootstrap.jam:139: in > boost-build from module > > C:\tmp\tutorial\boost-build.jam:1: in module scope from module > > > > What else do I need to add, or what am I doing wrong? > > > > thanks, > > > > -- Gary Oberbrunner > > _______________________________________________ > > Cplusplus-sig mailing list > > Cplusplus-sig at python.org > > https://mail.python.org/mailman/listinfo/cplusplus-sig > _______________________________________________ > 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: From garyo at genarts.com Sat Oct 5 21:22:02 2013 From: garyo at genarts.com (Gary Oberbrunner) Date: Sat, 5 Oct 2013 15:22:02 -0400 (EDT) Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: Message-ID: <1067527508.1578688.1381000922469.JavaMail.root@genarts.com> (Hope top-posting is OK on this list, sorry if not) Thanks -- I had not seen those doc links before. I tried your user-config.jam (updated for my config), and bjam does find it, but still fails to find a Jamfile for the tutorial example. I wonder if there is some problem with the Windows boost installer (exe); maybe I should build boost from source? NOISE (/tmp/tutorial) 3:11PM 459=> % bjam --debug-configuration notice: found boost-build.jam at C:/tmp/tutorial/boost-build.jam notice: loading Boost.Build from C:/local/boost_1_54_0/tools/build/v2 notice: Searching 'H:\' 'c:\Users\garyo' 'C:\Users\garyo' 'C:/local/boost_1_54_0/tools/build/v2' 'C:/local/boost_1_54_0/tools/build/v2/kernel' 'C:/local/boost_1_54_0/tools/build/v2/util' 'C:/local/boost_1_54_0/tools/build/v2/build' 'C:/local/boost_1_54_0/tools/build/v2/tools' 'C:/local/boost_1_54_0/tools/build/v2/contrib' 'C:/local/boost_1_54_0/tools/build/v2/.' for site-config configuration file 'site-config.jam'. notice: Loading site-config configuration file 'site-config.jam' from 'C:/local/boost_1_54_0/tools/build/v2'. notice: Searching 'H:\' 'c:\Users\garyo' 'C:\Users\garyo' 'C:/local/boost_1_54_0/tools/build/v2' 'C:/local/boost_1_54_0/tools/build/v2/kernel' 'C:/local/boost_1_54_0/tools/build/v2/util' 'C:/local/boost_1_54_0/tools/build/v2/build' 'C:/local/boost_1_54_0/tools/build/v2/tools' 'C:/local/boost_1_54_0/tools/build/v2/contrib' 'C:/local/boost_1_54_0/tools/build/v2/.' for user-config configuration file 'user-config.jam'. notice: Loading user-config configuration file 'user-config.jam' from 'H:/'. notice: [msvc-cfg] msvc-10.0 detected, command: 'C:\Program Files (x86)\microsoft visual studio 10.0\vc\bin\cl.exe' notice: will use 'C:\Program Files (x86)\microsoft visual studio 10.0\vc\bin\cl.exe' for msvc, condition msvc-10.0 ... notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "2.7" notice: [python-cfg] user-specified cmd-or-prefix: "C:/Python27" notice: [python-cfg] user-specified includes: "C:/Python27/include" notice: [python-cfg] user-specified libraries: "C:/Python27/libs" notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\" ... notice: [python-cfg] running command 'C:/Python27\python -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: "C:/Python27\python" notice: [python-cfg] include path: "C:/Python27/include" notice: [python-cfg] library path: "C:/Python27/libs" notice: [python-cfg] DLL search path: "C:\Python27" C:/local/boost_1_54_0/tools/build/v2/build\project.jam:262: in find-jamfile from module project error: Unable to load Jamfile. error: Could not find a Jamfile in directory '/local/boost_1_54_0'. error: Attempted to find it with pattern '[Bb]uild.jam [Jj]amfile.v2 [Jj]amfile [Jj]amfile.jam'. I notice that the Jamroot in the tutorial example has this: # Specify the path to the Boost project. If you move this project, # adjust this path to refer to the Boost root directory. use-project boost : /local/boost_1_54_0 ; if I modify that dirname, the error refers to a different dir. And there is no Jamfile in that dir. Thanks for all your help; -- Gary ----- Original Message ----- > From: "Wojciech Mamrak" > To: "Development of Python/C++ integration" > Sent: Saturday, October 5, 2013 9:42:27 AM > Subject: Re: [C++-sig] Building tutorial example out of the boost tree, on Windows > > hi, > > have you placed user-config.jam in your %HOMEDRIVE%%HOMEPATH% > location, and configured Python inside it, e.g. > > using msvc : 10.0 : : ; > > using python > : 2.7 #version > : D:/Python27 # cmd-or-prefix > : D:/Libs/Python273/include #includes > : D:/Libs/Python273/libs #libraries > ; > > as described here: > > http://www.boost.org/boost-build2/doc/html/bbv2/reference/tools.html > http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html > http://www.boost.org/boost-build2/doc/html/bbv2/overview/invocation.html > > ? > > regards > > 2013/10/4 Gary Oberbrunner : > > Hi folks -- new to Boost.Python, old-school C/C++/Python developer. > > > > I'm trying to set up Boost.Python 1.54.0 on Windows 7, python > > 2.7.3, Visual Studio 2010. I installed boost_1_54_0 using the VS10 > > installer, then built bjam using 'bootstrap; .\b2 toolset=msvc', > > then copied bjam into my $PATH. I can build and run the > > quickstart and tutorial examples in the distribution (I had to add > > some MSVC lib dirs as library-path requirements in Jamroot, but > > that's OK). But when I copy the tutorial example to a different > > dir, not inside the boost distribution dir, to make it more like a > > real project, bjam gives build errors. I changed the use-project > > boost location in Jamroot to /local/boost_1_54_0/ which is where > > boost wanted to install itself, and added a simple one-line > > boost-build.jam (based on something I found online): > > > > boost-build C:/local/boost_1_54_0/tools/build/v2 ; > > > > but ultimately bjam gives me this error: > > > > % bjam > > notice: no Python configured in user-config.jam > > notice: will use default configuration > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:262: in > > find-jamfile from module project > > error: Unable to load Jamfile. > > error: Could not find a Jamfile in directory '/local/boost_1_54_0'. > > error: Attempted to find it with pattern '[Bb]uild.jam > > [Jj]amfile.v2 [Jj]amfile [Jj]amfile.jam'. > > error: Please consult the documentation at 'http://www.boost.org'. > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:280: in > > load-jamfile from module project > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:64: in load > > from module project > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:89: in > > load-used-projects from module project > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:75: in load > > from module project > > C:/local/boost_1_54_0/tools/build/v2/build\project.jam:145: in > > project.find from module project > > C:/local/boost_1_54_0/tools/build/v2\build-system.jam:535: in load > > from module build-system > > C:\local\boost_1_54_0\tools\build\v2/kernel\modules.jam:289: in > > import from module modules > > C:\local\boost_1_54_0\tools\build\v2/kernel/bootstrap.jam:139: in > > boost-build from module > > C:\tmp\tutorial\boost-build.jam:1: in module scope from module > > > > What else do I need to add, or what am I doing wrong? > > > > thanks, > > > > -- Gary Oberbrunner > > _______________________________________________ > > Cplusplus-sig mailing list > > Cplusplus-sig at python.org > > https://mail.python.org/mailman/listinfo/cplusplus-sig > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig at python.org > https://mail.python.org/mailman/listinfo/cplusplus-sig > -- Gary Oberbrunner From garyo at genarts.com Mon Oct 7 16:47:39 2013 From: garyo at genarts.com (Gary Oberbrunner) Date: Mon, 7 Oct 2013 10:47:39 -0400 (EDT) Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: Message-ID: <2087767980.1629296.1381157259669.JavaMail.root@genarts.com> ----- Original Message ----- > From: "Raghvendra Jain" > To: "Development of Python/C++ integration" > > Sent: Saturday, October 5, 2013 9:44:53 AM > Subject: Re: [C++-sig] Building tutorial example out of the boost > tree, on Windows > Hi, > Placing user-config.jam in your %HOMEDRIVE%%HOMEPATH% location, and > configured Python inside it, is very crucial step. > I spent like 4 days while trying to build it without following this > step. > Please see the tutorial with the link below: > http://garkavictor.blogspot.jp/2013/09/compiling-boost-and-boostpython-running.html Hi Raghav; thanks for that link. In there, he does not use bjam to build the python extension dll; he creates a Visual Studio project and does it there. Is that the recommended method now? I thought I saw somewhere it is recommended to use bjam and most newbie questions come from not doing that. In any case, I can use bjam to build and test the tutorial example when it's inside the boost tree, but not when I move it outside -- I feel like I must be missing something simple. -- Gary Oberbrunner -------------- next part -------------- An HTML attachment was scrubbed... URL: From raghavendra.jain at gmail.com Mon Oct 7 16:52:39 2013 From: raghavendra.jain at gmail.com (Raghvendra Jain) Date: Mon, 7 Oct 2013 23:52:39 +0900 Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: <2087767980.1629296.1381157259669.JavaMail.root@genarts.com> References: <2087767980.1629296.1381157259669.JavaMail.root@genarts.com> Message-ID: Hi Gary, You can forget bjam. Just use b2 as written there in tutorial. Just an additional comment, even if you are using x64 bit architecture, you dont have to install 64 bit Python and 64 bit compiler for Visual studio. Even if you use 32 bit Python and 32 bit Visual Studio C++ compiler, it will work fine. These instructions were written by my colleague and we worked together on that, so please feel free to post some question if it doesn't work. Cheers Raghav On Mon, Oct 7, 2013 at 11:47 PM, Gary Oberbrunner wrote: > > > ------------------------------ > > *From: *"Raghvendra Jain" > > *To: *"Development of Python/C++ integration" > *Sent: *Saturday, October 5, 2013 9:44:53 AM > > *Subject: *Re: [C++-sig] Building tutorial example out of the boost > tree, on Windows > > Hi, > > Placing user-config.jam in your %HOMEDRIVE%%HOMEPATH% > location, and configured Python inside it, is very crucial step. > > I spent like 4 days while trying to build it without following this step. > Please see the tutorial with the link below: > > > > http://garkavictor.blogspot.jp/2013/09/compiling-boost-and-boostpython-running.html > > Hi Raghav; thanks for that link. In there, he does not use bjam to build > the python extension dll; he creates a Visual Studio project and does it > there. Is that the recommended method now? I thought I saw somewhere it > is recommended to use bjam and most newbie questions come from not doing > that. > > In any case, I can use bjam to build and test the tutorial example when > it's inside the boost tree, but not when I move it outside -- I feel like I > must be missing something simple. > > -- > Gary Oberbrunner > > _______________________________________________ > 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: From j.reid at mail.cryst.bbk.ac.uk Mon Oct 7 16:53:10 2013 From: j.reid at mail.cryst.bbk.ac.uk (John Reid) Date: Mon, 07 Oct 2013 15:53:10 +0100 Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: <1372477591.1555377.1380910349772.JavaMail.root@genarts.com> References: <1372477591.1555377.1380910349772.JavaMail.root@genarts.com> Message-ID: On 04/10/13 19:12, Gary Oberbrunner wrote: > Hi folks -- new to Boost.Python, old-school C/C++/Python developer. > > I'm trying to set up Boost.Python 1.54.0 on Windows 7, python 2.7.3, Visual Studio 2010. I installed boost_1_54_0 using the VS10 installer, then built bjam using 'bootstrap; .\b2 toolset=msvc', then copied bjam into my $PATH. I can build and run the quickstart and tutorial examples in the distribution (I had to add some MSVC lib dirs as library-path requirements in Jamroot, but that's OK). But when I copy the tutorial example to a different dir, not inside the boost distribution dir, to make it more like a real project, bjam gives build errors. I changed the use-project boost location in Jamroot to /local/boost_1_54_0/ which is where boost wanted to install itself, and added a simple one-line boost-build.jam (based on something I found online): Have you tried pointing the use-project boost to the boost source directory rather than the boost installation directory? I don't think boost installs the projects, just headers and libraries. From raghavendra.jain at gmail.com Mon Oct 7 16:58:45 2013 From: raghavendra.jain at gmail.com (Raghvendra Jain) Date: Mon, 7 Oct 2013 23:58:45 +0900 Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: References: <1372477591.1555377.1380910349772.JavaMail.root@genarts.com> Message-ID: Regarding your question, about building dll file, if you mean by boost_python-vc110-mt-gd-1_54.dll this dll (along with other dll and lib files) are generated after using build with b2. You just need to place it in your output directory in Debug folder. On Mon, Oct 7, 2013 at 11:53 PM, John Reid wrote: > On 04/10/13 19:12, Gary Oberbrunner wrote: > > Hi folks -- new to Boost.Python, old-school C/C++/Python developer. > > > > I'm trying to set up Boost.Python 1.54.0 on Windows 7, python 2.7.3, > Visual Studio 2010. I installed boost_1_54_0 using the VS10 installer, then > built bjam using 'bootstrap; .\b2 toolset=msvc', then copied bjam into my > $PATH. I can build and run the quickstart and tutorial examples in the > distribution (I had to add some MSVC lib dirs as library-path requirements > in Jamroot, but that's OK). But when I copy the tutorial example to a > different dir, not inside the boost distribution dir, to make it more like > a real project, bjam gives build errors. I changed the use-project boost > location in Jamroot to /local/boost_1_54_0/ which is where boost wanted to > install itself, and added a simple one-line boost-build.jam (based on > something I found online): > > Have you tried pointing the use-project boost to the boost source > directory rather than the boost installation directory? I don't think > boost installs the projects, just headers and libraries. > > _______________________________________________ > 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: From garyo at genarts.com Mon Oct 7 17:21:29 2013 From: garyo at genarts.com (Gary Oberbrunner) Date: Mon, 7 Oct 2013 11:21:29 -0400 (EDT) Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: Message-ID: <1458532525.1631783.1381159289594.JavaMail.root@genarts.com> ----- Original Message ----- > From: "John Reid" ... > Have you tried pointing the use-project boost to the boost source > directory rather than the boost installation directory? I don't think > boost installs the projects, just headers and libraries. I installed Boost using the Windows installer from http://softlayer-dal.dl.sourceforge.net/project/boost/boost-binaries/1.54.0/boost_1_54_0-msvc-10.0-64.exe; maybe that didn't come with source or something? It only created \local\boost_1_54_0. After running that installer I did still have to do the bootstrap; .\b2 toolset=msvc thing to get bjam. And now that I look at that download URL, what Raghav says about using a 32-bit version might be more sensible; my python is stock 2.7.3 Windows 32-bit (not cygwin or anything weird) and I'm only looking to build extensions for a 32-bit python at this point. I did download the source distribution, but it doesn't have a Jamfile in its root dir either. Maybe I have to unpack it and run b2 to get that... I guess I'll try that next. -- Gary Oberbrunner From garyo at genarts.com Mon Oct 7 17:35:02 2013 From: garyo at genarts.com (Gary Oberbrunner) Date: Mon, 7 Oct 2013 11:35:02 -0400 (EDT) Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: Message-ID: <787490154.1632251.1381160102746.JavaMail.root@genarts.com> ----- Original Message ----- > From: "Raghvendra Jain" > To: "Development of Python/C++ integration" > > Sent: Monday, October 7, 2013 10:58:45 AM > Subject: Re: [C++-sig] Building tutorial example out of the boost > tree, on Windows > Regarding your question, about building dll file, if you mean by > boost_python-vc110-mt-gd-1_54.dll > this dll (along with other dll and lib files) are generated after > using build with b2. You just need to place it in your output > directory in Debug folder. Hi Raghav; no, I seem to have that dll. I meant the dll that results from building the extension project itself -- I guess it's actually a .pyd; sorry for the confusion. Your link at garkavictor says to ignore bjam and b2 and just make a Visual Studio project to build the extension; I guess I will also try that next. (I am one of the maintainers of SCons, the python-based build tool; if I can make it build under VS I can probably also make it build under SCons, which would be cool.) Actually now that I am looking closely at your blog post, it is for going the other way ("embedding" rather than "extending") but I guess extending is similar, just make a DLL project and rename the output or something maybe? -- Gary Oberbrunner -------------- next part -------------- An HTML attachment was scrubbed... URL: From raghavendra.jain at gmail.com Mon Oct 7 17:40:16 2013 From: raghavendra.jain at gmail.com (Raghvendra Jain) Date: Tue, 8 Oct 2013 00:40:16 +0900 Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: <787490154.1632251.1381160102746.JavaMail.root@genarts.com> References: <787490154.1632251.1381160102746.JavaMail.root@genarts.com> Message-ID: I recommend you better use the source rather than some pre-compiled binaries. I tried binaries and I had failed. I use Python 2.7.3 and VS 2008. Actually Victor and I, we tried only for embedding since this was our need. But extending should not be any different ( my guess)...please write back when it works ( or doesn't) .. On Tue, Oct 8, 2013 at 12:35 AM, Gary Oberbrunner wrote: > > > ------------------------------ > > *From: *"Raghvendra Jain" > *To: *"Development of Python/C++ integration" > *Sent: *Monday, October 7, 2013 10:58:45 AM > > *Subject: *Re: [C++-sig] Building tutorial example out of the boost > tree, on Windows > > Regarding your question, about building dll file, if you mean by > boost_python-vc110-mt-gd-1_54.dll > this dll (along with other dll and lib files) are generated after using > build with b2. You just need to place it in your output directory in Debug > folder. > > Hi Raghav; no, I seem to have that dll. I meant the dll that results from > building the extension project itself -- I guess it's actually a .pyd; > sorry for the confusion. > > Your link at garkavictor says to ignore bjam and b2 and just make a Visual > Studio project to build the extension; I guess I will also try that next. > (I am one of the maintainers of SCons, the python-based build tool; if I > can make it build under VS I can probably also make it build under SCons, > which would be cool.) > > Actually now that I am looking closely at your blog post, it is for going > the other way ("embedding" rather than "extending") but I guess extending > is similar, just make a DLL project and rename the output or something > maybe? > > -- > Gary Oberbrunner > > _______________________________________________ > 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: From garyo at genarts.com Mon Oct 7 23:44:48 2013 From: garyo at genarts.com (Gary Oberbrunner) Date: Mon, 7 Oct 2013 17:44:48 -0400 (EDT) Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: <787490154.1632251.1381160102746.JavaMail.root@genarts.com> Message-ID: <223254110.1646033.1381182288328.JavaMail.root@genarts.com> SCons FTW! :-) I built from source and tried it all again with bjam; no luck, same problems. So I figured, how hard can it be, it's just a DLL after all (renamed to .pyd). And sure enough it's not that hard. Here's a SConstruct that builds the tutorial example, wherever it is (does not have to be in the boost tree). I'm sure this could be generalized, but it's good enough for me as is. # SConstruct for building boost python tutorial example import os boost_python_lib = 'boost_python-vc100-gd-1_54' boost_top = 'c:/boost' python_top = 'c:/python27' env=Environment(TARGET_ARCH='x86', CCFLAGS=['/MDd', '/DEBUG'], CPPPATH=[os.path.join(boost_top,'include/boost-1_54'), os.path.join(python_top, 'include')], LIBPATH=[os.path.join(boost_top, 'lib/i386'), os.path.join(python_top, 'libs')]) dll=env.SharedLibrary('hello_ext', 'hello.cpp', LIBS=boost_python_lib) env.InstallAs('hello_ext.pyd', dll[0]) # Copy the boost python lib into this dir so hello_ext will find it at runtime env.Install('.', os.path.join(boost_top, 'lib/i386', '%s.dll'%boost_python_lib)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From garyo at genarts.com Tue Oct 8 21:48:48 2013 From: garyo at genarts.com (Gary Oberbrunner) Date: Tue, 8 Oct 2013 15:48:48 -0400 (EDT) Subject: [C++-sig] pyplusplus question: 2d char arrays Message-ID: <145099822.1677750.1381261728182.JavaMail.root@genarts.com> Sorry if this is the wrong forum for pyplusplus questions; please feel free to tell me to post elsewhere if that's appropriate. I have this legacy struct in foo.h that is used by some code I'd like to wrap: struct S { char name[128]; char input_names[8][12]; }; If I run pyplusplus on it (cool tool, by the way), it generates a file called __array_1.pypp.hpp with a struct array_1_t in it. It uses that for input_names above, as here in the generated bindings.cpp: static pyplusplus::containers::static_sized::array_1_t< char[12], 8> pyplusplus_input_names_wrapper( ::S & inst ){ return pyplusplus::containers::static_sized::array_1_t< char[12], 8>( inst.input_names ); } But the Windows compiler (Visual Studio 2010) won't compile that code: cl /Fobindings-tmp.obj /c bindings-tmp.cpp /TP /MDd /DEBUG /EHsc /DPYTHON_EXT /IC:\genarts\sapphire /IC:\boost\include\boost-1_54 /IC:\python27\include Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 bindings-tmp.cpp /tmp/__array_1.pypp.hpp(122) : error C2440: '=' : cannot convert from 'const char *const ' to 'char [12]' There are no conversions to array types, although there are conversions to references or pointers to arrays /tmp/__array_1.pypp.hpp(120) : while compiling class template member function 'void pyplusplus::containers::static_sized::array_1_t::set_item(unsigned long,const char *const )' with [ TItemType=char [12], size=8 ] bindings-tmp.cpp(26) : see reference to class template instantiation 'pyplusplus::containers::static_sized::array_1_t' The code in question is in the generated __array_1.pypp.hpp, abbreviated here: template< class TItemType, long unsigned int size > struct array_1_t{ typedef BOOST_DEDUCED_TYPENAME boost::call_traits::param_type param_type; typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c< details::is_immutable::value , TItemType , param_type >::type reference_type; ... void set_item( long unsigned int index, reference_type new_value ){ raise_on_out_of_range( size, index ); m_data[index] = new_value; <<<<<<<<<<<<<<<<<<<<< COMPILE ERROR HERE } So that kind of makes sense. It doesn't make sense to pass a char[12] array into set_item and expect it to populate an element of m_data. What should I do about this? It turns out I don't really care about exporting that particular field to python; can I tell pyplusplus to ignore it somehow? That struct does get used lots of other places though, if that matters. -- . . . . . . . . . . . . . . . . . . . . . . Gary Oberbrunner garyo at genarts.com VP Engineering Tel: 617-492-2888 GenArts, Inc. www.genarts.com From j.reid at mail.cryst.bbk.ac.uk Wed Oct 9 10:53:53 2013 From: j.reid at mail.cryst.bbk.ac.uk (John Reid) Date: Wed, 09 Oct 2013 09:53:53 +0100 Subject: [C++-sig] Building tutorial example out of the boost tree, on Windows In-Reply-To: <1458532525.1631783.1381159289594.JavaMail.root@genarts.com> References: <1458532525.1631783.1381159289594.JavaMail.root@genarts.com> Message-ID: On 07/10/13 16:21, Gary Oberbrunner wrote: > > > ----- Original Message ----- >> From: "John Reid" > ... >> Have you tried pointing the use-project boost to the boost source >> directory rather than the boost installation directory? I don't think >> boost installs the projects, just headers and libraries. > > I installed Boost using the Windows installer from http://softlayer-dal.dl.sourceforge.net/project/boost/boost-binaries/1.54.0/boost_1_54_0-msvc-10.0-64.exe; maybe that didn't come with source or something? It only created \local\boost_1_54_0. After running that installer I did still have to do the > bootstrap; .\b2 toolset=msvc > thing to get bjam. > > And now that I look at that download URL, what Raghav says about using a 32-bit version might be more sensible; my python is stock 2.7.3 Windows 32-bit (not cygwin or anything weird) and I'm only looking to build extensions for a 32-bit python at this point. > > I did download the source distribution, but it doesn't have a Jamfile in its root dir either. Maybe I have to unpack it and run b2 to get that... I guess I'll try that next. > I've always found that the easiest way but then I haven't used Windows for some time now. From garyo at genarts.com Fri Oct 18 16:14:48 2013 From: garyo at genarts.com (Gary Oberbrunner) Date: Fri, 18 Oct 2013 10:14:48 -0400 (EDT) Subject: [C++-sig] exporting const array members In-Reply-To: <32015202.2294408.1382104945847.JavaMail.root@genarts.com> Message-ID: <1073835137.2294551.1382105688317.JavaMail.root@genarts.com> Hi folks; I hope someone can help with a problem I'm having. I have Base and Other classes (sorry for the generic names), and Base contains a fixed-length const array of pointers to Others. I'm trying to expose Base to python. I started with a pyplusplus run and hand-massaged the result, so it uses the autogenerated __array_1.pypp.hpp. I've included my entire code, including my classes and the boost.python wrappers. The problem is that boost.python fails to wrap the "others" member variable of Base; it ends up trying to cast an Other *const to an Other *. At the end, I'll include the whole error message. It seems like it doesn't propagate the constness through pytype_function, but I don't know enough boost to be sure of that. (This is on Windows 7, MSVC 10, boost 1.54.) (I can't change the structure of the Base or Other classes much; they're from a larger system.) Thanks in advance! Code: ===================== // Classes to expose struct Other { int dummy; }; struct Base { struct Other * const others[49]; Base() : others() { }; }; // Boost.Python stuff #include #include #include #include #include #include "__array_1.pypp.hpp" namespace bp = boost::python; struct Base_wrapper : Base, bp::wrapper< Base > { Base_wrapper(Base const & arg ) : Base( arg ) , bp::wrapper< Base >(){ // copy constructor } Base_wrapper() : Base() , bp::wrapper< Base >(){ // null constructor } static pyplusplus::containers::static_sized::const_array_1_t< ::Other * const, 49> pyplusplus_others_wrapper( ::Base & inst ){ return pyplusplus::containers::static_sized::const_array_1_t< ::Other * const, 49>( inst.others ); } }; BOOST_PYTHON_MODULE(foo) { using namespace bp; { //::Base typedef bp::class_< Base_wrapper > Base_exposer_t; Base_exposer_t Base_exposer = Base_exposer_t( "Base" ); bp::scope Base_scope( Base_exposer ); pyplusplus::containers::static_sized::register_const_array_1< ::Other * const, 49, bp::return_internal_reference< > >( "__array_1__scope_other_const__ptr__49" ); { //Base::others [variable], type=Other * const[49] typedef pyplusplus::containers::static_sized::const_array_1_t< ::Other * const, 49> ( *array_wrapper_creator )( ::Base & ); Base_exposer.add_property( "others" , bp::make_function( array_wrapper_creator(&Base_wrapper::pyplusplus_others_wrapper) , bp::with_custodian_and_ward_postcall< 0, 1 >() ) ); } } } ===================== Error message: ===================== foo.cxx(11) : warning C4351: new behavior: elements of array 'Base::others' will be default initialized C:\boost\include\boost-1_54\boost/python/detail/unwind_type.hpp(165) : error C2664: 'boost::python::converter::detail::unwind_type_id_helper::result_type boost::python::detail::unwind_helper2<1>::execute(U *(__cdecl *)(void),Generator *)' : cannot convert parameter 1 from 'Other *const (__cdecl *)(void)' to 'Other *(__cdecl *)(void)' with [ Generator=boost::python::converter::detail::unwind_type_id_helper, U=Other ] This conversion requires a reinterpret_cast, a C-style cast or function-style cast C:\boost\include\boost-1_54\boost/python/converter/pytype_function.hpp(45) : see reference to function template instantiation 'boost::python::converter::detail::unwind_type_id_helper::result_type boost::python::detail::unwind_type(boost::type *,Generator *)' being compiled with [ T=Other *const , Generator=boost::python::converter::detail::unwind_type_id_helper ] C:\boost\include\boost-1_54\boost/python/converter/pytype_function.hpp(67) : see reference to function template instantiation 'boost::python::type_info boost::python::converter::detail::unwind_type_id_(boost::type *,boost::mpl::false_ *)' being compiled with [ T=Other *const ] C:\boost\include\boost-1_54\boost/python/converter/pytype_function.hpp(65) : while compiling class template member function 'const PyTypeObject *boost::python::converter::expected_pytype_for_arg::get_pytype(void)' with [ T=Other *const ] C:\boost\include\boost-1_54\boost/preprocessor/iteration/detail/local.hpp(34) : see reference to class template instantiation 'boost::python::converter::expected_pytype_for_arg' being compiled with [ T=Other *const ] C:\boost\include\boost-1_54\boost/python/detail/signature.hpp(76) : while compiling class template member function 'const boost::python::detail::signature_element *boost::python::detail::signature_arity<2>::impl::elements(void)' with [ Sig=boost::mpl::vector3 &,unsigned long> ] C:\boost\include\boost-1_54\boost/python/detail/signature.hpp(58) : see reference to class template instantiation 'boost::python::detail::signature_arity<2>::impl' being compiled with [ Sig=boost::mpl::vector3 &,unsigned long> ] C:\boost\include\boost-1_54\boost/python/detail/caller.hpp(232) : see reference to class template instantiation 'boost::python::detail::signature' being compiled with [ Sig=boost::mpl::vector3 &,unsigned long> ] C:\boost\include\boost-1_54\boost/python/detail/caller.hpp(231) : while compiling class template member function 'boost::python::detail::py_func_sig_info boost::python::detail::caller_arity<2>::impl::signature(void)' with [ F=Other *const (__thiscall pyplusplus::containers::static_sized::const_array_1_t::* )(unsigned long) const, Policies=boost::python::return_internal_reference<>, Sig=boost::mpl::vector3 &,unsigned long> ] C:\boost\include\boost-1_54\boost/python/detail/caller.hpp(169) : see reference to class template instantiation 'boost::python::detail::caller_arity<2>::impl' being compiled with [ F=Other *const (__thiscall pyplusplus::containers::static_sized::const_array_1_t::* )(unsigned long) const, Policies=boost::python::return_internal_reference<>, Sig=boost::mpl::vector3 &,unsigned long> ] C:\boost\include\boost-1_54\boost/python/make_function.hpp(61) : see reference to class template instantiation 'boost::python::detail::caller' being compiled with [ F=Other *const (__thiscall pyplusplus::containers::static_sized::const_array_1_t::* )(unsigned long) const, CallPolicies=boost::python::return_internal_reference<>, Sig=boost::mpl::vector3 &,unsigned long> ] C:\boost\include\boost-1_54\boost/python/make_function.hpp(146) : see reference to function template instantiation 'boost::python::api::object boost::python::detail::make_function_aux>(F,const CallPolicies &,const Sig &,const boost::python::detail::keyword_range &,NumKeywords)' being compiled with [ F=Other *const (__thiscall pyplusplus::containers::static_sized::const_array_1_t::* )(unsigned long) const, CallPolicies=boost::python::return_internal_reference<>, Signature=boost::mpl::vector3 &,unsigned long>, N=1, Sig=boost::mpl::vector3 &,unsigned long>, NumKeywords=boost::mpl::int_<1> ] C:\boost\include\boost-1_54\boost/python/class.hpp(545) : see reference to function template instantiation 'boost::python::api::object boost::python::make_function &,unsigned long>>(F,const CallPolicies &,const Keywords &,const Signature &)' being compiled with [ Fn=Other *const (__thiscall pyplusplus::containers::static_sized::const_array_1_t::* )(unsigned long) const, T2=boost::python::return_internal_reference<>, T1=boost::python::detail::keywords<1>, T0=Other *const , TItemType=Other *const , size=49, F=Other *const (__thiscall pyplusplus::containers::static_sized::const_array_1_t::* )(unsigned long) const, CallPolicies=boost::python::return_internal_reference<>, Keywords=boost::python::detail::keywords<1>, Signature=boost::mpl::vector3 &,unsigned long> ] C:\boost\include\boost-1_54\boost/python/class.hpp(260) : see reference to function template instantiation 'void boost::python::class_::def_impl,Fn,boost::python::detail::def_helper>(T *,const char *,Fn,const Helper &,...)' being compiled with [ W=wrapper_t, TItemType=Other *const , size=49, Fn=Other *const (__thiscall pyplusplus::containers::static_sized::const_array_1_t::* )(unsigned long) const, T1=boost::python::detail::keywords<1>, T2=boost::python::return_internal_reference<>, T=pyplusplus::containers::static_sized::const_array_1_t, Helper=boost::python::detail::def_helper,boost::python::return_internal_reference<>> ] c:\tmp\__array_1.pypp.hpp(143) : see reference to function template instantiation 'boost::python::class_ &boost::python::class_::def::* )(unsigned long) const,boost::python::detail::keywords<1>,boost::python::return_internal_reference<>>(const char *,Fn,const A1 &,const A2 &)' being compiled with [ W=wrapper_t, TItemType=Other *const , size=49, Fn=Other *const (__thiscall pyplusplus::containers::static_sized::const_array_1_t::* )(unsigned long) const, A1=boost::python::detail::keywords<1>, A2=boost::python::return_internal_reference<> ] c:\tmp\__array_1.pypp.hpp(135) : while compiling class template member function 'pyplusplus::containers::static_sized::register_const_array_1::register_const_array_1(const char *)' with [ TItemType=Other *const , size=49, CallPolicies=boost::python::return_internal_reference<> ] foo.cxx(59) : see reference to class template instantiation 'pyplusplus::containers::static_sized::register_const_array_1' being compiled with [ TItemType=Other *const , size=49, CallPolicies=boost::python::return_internal_reference<> ] ===================== -- Gary From aeternitas007 at gmail.com Sat Oct 19 13:50:16 2013 From: aeternitas007 at gmail.com (Nitas Aeter) Date: Sat, 19 Oct 2013 19:50:16 +0800 Subject: [C++-sig] V2 windows build problems update Message-ID: fatal error LNK1104: can not open ?libmmdd.lib? Can you help me ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nat at lindenlab.com Sun Oct 20 17:15:34 2013 From: nat at lindenlab.com (Nat Goodspeed) Date: Sun, 20 Oct 2013 08:15:34 -0700 Subject: [C++-sig] V2 windows build problems update In-Reply-To: References: Message-ID: On Sat, Oct 19, 2013 at 4:50 AM, Nitas Aeter wrote: fatal error LNK1104: can not open ?libmmdd.lib? > > Can you help me ? > Wow, that's really not a lot to go on. Usually the mailing list would at least want to know what you're trying to do, what versions of the OS and compiler you're using and what specific command lines you executed -- plus a small, self-contained source file that demonstrates the problem. I have just one thing to say about LNK1104. While building our own software, I have encountered so many spurious LNK1104 errors that I've concluded it must be primarily due to Windows 7 failing to release file locks soon enough after program termination. I finally got fed up and coded a retry loop into the script with which I run builds. When the failure output contains "LNK1104," my script emits a message and reruns the build command line. Usually that succeeds. I may have an unusual Windows development environment. Certainly the scripts we run on our build farm don't include automated retries, and yet somehow we manage to produce Windows executables. I do have the impression that our buildmeister manually reruns many Windows builds; I couldn't tell you whether LNK1104 is the chief culprit. So in the complete absence of any other actionable information, my only advice is: try running your build again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From garyo at genarts.com Thu Oct 24 16:54:55 2013 From: garyo at genarts.com (Gary Oberbrunner) Date: Thu, 24 Oct 2013 10:54:55 -0400 (EDT) Subject: [C++-sig] ArgumentError storing and retrieving pointer in class: wrong type In-Reply-To: <952684176.2469376.1382625944605.JavaMail.root@genarts.com> Message-ID: <1075241311.2469541.1382626495347.JavaMail.root@genarts.com> I recently posted an issue on StackOverflow about some Py++-generated code that didn't seem to work. The question is at http://stackoverflow.com/questions/19461274/. Simply, I have these classes: struct classA { int intval; unsigned int bitfield_member:1; }; struct Collection { classA * class_a_ptr; }; and Py++ generates a wrapper for classA, and setter/getters for bitfield_member, but the problem seems to be that the getter for class_a_ptr (get_class_a_ptr) returns a classA *, not a classA_wrapper *, and that doesn't have the bitfield_member accessors, so doing this in python fails at runtime: coll=Collection() g = classA() coll.class_a_ptr = g print coll.class_a_ptr.bitfield_member <-- fails with ArgumentError, wrong type The solution suggested in the SO question is to change the generated bitfield_member setter/getter to take an explicit classA * as "this". My solution instead was to change get_class_a_ptr to return a classA_wrapper *, since it has the same data layout as classA. (The answer in the SO article would be hard for me, since in my real case classA has hundreds of members and I'd rather not hand-edit them all.) Either way, it seems py++ generates non-working code for this example. See the SO question for complete details. Roman, if you're reading this, I presume this is the best way to submit these kinds of issues? I'm happy to post a bug report elsewhere if that's appropriate. Thanks; -- Gary