Python.Boost + Python2.7 + VS2008 issues

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Python.Boost + Python2.7 + VS2008 issues

JS Unkn0wn
-:Background:-
I am working on a cross platform project (Win32 with proprietary graphics lib, and a proprietary embedded device running a custom OS with custom compilers)

-:Goals:-
Using Boost.Python on both platforms (without dlls, as we will have to embed Python anyway).

-:Problems:-
Receiving <<fatal error C1189: #error :  "Mixing a dll boost library with a static runtime is a really bad idea...">> in /MT, which is concerning to me since compiling as a DLL works but I must be able to deploy this on a system that has no DLL system.

-:Setup steps taken so far (in order), and system config:-
1 - Windows XP Pro + SP3
2 - Visual Studio 2008 Standard + Service Pack (C++ and C# installed)
3 - Python 2.7 installed
4 - Boost Pro 1.47 installer for Windows installed (c:\boost_1_47)
5 - Boost 1.47 copied to (c:\boost_1_47_0)
6 - Boost Build 1.47 downloaded

...


Here is the code I am trying to compile: http://pastebin.com/Rg2AeTms

Regards,
JSPerf Unkn0wn

_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python.Boost + Python2.7 + VS2008 issues

Niall Douglas
Surely Python absolutely requires DLL support for its extension
support?

Anything targeted at the Windows API will assume DLL support. You
might fare better using a GCC ecosystem. Your proprietary device, I
would assume, will use a GCC ecosystem anyway.

Niall


On 19 Apr 2012 at 0:09, JS Unkn0wn wrote:

> -:Background:-
> I am working on a cross platform project (Win32 with proprietary graphics
> lib, and a proprietary embedded device running a custom OS with custom
> compilers)
>
> -:Goals:-
> Using Boost.Python on both platforms (without dlls, as we will have to
> embed Python anyway).
>
> -:Problems:-
> Receiving <<fatal error C1189: #error :  "Mixing a dll boost library with a
> static runtime is a really bad idea...">> in /MT, which is concerning to me
> since compiling as a DLL works but I must be able to deploy this on a
> system that has no DLL system.
>
> -:Setup steps taken so far (in order), and system config:-
> 1 - Windows XP Pro + SP3
> 2 - Visual Studio 2008 Standard + Service Pack (C++ and C# installed)
> 3 - Python 2.7 installed
> 4 - Boost Pro 1.47 installer for Windows installed (c:\boost_1_47)
> 5 - Boost 1.47 copied to (c:\boost_1_47_0)
> 6 - Boost Build 1.47 downloaded
>
> ...
>
> I've written a much more detailed log here (
> http://jsperfunkn0wn.blogspot.co.uk/2012/04/installing-boostpython-python-27-for.html
>  ).
>
> Here is the code I am trying to compile: http://pastebin.com/Rg2AeTms
>
> Regards,
> JSPerf Unkn0wn
>


--
Technology & Consulting Services - ned Productions Limited.
http://www.nedproductions.biz/. VAT reg: IE 9708311Q.
Work Portfolio: http://careers.stackoverflow.com/nialldouglas/



_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python.Boost + Python2.7 + VS2008 issues

JS Unkn0wn
Python can be embedded inside the application itself. I'm not looking to extend python with modules available to other scripts other than the scripts loaded by my program. The device uses the ARM compiler (no dynamic linking support, is planned to be added, but not before my product will be released).

I've managed to get it compiling for Win32 without requiring DLL's using the steps in this article ( http://goo.gl/iQ7ZY ). I will document my steps in another blog post within the week.

What I'm trying to figure out now are fixing the errors explained on my blog entry ( http://goo.gl/K9G36 ).

Cheers,
JSPerf Unkn0wn

On Thu, Apr 19, 2012 at 1:48 PM, Niall Douglas <[hidden email]> wrote:
Surely Python absolutely requires DLL support for its extension
support?

Anything targeted at the Windows API will assume DLL support. You
might fare better using a GCC ecosystem. Your proprietary device, I
would assume, will use a GCC ecosystem anyway.

Niall


_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python.Boost + Python2.7 + VS2008 issues

Niall Douglas
On 19 Apr 2012 at 14:40, JS Unkn0wn wrote:

> What I'm trying to figure out now are fixing the errors explained on my
> blog entry ( http://goo.gl/K9G36 ).

I think you will struggle to get much help here by posting links to
other places. No one here has time to read blogs. You need to
formulate the problem into a single post here, preferably with a
small example program illustrating the problem.

Niall

--
Technology & Consulting Services - ned Productions Limited.
http://www.nedproductions.biz/. VAT reg: IE 9708311Q.
Work Portfolio: http://careers.stackoverflow.com/nialldouglas/



_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python.Boost + Python2.7 + VS2008 issues

JS Unkn0wn
On Thu, Apr 19, 2012 at 3:41 PM, Niall Douglas
<[hidden email]> wrote:

>
> On 19 Apr 2012 at 14:40, JS Unkn0wn wrote:
>
> > What I'm trying to figure out now are fixing the errors explained on my
> > blog entry ( http://goo.gl/K9G36 ).
>
> I think you will struggle to get much help here by posting links to
> other places. No one here has time to read blogs. You need to
> formulate the problem into a single post here, preferably with a
> small example program illustrating the problem.
>
> Niall
>
> --
> Technology & Consulting Services - ned Productions Limited.
> http://www.nedproductions.biz/. VAT reg: IE 9708311Q.
> Work Portfolio: http://careers.stackoverflow.com/nialldouglas/
>
>
>
> _______________________________________________
> Cplusplus-sig mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/cplusplus-sig

Well it is a blog entry detailing every single step I took, and every
decision I made. But I can copy/paste it into here then if that is the
only accepted method of communication ...
n.b. output.txt, output2.txt, output3.txt and output4.txt is at the
end of this message.

-: Problem statement :-

I am working on a video game on an embedded games system which does
not have a .dll system. I want to embed Python into the binary
executable and run python scripts that can communicate with the game
engine.

-: Additional information :-

Python 2.7 was compiled with Visual Studio 2008, which means I don't
have to compile Python 2.7 from source in order to use it in my
project.
You can either extend python or embed Python. I am embedding Python as
I will be running this on an embedded system
I've actually spent over a week so far trying to get this to work
(even using Boost.Pro installer) and it seems like such a painful
process. Unfortunately I never kept a log, but here is a brief summary
of errors I do recall:

Performing some of the cmd.exe steps in cmd.exe instead of Visual
Studio 2008 Command Prompt
Confusing some of the steps given. For example do I perform this step
in the boost, boost-build or Boost.Pro-install directory? And why are
libs that are supposed to appear in XYZ appearing elsewhere

I was getting obscure compile errors at times, and other times I was
was able to compile but would suffer from runtime errors when making
calls to Python. I've never spent so much time configuring anything to
work like this, and unfortunately I have a high level of patience so
I'm not giving up yet.

-: Final thoughts before I head back to this torturous task :-

Why is this so darn difficult? Why can't it just work? or am I the
only one in the world who is doing it the wrong way? I could have come
up with my own scripting language by now, without half the headache
I've had and time wasted.

-:Instructions being followed:-

I am following Boost C++ Libraries: Boost.Python Build and Test HOWTO,
bearing in mind that it says in 3.1 to (1)Get Boost and (2) Get bjam,
directing us to 1:Get Boost and 5:Prepare To Use a Boost Library
Binary.

-: A: Starting setup :-

Python 2.7.2 installed (using python installer)
Copied boost to c:\boost_1_47_0
Installed BoostPro to c:\boost_1_47_0

Visual Studio 2008
Installed every variant apart from DLL

Multithreaded (+debug)
Multithreaded static (+debug)
Single threaded, static runtime (+debug)

Boost Getting Started On Windows (5.1) says I need all variations of
the Regex library, so I have run the installer again but to only
install all variants.
I have also installed the Multithreaded DLL (+dll) Python variants
I have "skipped to Section 6" on  Boost Getting Started On Windows (as
directed by 5.1), and successfully executed the Regex sample
I have done step 4 of the 3.1: Basic Procedure and ran bjam
toolset=msvc --verbose-test test in the command prompt

-: Result :-

.\bin\msvc-9.0\debug\threading-multi\embedding.exe was created
Running python test_extending.py yields output3.txt (i.e. a fail)

The result is shown in output.txt
I ran the MSVC batch file (just to be sure) and which is shown in output2.txt

As explained in 3.2: In Case of Trouble, I have created a
user-config.jam file with minimum incantation given. Compiling gives
the following output4.txt (running python test_extending.py) still
fails, buttest_extending.pyc is created this time (which I don't think
was before)

So here I am at 3.2: In Case of Trouble again, the same place I've
been for the past week. I will be asking for help in the
[hidden email] mailing list.

BEGIN "output.txt">>>
notice: found boost-build.jam at
C:/boost_1_47_0/libs/python/example/quickstart/boost-build.jam
notice: loading Boost.Build from C:/boost_1_47_0/tools/build/v2
notice: Searching C:\WINDOWS C:\Documents and Settings\Keldon
C:\Documents and Settings\Keldon
C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
C:/boost_1_47_0/tools/build/v2/kernel
C:/boost_1_47_0/tools/build/v2/util
C:/boost_1_47_0/tools/build/v2/build
C:/boost_1_47_0/tools/build/v2/tools
C:/boost_1_47_0/tools/build/v2/contrib
C:/boost_1_47_0/tools/build/v2/. for site-config configuration file
site-config.jam .
notice: Loading site-config configuration file site-config.jam from
C:/boost_1_47_0/tools/build/v2/site-config.jam .
notice: Searching C:\Documents and Settings\Keldon C:\Documents and
Settings\Keldon
C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
C:/boost_1_47_0/tools/build/v2/kernel
C:/boost_1_47_0/tools/build/v2/util
C:/boost_1_47_0/tools/build/v2/build
C:/boost_1_47_0/tools/build/v2/tools
C:/boost_1_47_0/tools/build/v2/contrib
C:/boost_1_47_0/tools/build/v2/. for user-config configuration file
user-config.jam .
notice: Loading user-config configuration file user-config.jam from
C:/Documents and Settings/Keldon/user-config.jam .
notice: [msvc-cfg] msvc-9.0 detected, command: 'c:\Program
Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe'
notice: will use 'c:\Program Files\Microsoft Visual Studio
9.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-9.0
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>/<address-model>', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>/<address-model>32', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>x86/<address-model>', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>x86/<address-model>32', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>/<address-model>64', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_amd64 >nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>x86/<address-model>64', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_amd64 >nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>ia64/<address-model>', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_ia64 >nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>ia64/<address-model>64', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_ia64 >nul
'
notice: [python-cfg] Configuring python...
notice: [python-cfg]   user-specified version: "2.7"
notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\"
notice: [python-cfg] Checking interpreter command "python"...
notice: [python-cfg] running command 'DIR /-C /A:S
"C:\Python27\python.exe" 2>&1'
notice: [python-cfg] running command '"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: "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"
notice: Searching ../../../.. for project-config configuration file
project-config.jam .
notice: Loading project-config configuration file project-config.jam
from ../../../../project-config.jam .
notice: [cmdline-cfg] Detected command-line request for msvc: toolset=
msvc version=
notice: [cmdline-cfg] toolset msvc already configured
notice: iostreams: not using zlib compression
notice: iostreams: not using zlib compression
notice: iostreams: not using bzip2 compression
notice: iostreams: not using bzip2 compression
...patience...
...patience...
...found 1600 targets...
...updating 11 targets...
common.mkdir bin
common.mkdir bin\msvc-9.0
common.mkdir bin\msvc-9.0\debug
common.mkdir bin\msvc-9.0\debug\threading-multi
compile-c-c++ bin\msvc-9.0\debug\threading-multi\extending.obj
extending.cpp
msvc.link.dll bin\msvc-9.0\debug\threading-multi\extending.pyd
   Creating library bin\msvc-9.0\debug\threading-multi\extending.lib
and object bin\msvc-9.0\debug\threading-multi\extending.exp
msvc.manifest.dll bin\msvc-9.0\debug\threading-multi\extending.pyd
compile-c-c++ bin\msvc-9.0\debug\threading-multi\embedding.obj
embedding.cpp
msvc.link bin\msvc-9.0\debug\threading-multi\embedding.exe
   Creating library bin\msvc-9.0\debug\threading-multi\embedding.lib
and object bin\msvc-9.0\debug\threading-multi\embedding.exp
msvc.manifest bin\msvc-9.0\debug\threading-multi\embedding.exe
...updated 11 targets...
<<< output.txt END

>>> BEGIN output2.txt
notice: found boost-build.jam at
C:/boost_1_47_0/libs/python/example/quickstart/boost-build.jam
notice: loading Boost.Build from C:/boost_1_47_0/tools/build/v2
notice: Searching C:\WINDOWS C:\Documents and Settings\Keldon
C:\Documents and Settings\Keldon
C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
C:/boost_1_47_0/tools/build/v2/kernel
C:/boost_1_47_0/tools/build/v2/util
C:/boost_1_47_0/tools/build/v2/build
C:/boost_1_47_0/tools/build/v2/tools
C:/boost_1_47_0/tools/build/v2/contrib
C:/boost_1_47_0/tools/build/v2/. for site-config configuration file
site-config.jam .
notice: Loading site-config configuration file site-config.jam from
C:/boost_1_47_0/tools/build/v2/site-config.jam .
notice: Searching C:\Documents and Settings\Keldon C:\Documents and
Settings\Keldon
C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
C:/boost_1_47_0/tools/build/v2/kernel
C:/boost_1_47_0/tools/build/v2/util
C:/boost_1_47_0/tools/build/v2/build
C:/boost_1_47_0/tools/build/v2/tools
C:/boost_1_47_0/tools/build/v2/contrib
C:/boost_1_47_0/tools/build/v2/. for user-config configuration file
user-config.jam .
notice: Loading user-config configuration file user-config.jam from
C:/Documents and Settings/Keldon/user-config.jam .
notice: [msvc-cfg] msvc-9.0 detected, command: 'c:\Program
Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe'
notice: will use 'c:\Program Files\Microsoft Visual Studio
9.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-9.0
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>/<address-model>', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>/<address-model>32', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>x86/<address-model>', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>x86/<address-model>32', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>/<address-model>64', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_amd64 >nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>x86/<address-model>64', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_amd64 >nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>ia64/<address-model>', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_ia64 >nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>ia64/<address-model>64', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_ia64 >nul
'
notice: [python-cfg] Configuring python...
notice: [python-cfg]   user-specified version: "2.7"
notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\"
notice: [python-cfg] Checking interpreter command "python"...
notice: [python-cfg] running command 'DIR /-C /A:S
"C:\Python27\python.exe" 2>&1'
notice: [python-cfg] running command '"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: "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"
notice: Searching ../../../.. for project-config configuration file
project-config.jam .
notice: Loading project-config configuration file project-config.jam
from ../../../../project-config.jam .
notice: [cmdline-cfg] Detected command-line request for msvc: toolset=
msvc version=
notice: [cmdline-cfg] toolset msvc already configured
notice: iostreams: not using zlib compression
notice: iostreams: not using zlib compression
notice: iostreams: not using bzip2 compression
notice: iostreams: not using bzip2 compression
...patience...
...patience...
...found 1600 targets...
<<< output2.txt END

>>> BEGIN output3.txt
Trying:
    from extending import *
Expecting nothing
**********************************************************************
File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
line 6, in test_extending
Failed example:
    from extending import *
Exception raised:
    Traceback (most recent call last):
      File "C:\Python27\lib\doctest.py", line 1254, in __run
        compileflags, 1) in test.globs
      File "<doctest test_extending[0]>", line 1, in <module>
        from extending import *
    ImportError: No module named extending
Trying:
    hi = hello('California')
Expecting nothing
**********************************************************************
File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
line 7, in test_extending
Failed example:
    hi = hello('California')
Exception raised:
    Traceback (most recent call last):
      File "C:\Python27\lib\doctest.py", line 1254, in __run
        compileflags, 1) in test.globs
      File "<doctest test_extending[1]>", line 1, in <module>
        hi = hello('California')
    NameError: name 'hello' is not defined
Trying:
    hi.greet()
Expecting:
    'Hello from California'
**********************************************************************
File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
line 8, in test_extending
Failed example:
    hi.greet()
Exception raised:
    Traceback (most recent call last):
      File "C:\Python27\lib\doctest.py", line 1254, in __run
        compileflags, 1) in test.globs
      File "<doctest test_extending[2]>", line 1, in <module>
        hi.greet()
    NameError: name 'hi' is not defined
Trying:
    invite(hi)
Expecting:
    'Hello from California! Please come soon!'
**********************************************************************
File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
line 10, in test_extending
Failed example:
    invite(hi)
Exception raised:
    Traceback (most recent call last):
      File "C:\Python27\lib\doctest.py", line 1254, in __run
        compileflags, 1) in test.globs
      File "<doctest test_extending[3]>", line 1, in <module>
        invite(hi)
    NameError: name 'invite' is not defined
Trying:
    hi.invite()
Expecting:
    'Hello from California! Please come soon!'
**********************************************************************
File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
line 12, in test_extending
Failed example:
    hi.invite()
Exception raised:
    Traceback (most recent call last):
      File "C:\Python27\lib\doctest.py", line 1254, in __run
        compileflags, 1) in test.globs
      File "<doctest test_extending[4]>", line 1, in <module>
        hi.invite()
    NameError: name 'hi' is not defined
Trying:
    class wordy(hello):
        def greet(self):
            return hello.greet(self) + ', where the weather is fine'
Expecting nothing
**********************************************************************
File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
line 15, in test_extending
Failed example:
    class wordy(hello):
        def greet(self):
            return hello.greet(self) + ', where the weather is fine'
Exception raised:
    Traceback (most recent call last):
      File "C:\Python27\lib\doctest.py", line 1254, in __run
        compileflags, 1) in test.globs
      File "<doctest test_extending[5]>", line 1, in <module>
        class wordy(hello):
    NameError: name 'hello' is not defined
Trying:
    hi2 = wordy('Florida')
Expecting nothing
**********************************************************************
File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
line 19, in test_extending
Failed example:
    hi2 = wordy('Florida')
Exception raised:
    Traceback (most recent call last):
      File "C:\Python27\lib\doctest.py", line 1254, in __run
        compileflags, 1) in test.globs
      File "<doctest test_extending[6]>", line 1, in <module>
        hi2 = wordy('Florida')
    NameError: name 'wordy' is not defined
Trying:
    hi2.greet()
Expecting:
    'Hello from Florida, where the weather is fine'
**********************************************************************
File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
line 20, in test_extending
Failed example:
    hi2.greet()
Exception raised:
    Traceback (most recent call last):
      File "C:\Python27\lib\doctest.py", line 1254, in __run
        compileflags, 1) in test.globs
      File "<doctest test_extending[7]>", line 1, in <module>
        hi2.greet()
    NameError: name 'hi2' is not defined
Trying:
    invite(hi2)
Expecting:
    'Hello from Florida! Please come soon!'
**********************************************************************
File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
line 22, in test_extending
Failed example:
    invite(hi2)
Exception raised:
    Traceback (most recent call last):
      File "C:\Python27\lib\doctest.py", line 1254, in __run
        compileflags, 1) in test.globs
      File "<doctest test_extending[8]>", line 1, in <module>
        invite(hi2)
    NameError: name 'invite' is not defined
1 items had no tests:
    test_extending.run
**********************************************************************
1 items had failures:
   9 of   9 in test_extending
9 tests in 2 items.
0 passed and 9 failed.
***Test Failed*** 9 failures.
<<< output3.txt END

>>> BEGIN output4.txt
notice: found boost-build.jam at
C:/boost_1_47_0/libs/python/example/quickstart/boost-build.jam
notice: loading Boost.Build from C:/boost_1_47_0/tools/build/v2
notice: Searching C:\WINDOWS C:\Documents and Settings\Keldon
C:\Documents and Settings\Keldon
C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
C:/boost_1_47_0/tools/build/v2/kernel
C:/boost_1_47_0/tools/build/v2/util
C:/boost_1_47_0/tools/build/v2/build
C:/boost_1_47_0/tools/build/v2/tools
C:/boost_1_47_0/tools/build/v2/contrib
C:/boost_1_47_0/tools/build/v2/. for site-config configuration file
site-config.jam .
notice: Loading site-config configuration file site-config.jam from
C:/boost_1_47_0/tools/build/v2/site-config.jam .
notice: Searching C:\Documents and Settings\Keldon C:\Documents and
Settings\Keldon
C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
C:/boost_1_47_0/tools/build/v2/kernel
C:/boost_1_47_0/tools/build/v2/util
C:/boost_1_47_0/tools/build/v2/build
C:/boost_1_47_0/tools/build/v2/tools
C:/boost_1_47_0/tools/build/v2/contrib
C:/boost_1_47_0/tools/build/v2/. for user-config configuration file
user-config.jam .
notice: Loading user-config configuration file user-config.jam from
C:/Documents and Settings/Keldon/user-config.jam .
notice: [python-cfg] Configuring python...
notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\"
notice: [python-cfg] Checking interpreter command "python"...
notice: [python-cfg] running command 'DIR /-C /A:S
"C:\Python27\python.exe" 2>&1'
notice: [python-cfg] running command '"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: "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"
notice: Searching ../../../.. for project-config configuration file
project-config.jam .
notice: Loading project-config configuration file project-config.jam
from ../../../../project-config.jam .
notice: [msvc-cfg] msvc-9.0 detected, command: 'c:\Program
Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe'
notice: will use 'c:\Program Files\Microsoft Visual Studio
9.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-9.0
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>/<address-model>', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>/<address-model>32', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>x86/<address-model>', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>x86/<address-model>32', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>/<address-model>64', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_amd64 >nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>x86/<address-model>64', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_amd64 >nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>ia64/<address-model>', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_ia64 >nul
'
notice: [msvc-cfg] condition:
'<toolset>msvc-9.0/<architecture>ia64/<address-model>64', setup: 'call
"c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86_ia64 >nul
'
notice: [cmdline-cfg] Detected command-line request for msvc: toolset=
msvc version=
notice: [cmdline-cfg] toolset msvc already configured
notice: iostreams: not using zlib compression
notice: iostreams: not using zlib compression
notice: iostreams: not using bzip2 compression
notice: iostreams: not using bzip2 compression
...patience...
...patience...
...found 1600 targets...
<<< output4.txt END
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python.Boost + Python2.7 + VS2008 issues

Niall Douglas
So, to be clear, your problem has absolutely nothing to do with any
embedded system. Your sole problem is that you can't get embedding to
work on Windows?

Niall


On 19 Apr 2012 at 15:57, JS Unkn0wn wrote:

> On Thu, Apr 19, 2012 at 3:41 PM, Niall Douglas
> <[hidden email]> wrote:
> >
> > On 19 Apr 2012 at 14:40, JS Unkn0wn wrote:
> >
> > > What I'm trying to figure out now are fixing the errors explained on my
> > > blog entry ( http://goo.gl/K9G36 ).
> >
> > I think you will struggle to get much help here by posting links to
> > other places. No one here has time to read blogs. You need to
> > formulate the problem into a single post here, preferably with a
> > small example program illustrating the problem.
> >
> > Niall
> >
> > --
> > Technology & Consulting Services - ned Productions Limited.
> > http://www.nedproductions.biz/. VAT reg: IE 9708311Q.
> > Work Portfolio: http://careers.stackoverflow.com/nialldouglas/
> >
> >
> >
> > _______________________________________________
> > Cplusplus-sig mailing list
> > [hidden email]
> > http://mail.python.org/mailman/listinfo/cplusplus-sig
>
> Well it is a blog entry detailing every single step I took, and every
> decision I made. But I can copy/paste it into here then if that is the
> only accepted method of communication ...
> n.b. output.txt, output2.txt, output3.txt and output4.txt is at the
> end of this message.
>
> -: Problem statement :-
>
> I am working on a video game on an embedded games system which does
> not have a .dll system. I want to embed Python into the binary
> executable and run python scripts that can communicate with the game
> engine.
>
> -: Additional information :-
>
> Python 2.7 was compiled with Visual Studio 2008, which means I don't
> have to compile Python 2.7 from source in order to use it in my
> project.
> You can either extend python or embed Python. I am embedding Python as
> I will be running this on an embedded system
> I've actually spent over a week so far trying to get this to work
> (even using Boost.Pro installer) and it seems like such a painful
> process. Unfortunately I never kept a log, but here is a brief summary
> of errors I do recall:
>
> Performing some of the cmd.exe steps in cmd.exe instead of Visual
> Studio 2008 Command Prompt
> Confusing some of the steps given. For example do I perform this step
> in the boost, boost-build or Boost.Pro-install directory? And why are
> libs that are supposed to appear in XYZ appearing elsewhere
>
> I was getting obscure compile errors at times, and other times I was
> was able to compile but would suffer from runtime errors when making
> calls to Python. I've never spent so much time configuring anything to
> work like this, and unfortunately I have a high level of patience so
> I'm not giving up yet.
>
> -: Final thoughts before I head back to this torturous task :-
>
> Why is this so darn difficult? Why can't it just work? or am I the
> only one in the world who is doing it the wrong way? I could have come
> up with my own scripting language by now, without half the headache
> I've had and time wasted.
>
> -:Instructions being followed:-
>
> I am following Boost C++ Libraries: Boost.Python Build and Test HOWTO,
> bearing in mind that it says in 3.1 to (1)Get Boost and (2) Get bjam,
> directing us to 1:Get Boost and 5:Prepare To Use a Boost Library
> Binary.
>
> -: A: Starting setup :-
>
> Python 2.7.2 installed (using python installer)
> Copied boost to c:\boost_1_47_0
> Installed BoostPro to c:\boost_1_47_0
>
> Visual Studio 2008
> Installed every variant apart from DLL
>
> Multithreaded (+debug)
> Multithreaded static (+debug)
> Single threaded, static runtime (+debug)
>
> Boost Getting Started On Windows (5.1) says I need all variations of
> the Regex library, so I have run the installer again but to only
> install all variants.
> I have also installed the Multithreaded DLL (+dll) Python variants
> I have "skipped to Section 6" on  Boost Getting Started On Windows (as
> directed by 5.1), and successfully executed the Regex sample
> I have done step 4 of the 3.1: Basic Procedure and ran bjam
> toolset=msvc --verbose-test test in the command prompt
>
> -: Result :-
>
> .\bin\msvc-9.0\debug\threading-multi\embedding.exe was created
> Running python test_extending.py yields output3.txt (i.e. a fail)
>
> The result is shown in output.txt
> I ran the MSVC batch file (just to be sure) and which is shown in output2.txt
>
> As explained in 3.2: In Case of Trouble, I have created a
> user-config.jam file with minimum incantation given. Compiling gives
> the following output4.txt (running python test_extending.py) still
> fails, buttest_extending.pyc is created this time (which I don't think
> was before)
>
> So here I am at 3.2: In Case of Trouble again, the same place I've
> been for the past week. I will be asking for help in the
> [hidden email] mailing list.
>
> BEGIN "output.txt">>>
> notice: found boost-build.jam at
> C:/boost_1_47_0/libs/python/example/quickstart/boost-build.jam
> notice: loading Boost.Build from C:/boost_1_47_0/tools/build/v2
> notice: Searching C:\WINDOWS C:\Documents and Settings\Keldon
> C:\Documents and Settings\Keldon
> C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
> C:/boost_1_47_0/tools/build/v2/kernel
> C:/boost_1_47_0/tools/build/v2/util
> C:/boost_1_47_0/tools/build/v2/build
> C:/boost_1_47_0/tools/build/v2/tools
> C:/boost_1_47_0/tools/build/v2/contrib
> C:/boost_1_47_0/tools/build/v2/. for site-config configuration file
> site-config.jam .
> notice: Loading site-config configuration file site-config.jam from
> C:/boost_1_47_0/tools/build/v2/site-config.jam .
> notice: Searching C:\Documents and Settings\Keldon C:\Documents and
> Settings\Keldon
> C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
> C:/boost_1_47_0/tools/build/v2/kernel
> C:/boost_1_47_0/tools/build/v2/util
> C:/boost_1_47_0/tools/build/v2/build
> C:/boost_1_47_0/tools/build/v2/tools
> C:/boost_1_47_0/tools/build/v2/contrib
> C:/boost_1_47_0/tools/build/v2/. for user-config configuration file
> user-config.jam .
> notice: Loading user-config configuration file user-config.jam from
> C:/Documents and Settings/Keldon/user-config.jam .
> notice: [msvc-cfg] msvc-9.0 detected, command: 'c:\Program
> Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe'
> notice: will use 'c:\Program Files\Microsoft Visual Studio
> 9.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-9.0
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>/<address-model>', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>/<address-model>32', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>x86/<address-model>', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>x86/<address-model>32', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>/<address-model>64', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_amd64 >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>x86/<address-model>64', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_amd64 >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>ia64/<address-model>', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_ia64 >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>ia64/<address-model>64', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_ia64 >nul
> '
> notice: [python-cfg] Configuring python...
> notice: [python-cfg]   user-specified version: "2.7"
> notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\"
> notice: [python-cfg] Checking interpreter command "python"...
> notice: [python-cfg] running command 'DIR /-C /A:S
> "C:\Python27\python.exe" 2>&1'
> notice: [python-cfg] running command '"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: "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"
> notice: Searching ../../../.. for project-config configuration file
> project-config.jam .
> notice: Loading project-config configuration file project-config.jam
> from ../../../../project-config.jam .
> notice: [cmdline-cfg] Detected command-line request for msvc: toolset=
> msvc version=
> notice: [cmdline-cfg] toolset msvc already configured
> notice: iostreams: not using zlib compression
> notice: iostreams: not using zlib compression
> notice: iostreams: not using bzip2 compression
> notice: iostreams: not using bzip2 compression
> ...patience...
> ...patience...
> ...found 1600 targets...
> ...updating 11 targets...
> common.mkdir bin
> common.mkdir bin\msvc-9.0
> common.mkdir bin\msvc-9.0\debug
> common.mkdir bin\msvc-9.0\debug\threading-multi
> compile-c-c++ bin\msvc-9.0\debug\threading-multi\extending.obj
> extending.cpp
> msvc.link.dll bin\msvc-9.0\debug\threading-multi\extending.pyd
>    Creating library bin\msvc-9.0\debug\threading-multi\extending.lib
> and object bin\msvc-9.0\debug\threading-multi\extending.exp
> msvc.manifest.dll bin\msvc-9.0\debug\threading-multi\extending.pyd
> compile-c-c++ bin\msvc-9.0\debug\threading-multi\embedding.obj
> embedding.cpp
> msvc.link bin\msvc-9.0\debug\threading-multi\embedding.exe
>    Creating library bin\msvc-9.0\debug\threading-multi\embedding.lib
> and object bin\msvc-9.0\debug\threading-multi\embedding.exp
> msvc.manifest bin\msvc-9.0\debug\threading-multi\embedding.exe
> ...updated 11 targets...
> <<< output.txt END
>
> >>> BEGIN output2.txt
> notice: found boost-build.jam at
> C:/boost_1_47_0/libs/python/example/quickstart/boost-build.jam
> notice: loading Boost.Build from C:/boost_1_47_0/tools/build/v2
> notice: Searching C:\WINDOWS C:\Documents and Settings\Keldon
> C:\Documents and Settings\Keldon
> C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
> C:/boost_1_47_0/tools/build/v2/kernel
> C:/boost_1_47_0/tools/build/v2/util
> C:/boost_1_47_0/tools/build/v2/build
> C:/boost_1_47_0/tools/build/v2/tools
> C:/boost_1_47_0/tools/build/v2/contrib
> C:/boost_1_47_0/tools/build/v2/. for site-config configuration file
> site-config.jam .
> notice: Loading site-config configuration file site-config.jam from
> C:/boost_1_47_0/tools/build/v2/site-config.jam .
> notice: Searching C:\Documents and Settings\Keldon C:\Documents and
> Settings\Keldon
> C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
> C:/boost_1_47_0/tools/build/v2/kernel
> C:/boost_1_47_0/tools/build/v2/util
> C:/boost_1_47_0/tools/build/v2/build
> C:/boost_1_47_0/tools/build/v2/tools
> C:/boost_1_47_0/tools/build/v2/contrib
> C:/boost_1_47_0/tools/build/v2/. for user-config configuration file
> user-config.jam .
> notice: Loading user-config configuration file user-config.jam from
> C:/Documents and Settings/Keldon/user-config.jam .
> notice: [msvc-cfg] msvc-9.0 detected, command: 'c:\Program
> Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe'
> notice: will use 'c:\Program Files\Microsoft Visual Studio
> 9.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-9.0
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>/<address-model>', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>/<address-model>32', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>x86/<address-model>', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>x86/<address-model>32', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>/<address-model>64', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_amd64 >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>x86/<address-model>64', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_amd64 >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>ia64/<address-model>', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_ia64 >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>ia64/<address-model>64', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_ia64 >nul
> '
> notice: [python-cfg] Configuring python...
> notice: [python-cfg]   user-specified version: "2.7"
> notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\"
> notice: [python-cfg] Checking interpreter command "python"...
> notice: [python-cfg] running command 'DIR /-C /A:S
> "C:\Python27\python.exe" 2>&1'
> notice: [python-cfg] running command '"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: "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"
> notice: Searching ../../../.. for project-config configuration file
> project-config.jam .
> notice: Loading project-config configuration file project-config.jam
> from ../../../../project-config.jam .
> notice: [cmdline-cfg] Detected command-line request for msvc: toolset=
> msvc version=
> notice: [cmdline-cfg] toolset msvc already configured
> notice: iostreams: not using zlib compression
> notice: iostreams: not using zlib compression
> notice: iostreams: not using bzip2 compression
> notice: iostreams: not using bzip2 compression
> ...patience...
> ...patience...
> ...found 1600 targets...
> <<< output2.txt END
>
> >>> BEGIN output3.txt
> Trying:
>     from extending import *
> Expecting nothing
> **********************************************************************
> File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
> line 6, in test_extending
> Failed example:
>     from extending import *
> Exception raised:
>     Traceback (most recent call last):
>       File "C:\Python27\lib\doctest.py", line 1254, in __run
>         compileflags, 1) in test.globs
>       File "<doctest test_extending[0]>", line 1, in <module>
>         from extending import *
>     ImportError: No module named extending
> Trying:
>     hi = hello('California')
> Expecting nothing
> **********************************************************************
> File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
> line 7, in test_extending
> Failed example:
>     hi = hello('California')
> Exception raised:
>     Traceback (most recent call last):
>       File "C:\Python27\lib\doctest.py", line 1254, in __run
>         compileflags, 1) in test.globs
>       File "<doctest test_extending[1]>", line 1, in <module>
>         hi = hello('California')
>     NameError: name 'hello' is not defined
> Trying:
>     hi.greet()
> Expecting:
>     'Hello from California'
> **********************************************************************
> File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
> line 8, in test_extending
> Failed example:
>     hi.greet()
> Exception raised:
>     Traceback (most recent call last):
>       File "C:\Python27\lib\doctest.py", line 1254, in __run
>         compileflags, 1) in test.globs
>       File "<doctest test_extending[2]>", line 1, in <module>
>         hi.greet()
>     NameError: name 'hi' is not defined
> Trying:
>     invite(hi)
> Expecting:
>     'Hello from California! Please come soon!'
> **********************************************************************
> File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
> line 10, in test_extending
> Failed example:
>     invite(hi)
> Exception raised:
>     Traceback (most recent call last):
>       File "C:\Python27\lib\doctest.py", line 1254, in __run
>         compileflags, 1) in test.globs
>       File "<doctest test_extending[3]>", line 1, in <module>
>         invite(hi)
>     NameError: name 'invite' is not defined
> Trying:
>     hi.invite()
> Expecting:
>     'Hello from California! Please come soon!'
> **********************************************************************
> File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
> line 12, in test_extending
> Failed example:
>     hi.invite()
> Exception raised:
>     Traceback (most recent call last):
>       File "C:\Python27\lib\doctest.py", line 1254, in __run
>         compileflags, 1) in test.globs
>       File "<doctest test_extending[4]>", line 1, in <module>
>         hi.invite()
>     NameError: name 'hi' is not defined
> Trying:
>     class wordy(hello):
>         def greet(self):
>             return hello.greet(self) + ', where the weather is fine'
> Expecting nothing
> **********************************************************************
> File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
> line 15, in test_extending
> Failed example:
>     class wordy(hello):
>         def greet(self):
>             return hello.greet(self) + ', where the weather is fine'
> Exception raised:
>     Traceback (most recent call last):
>       File "C:\Python27\lib\doctest.py", line 1254, in __run
>         compileflags, 1) in test.globs
>       File "<doctest test_extending[5]>", line 1, in <module>
>         class wordy(hello):
>     NameError: name 'hello' is not defined
> Trying:
>     hi2 = wordy('Florida')
> Expecting nothing
> **********************************************************************
> File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
> line 19, in test_extending
> Failed example:
>     hi2 = wordy('Florida')
> Exception raised:
>     Traceback (most recent call last):
>       File "C:\Python27\lib\doctest.py", line 1254, in __run
>         compileflags, 1) in test.globs
>       File "<doctest test_extending[6]>", line 1, in <module>
>         hi2 = wordy('Florida')
>     NameError: name 'wordy' is not defined
> Trying:
>     hi2.greet()
> Expecting:
>     'Hello from Florida, where the weather is fine'
> **********************************************************************
> File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
> line 20, in test_extending
> Failed example:
>     hi2.greet()
> Exception raised:
>     Traceback (most recent call last):
>       File "C:\Python27\lib\doctest.py", line 1254, in __run
>         compileflags, 1) in test.globs
>       File "<doctest test_extending[7]>", line 1, in <module>
>         hi2.greet()
>     NameError: name 'hi2' is not defined
> Trying:
>     invite(hi2)
> Expecting:
>     'Hello from Florida! Please come soon!'
> **********************************************************************
> File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py",
> line 22, in test_extending
> Failed example:
>     invite(hi2)
> Exception raised:
>     Traceback (most recent call last):
>       File "C:\Python27\lib\doctest.py", line 1254, in __run
>         compileflags, 1) in test.globs
>       File "<doctest test_extending[8]>", line 1, in <module>
>         invite(hi2)
>     NameError: name 'invite' is not defined
> 1 items had no tests:
>     test_extending.run
> **********************************************************************
> 1 items had failures:
>    9 of   9 in test_extending
> 9 tests in 2 items.
> 0 passed and 9 failed.
> ***Test Failed*** 9 failures.
> <<< output3.txt END
>
> >>> BEGIN output4.txt
> notice: found boost-build.jam at
> C:/boost_1_47_0/libs/python/example/quickstart/boost-build.jam
> notice: loading Boost.Build from C:/boost_1_47_0/tools/build/v2
> notice: Searching C:\WINDOWS C:\Documents and Settings\Keldon
> C:\Documents and Settings\Keldon
> C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
> C:/boost_1_47_0/tools/build/v2/kernel
> C:/boost_1_47_0/tools/build/v2/util
> C:/boost_1_47_0/tools/build/v2/build
> C:/boost_1_47_0/tools/build/v2/tools
> C:/boost_1_47_0/tools/build/v2/contrib
> C:/boost_1_47_0/tools/build/v2/. for site-config configuration file
> site-config.jam .
> notice: Loading site-config configuration file site-config.jam from
> C:/boost_1_47_0/tools/build/v2/site-config.jam .
> notice: Searching C:\Documents and Settings\Keldon C:\Documents and
> Settings\Keldon
> C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2
> C:/boost_1_47_0/tools/build/v2/kernel
> C:/boost_1_47_0/tools/build/v2/util
> C:/boost_1_47_0/tools/build/v2/build
> C:/boost_1_47_0/tools/build/v2/tools
> C:/boost_1_47_0/tools/build/v2/contrib
> C:/boost_1_47_0/tools/build/v2/. for user-config configuration file
> user-config.jam .
> notice: Loading user-config configuration file user-config.jam from
> C:/Documents and Settings/Keldon/user-config.jam .
> notice: [python-cfg] Configuring python...
> notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\"
> notice: [python-cfg] Checking interpreter command "python"...
> notice: [python-cfg] running command 'DIR /-C /A:S
> "C:\Python27\python.exe" 2>&1'
> notice: [python-cfg] running command '"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: "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"
> notice: Searching ../../../.. for project-config configuration file
> project-config.jam .
> notice: Loading project-config configuration file project-config.jam
> from ../../../../project-config.jam .
> notice: [msvc-cfg] msvc-9.0 detected, command: 'c:\Program
> Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe'
> notice: will use 'c:\Program Files\Microsoft Visual Studio
> 9.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-9.0
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>/<address-model>', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>/<address-model>32', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>x86/<address-model>', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>x86/<address-model>32', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
> >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>/<address-model>64', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_amd64 >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>x86/<address-model>64', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_amd64 >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>ia64/<address-model>', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_ia64 >nul
> '
> notice: [msvc-cfg] condition:
> '<toolset>msvc-9.0/<architecture>ia64/<address-model>64', setup: 'call
> "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
> x86_ia64 >nul
> '
> notice: [cmdline-cfg] Detected command-line request for msvc: toolset=
> msvc version=
> notice: [cmdline-cfg] toolset msvc already configured
> notice: iostreams: not using zlib compression
> notice: iostreams: not using zlib compression
> notice: iostreams: not using bzip2 compression
> notice: iostreams: not using bzip2 compression
> ...patience...
> ...patience...
> ...found 1600 targets...
> <<< output4.txt END
> _______________________________________________
> Cplusplus-sig mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/cplusplus-sig


--
Technology & Consulting Services - ned Productions Limited.
http://www.nedproductions.biz/. VAT reg: IE 9708311Q.
Work Portfolio: http://careers.stackoverflow.com/nialldouglas/



_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python.Boost + Python2.7 + VS2008 issues

JS Unkn0wn
Yes, my current problem is embedding on Windows, but my requirements
are the same as compiling to the embedded system, as the primary
target is with the Arm processor + proprietary OS. The Windows
compilation is just a temporary set up until my kit arrives. So I have
planned for the Windows build to work with the same limitations that I
would be subjected to with the hardware.

Until I receive my hardware development kit I am working with a
Windows substitute environment that provides an OpenGL interface that
emulates the Pica200 GPU. Though I'm only mentioning that to explain
why I have to statically link against Python and Boost.Python and have
no other option.

I have already achieved my goal of statically linking Boost.Python and
Python (or at least it appears to). My goal right now is to
successfully compile and run
"%BOOST_DIR%\libs\python\example\quickstart", as I really like to have
all of my tools in order and I would not be comfortable knowing that I
cannot successfully operate my tool.

p.s. many thanks for being so helpful.

Regards,
JSPerf Unkn0wn
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python.Boost + Python2.7 + VS2008 issues

Niall Douglas
On 19 Apr 2012 at 16:30, JS Unkn0wn wrote:

> Yes, my current problem is embedding on Windows, but my requirements
> are the same as compiling to the embedded system, as the primary
> target is with the Arm processor + proprietary OS. The Windows
> compilation is just a temporary set up until my kit arrives. So I have
> planned for the Windows build to work with the same limitations that I
> would be subjected to with the hardware.

Sure I get all this. However, from our list's perspective, all the
embedded processor stuff is a completely separate issue that isn't
important here.

> Until I receive my hardware development kit I am working with a
> Windows substitute environment that provides an OpenGL interface that
> emulates the Pica200 GPU. Though I'm only mentioning that to explain
> why I have to statically link against Python and Boost.Python and have
> no other option.

It's okay, just say you want to statically link everything. No other
explanation needed unless it may cause the bug.

> I have already achieved my goal of statically linking Boost.Python and
> Python (or at least it appears to). My goal right now is to
> successfully compile and run
> "%BOOST_DIR%\libs\python\example\quickstart", as I really like to have
> all of my tools in order and I would not be comfortable knowing that I
> cannot successfully operate my tool.

Firstly, the MSVC toolset is VERY different to the GCC toolset.
You'll find static linking harder on MSVC in general. Secondly, just
because you get it working on MSVC has little to no bearing on
whether it will work on GCC. Thirdly, you are almost certainly
cross-compiling given that target CPU, so just because it works on
GCC or MSVC has not much relevance to whether it will work
cross-compiled. This is because your target system probably is a
partial native POSIX implementation with all sorts of non-POSIX
oddities, whereas GCC emulates a POSIX environment on Windows and
MSVC isn't POSIX at all.

On that basis, I'd strongly suggest you forget about trying this on
Windows. Try it on Linux or BSD instead using GCC. They're both
native POSIX, and if it works there you have some chance it might
work on your target board.

Even better, once you have it working on native Linux or BSD, try
cross compiling to ARM and firing it off to an emulated ARM. Or, if
you can afford it, simply buy an ARM computer outright, install
Debian squeeze and work on that.


Now past all of the above of using the right tool for the job,
probably your errors come from failure to find libraries because the
search paths are screwed up. Try looking into PYTHONPATH or
overriding sys.path in python. If you have no DLL/SO support, python
probably has an __import__ override which is linking in static
libraries by poking them in as an import emulation. That import
override probably isn't very intelligent, and may be getting
confused.

I don't think BPL is even ZIP archive aware/aware of packages and the
package management runtime? That I'm not sure on. If it isn't, and I
suspect it isn't given BPL's age, BPL could well be making an
assumption that module loading always comes from the filing system.
Food for thought anyway.

Niall

--
Technology & Consulting Services - ned Productions Limited.
http://www.nedproductions.biz/. VAT reg: IE 9708311Q.
Work Portfolio: http://careers.stackoverflow.com/nialldouglas/



_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Loading...