Re: [C++-sig] Building tutorial example out of the boost tree, on Windows

2013-10-07 Thread Gary Oberbrunner
- 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 
___
Cplusplus-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Building tutorial example out of the boost tree, on Windows

2013-10-07 Thread John Reid
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
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] Building tutorial example out of the boost tree, on Windows

2013-10-07 Thread Raghvendra Jain
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
> [email protected]
> https://mail.python.org/mailman/listinfo/cplusplus-sig
>
___
Cplusplus-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Building tutorial example out of the boost tree, on Windows

2013-10-07 Thread Raghvendra Jain
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
> [email protected]
> https://mail.python.org/mailman/listinfo/cplusplus-sig
>
___
Cplusplus-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Building tutorial example out of the boost tree, on Windows

2013-10-07 Thread Gary Oberbrunner


- 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
___
Cplusplus-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] Building tutorial example out of the boost tree, on Windows

2013-10-07 Thread Gary Oberbrunner
- 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 
___
Cplusplus-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Building tutorial example out of the boost tree, on Windows

2013-10-07 Thread Raghvendra Jain
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
> [email protected]
> https://mail.python.org/mailman/listinfo/cplusplus-sig
>
___
Cplusplus-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Building tutorial example out of the boost tree, on Windows

2013-10-07 Thread Gary Oberbrunner
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)) 
___
Cplusplus-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig