building tutorial with bjam
I am trying to build the tutorial example showing how to call a c++ function from a python script. When I run bjam I get the following message. I am using MSVC++ 2005 Express Edition. C:/Program Files/boost/boost_1_35_0/tools/build/v2/tools\msvc.jam:263: in confiure-really *** argument error * rule path.make ( native ) * called with: ( ) * missing argument native C:/Program Files/boost/boost_1_35_0/tools/build/v2/util\path.jam:42: see definiton of rule 'make' being called C:/Program Files/boost/boost_1_35_0/tools/build/v2/tools\msvc.jam:141: in confiure C:/Program Files/boost/boost_1_35_0/tools/build/v2/tools\msvc.jam:115: in msvc.init C:/Program Files/boost/boost_1_35_0/tools/build/v2/build\toolset.jam:38: in tooset.using C:/Program Files/boost/boost_1_35_0/tools/build/v2/build\project.jam:828: in usng C:\Documents and Settings\Tony\user-config.jam:2: in modules.load C:/Program Files/boost/boost_1_35_0/tools/build/v2\build-system.jam:240: in load-config C:/Program Files/boost/boost_1_35_0/tools/build/v2\build-system.jam:373: in load-configuration-files C:/Program Files/boost/boost_1_35_0/tools/build/v2\build-system.jam:501: in load C:\Program Files\boost\boost_1_35_0\libs\python\example\..\..\..\tools\build\v2/ kernel\modules.jam:267: in import C:\Program Files\boost\boost_1_35_0\libs\python\example\..\..\..\tools\build\v2/ kernel/bootstrap.jam:132: in boost-build C:\Program Files\boost\boost_1_35_0\libs\python\example\boost-build.jam:7: in module scope C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial> ---------------------------------- I created a user-config.jam file in my home directory. Its contents are below. # MSVC configuration using msvc : 8.0 ; # Python configuration using python : 2.5 : C:/Program Files/Python25 ; ------------------------ I got bjam from boost-jam-3.1.16-1-ntx86. Where should the dll that should be produced go?
AMDG Tony May wrote:
I am trying to build the tutorial example showing how to call a c++ function from a python script. When I run bjam I get the following message. I am using MSVC++ 2005 Express Edition.
Is the compiler in your path? You can either use the Visual Studio Command Prompt or call vsvars32.bat explicitly. In Christ, Steven Watanabe
Steven Watanabe wrote:
AMDG
Tony May wrote:
I am trying to build the tutorial example showing how to call a c++ function from a python script. When I run bjam I get the following message. I am using MSVC++ 2005 Express Edition.
Is the compiler in your path? You can either use the Visual Studio Command Prompt or call vsvars32.bat explicitly.
In almost every case that should make no difference at all; Boost.Build's msvc toolset is designed to do that for you if necessary. It might be instructive to add --debug-configuration to the bjam command line, though. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
AMDG David Abrahams wrote:
Steven Watanabe wrote:
AMDG
Tony May wrote:
I am trying to build the tutorial example showing how to call a c++ function from a python script. When I run bjam I get the following message. I am using MSVC++ 2005 Express Edition.
Is the compiler in your path? You can either use the Visual Studio Command Prompt or call vsvars32.bat explicitly.
In almost every case that should make no difference at all; Boost.Build's msvc toolset is designed to do that for you if necessary. It might be instructive to add --debug-configuration to the bjam command line, though.
Ok. I found the solution using msvc : 8.0express ; just saying 8.0 doesn't work. Grrr. In Christ, Steven Watanabe
Steven Watanabe wrote:
AMDG
David Abrahams wrote:
Steven Watanabe wrote:
AMDG
Tony May wrote:
I am trying to build the tutorial example showing how to call a c++ function from a python script. When I run bjam I get the following message. I am using MSVC++ 2005 Express Edition.
Is the compiler in your path? You can either use the Visual Studio Command Prompt or call vsvars32.bat explicitly.
In almost every case that should make no difference at all; Boost.Build's msvc toolset is designed to do that for you if necessary. It might be instructive to add --debug-configuration to the bjam command line, though.
Ok. I found the solution
using msvc : 8.0express ;
just saying 8.0 doesn't work. Grrr.
Oh, that's an embarrassment for Boost.Build, IMO. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
Thanks for all of the help.
I'm still having a problem with the include file basetsd.h
C:\Program Files\boost\boost_1_35_0\boost/python/detail/wrap_python.hpp(37)
: fatal error C1083: Cannot open include file: 'basetsd.h': No such file or
directory
This file is in C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\Include
I don't know how to specify new directories in the include path using bjam.
----------------
May the peace of Christ be with you.
Tony May
On Tue, Jun 24, 2008 at 10:00 PM, David Abrahams
Steven Watanabe wrote:
AMDG
David Abrahams wrote:
Steven Watanabe wrote:
AMDG
Tony May wrote:
I am trying to build the tutorial example showing how to call a c++ function from a python script. When I run bjam I get the following message. I am using MSVC++ 2005 Express Edition.
Is the compiler in your path? You can either use the Visual Studio Command Prompt or call vsvars32.bat explicitly.
In almost every case that should make no difference at all; Boost.Build's msvc toolset is designed to do that for you if necessary. It might be instructive to add --debug-configuration to the bjam command line, though.
Ok. I found the solution
using msvc : 8.0express ;
just saying 8.0 doesn't work. Grrr.
Oh, that's an embarrassment for Boost.Build, IMO.
-- Dave Abrahams BoostPro Computing http://www.boostpro.com _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi Tony.
I don't know how to specify new directories in the include path using bjam.
Use the <include> feature, e.g. from the command line you do it like this: bjam include=/xxx/yyy/zzz but you usually want to do such things from inside your Jamfile. Best regards, Jurko Gospodnetić
Hi Jurko, Thanks for the help. It said it passed the test: ...patience... ...found 1202 targets... ...updating 3 targets... msvc.link.dll bin\msvc-8.0express\debug\threading-multi\hello_ext.pyd Creating library bin\msvc-8.0express\debug\threading-multi\hello_ext.lib and object bin\msvc-8.0express\debug\threading-multi\hello_ext.exp capture-output bin\hello.test\msvc-8.0express\debug\threading-multi\hello 1 file(s) copied. **passed** bin\hello.test\msvc-8.0express\debug\threading-multi\hello.test ...updated 3 targets... but when I tried to import in the python script: import hello_ext it says: Traceback (most recent call last): File "hello.py", line 6, in <module> import hello_ext ImportError: No module named hello_ext Is there supposed to be a hello_ext.dll in C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial\bin\msvc-8.0express\debug\threading-multi or C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial\bin\hello.test\msvc-8.0express\debug\threading-multi On Wed, Jun 25, 2008 at 11:30 AM, Jurko Gospodnetić < jurko.gospodnetic@docte.hr> wrote:
Hi Tony.
I don't know how to specify new directories in the include path using
bjam.
Use the <include> feature, e.g. from the command line you do it like this:
bjam include=/xxx/yyy/zzz
but you usually want to do such things from inside your Jamfile.
Best regards, Jurko Gospodnetić
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Tony May wrote:
Hi Jurko,
Thanks for the help. It said it passed the test:
...patience... ...found 1202 targets... ...updating 3 targets... msvc.link.dll bin\msvc-8.0express\debug\threading-multi\hello_ext.pyd Creating library bin\msvc-8.0express\debug\threading-multi\hello_ext.lib and object bin\msvc-8.0express\debug\threading-multi\hello_ext.exp capture-output bin\hello.test\msvc-8.0express\debug\threading-multi\hello 1 file(s) copied. **passed** bin\hello.test\msvc-8.0express\debug\threading-multi\hello.test ...updated 3 targets...
but when I tried to import in the python script:
import hello_ext
it says:
Traceback (most recent call last): File "hello.py", line 6, in <module> import hello_ext ImportError: No module named hello_ext
Is there supposed to be a hello_ext.dll in C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial\bin\msvc-8.0express\debug\threading-multi or C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial\bin\hello.test\msvc-8.0express\debug\threading-multi
By default Boost.Build deletes some binaries used in testing when the test passes. try deleting bin\hello.test\msvc-8.0express\debug\threading-multi\hello.test, adding "-d+2" and "--preserve-test-targets" to your bjam command line, and running the test again. Then you can see what it's doing. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
I'm still not able to see a dll. There is a pyd file created and a .lib
file. Should the dll
file be in the same directory and should it be called hello_ext.dll?
C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial>bjam -d+2
--pre
serve-test-targets
warning: Graph library does not contain optional GraphML reader.
note: to enable GraphML support, set EXPAT_INCLUDE and EXPAT_LIBPATH to the
note: directories containing the Expat headers and libraries, respectively.
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(don't panic: this is a strictly optional feature).
file bin\msvc-8.0express\debug\threading-multi\hello_ext.pyd.rsp
"bin\msvc-8.0express\debug\threading-multi\hello.obj"
"C:\Program
Files\boost\boost_1_35_0\bin.v2\libs\python\build\msvc-8.0express\de
bug\threading-multi\boost_python-vc80-mt-gd-1_35.lib"
"python25.lib"
msvc.link.dll bin\msvc-8.0express\debug\threading-multi\hello_ext.pyd
call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
x86 >
nul
link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /subsystem:console
/out:"bin\msvc-8.0ex
press\debug\threading-multi\hello_ext.pyd"
/IMPLIB:"bin\msvc-8.0express\debug\th
reading-multi\hello_ext.lib" /LIBPATH:"C:\Python25\libs"
@"bin\msvc-8.0express
\debug\threading-multi\hello_ext.pyd.rsp"
if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
if exist
"bin\msvc-8.0express\debug\threading-multi\hello_ext.pyd.manife
st" (
mt -nologo -manifest
"bin\msvc-8.0express\debug\threading-multi\hell
o_ext.pyd.manifest"
"-outputresource:bin\msvc-8.0express\debug\threading-multi\h
ello_ext.pyd;2"
)
Creating library bin\msvc-8.0express\debug\threading-multi\hello_ext.lib
and
object bin\msvc-8.0express\debug\threading-multi\hello_ext.exp
capture-output bin\hello.test\msvc-8.0express\debug\threading-multi\hello
set Path=C:\Program
Files\boost\boost_1_35_0\bin.v2\libs\python\build\msvc-8
.0express\debug\threading-multi;C:\Program
Files\boost\boost_1_35_0\libs\python\
example\tutorial\bin\msvc-8.0express\debug\threading-multi;C:\Python25;C:\Python
25\libs;%Path%
set PYTHONPATH=bin\msvc-8.0express\debug\threading-multi
C:\Python25\python "hello.py" >
"bin\hello.test\msvc-8.0express\debug\threadi
ng-multi\hello.output" 2>&1
set status=%ERRORLEVEL%
echo. >>
"bin\hello.test\msvc-8.0express\debug\threading-multi\hello.output"
echo EXIT STATUS: %status% >>
"bin\hello.test\msvc-8.0express\debug\threadin
g-multi\hello.output"
if %status% EQU 0 (
copy
"bin\hello.test\msvc-8.0express\debug\threading-multi\hello.output"
"bin\hello.test\msvc-8.0express\debug\threading-multi\hello"
)
set verbose=0
if %status% NEQ 0 (
set verbose=1
)
if %verbose% EQU 1 (
echo ====== BEGIN OUTPUT ======
type
"bin\hello.test\msvc-8.0express\debug\threading-multi\hello.output"
echo ====== END OUTPUT ======
)
exit %status%
1 file(s) copied.
**passed** bin\hello.test\msvc-8.0express\debug\threading-multi\hello.test
echo passed >
bin\hello.test\msvc-8.0express\debug\threading-multi\hello.tes
t
On Thu, Jun 26, 2008 at 10:59 AM, David Abrahams
Tony May wrote:
Hi Jurko,
Thanks for the help. It said it passed the test:
...patience... ...found 1202 targets... ...updating 3 targets... msvc.link.dll bin\msvc-8.0express\debug\threading-multi\hello_ext.pyd Creating library bin\msvc-8.0express\debug\threading-multi\hello_ext.lib and object bin\msvc-8.0express\debug\threading-multi\hello_ext.exp capture-output bin\hello.test\msvc-8.0express\debug\threading-multi\hello 1 file(s) copied. **passed** bin\hello.test\msvc-8.0express\debug\threading-multi\hello.test ...updated 3 targets...
but when I tried to import in the python script:
import hello_ext
it says:
Traceback (most recent call last): File "hello.py", line 6, in <module> import hello_ext ImportError: No module named hello_ext
Is there supposed to be a hello_ext.dll in C:\Program
Files\boost\boost_1_35_0\libs\python\example\tutorial\bin\msvc-8.0express\debug\threading-multi
or C:\Program
Files\boost\boost_1_35_0\libs\python\example\tutorial\bin\hello.test\msvc-8.0express\debug\threading-multi
By default Boost.Build deletes some binaries used in testing when the test passes.
try deleting bin\hello.test\msvc-8.0express\debug\threading-multi\hello.test, adding "-d+2" and "--preserve-test-targets" to your bjam command line, and running the test again. Then you can see what it's doing.
-- Dave Abrahams BoostPro Computing http://www.boostpro.com _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Tony May wrote:
I'm still not able to see a dll. There is a pyd file created and a .lib file. Should the dll file be in the same directory and should it be called hello_ext.dll?
The .pyd file is the DLL. Python uses a different naming convention for DLLs used as extension modules. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
Thanks, sorry I'm a beginner with Python.
I'm still having trouble importing when I run in Python. The hello world
program
gives the following error about loading the dll.
first the test from running bjam.
...patience...
...found 1915 targets...
...using 1 temp target...
...updating 2 targets...
...using
Tony May wrote:
Thanks, sorry I'm a beginner with Python.
I'm still having trouble importing when I run in Python. The hello world program gives the following error about loading the dll.
first the test from running bjam. ...patience... ...found 1915 targets... ...using 1 temp target... ...updating 2 targets... ...using
hello_ext.pyd... capture-output bin\hello.test\msvc-8.0express\debug\threading-multi\hello 1 file(s) copied. **passed** bin\hello.test\msvc-8.0express\debug\threading-multi\hello.test ...updated 2 targets... then trying to run the script from python I copied the pyd file and the rest of the output dir to c:\python25\dlls
C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial>python hello.py
Traceback (most recent call last): File "hello.py", line 6, in <module> import hello_ext ImportError: DLL load failed: This application has failed to start because the a pplication configuration is incorrect. Reinstalling the application may fix this problem.
Tony, Sorry I can't lead you through the steps here right now. I suggest you post this question on the C++-sig (http://www.boost.org/community/groups.html#cplussig), where more people, who may have more time than I do, know the answers. Better yet, this isn't really a C++-specific question, so you might try the comp.lang.python newsgroup. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
Hi Tony.
I am trying to build the tutorial example showing how to call a c++ function from a python script. When I run bjam I get the following message. I am using MSVC++ 2005 Express Edition.
C:/Program Files/boost/boost_1_35_0/tools /build/v2/tools\msvc.jam:263: in confiure-really *** argument error * rule path.make ( native ) * called with: ( ) * missing argument native C:/Program Files/boost/boost_1_35_0/tools/build/v2/util\path.jam:42: see definiton of rule 'make' being called
What I find real strange here is that your log states 'confiure' instead of 'configure'. Where did this typo come from? Boost Build coming with Boost 1.35.0 release does not have it. What version of Boost Build are you using?
I created a user-config.jam file in my home directory. Its contents are below.
# MSVC configuration using msvc : 8.0 ;
# Python configuration using python : 2.5 : C:/Program Files/Python25 ;
One thing that could likely go wrong with this is that the python path you listed contains spaces but you do not quote it. You should most likely rewrite that last line as:
using python : 2.5 : "C:/Program Files/Python25" ;
Hope this helps. Best regards, Jurko Gospodnetić
participants (4)
-
David Abrahams
-
Jurko Gospodnetić
-
Steven Watanabe
-
Tony May