Fwd: configure Jamfile boost 1_63_0 tutorial to build from command line with bjam

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

Fwd: configure Jamfile boost 1_63_0 tutorial to build from command line with bjam

Boost - Users mailing list

I´m totally new to boost, I just downloaded boost_1_63_0 and I´m trying to build the tutorial example located in \boost_1_63_0\libs\python\example\tutorial by following the tutorial documentationhttp://www.boost.org/doc/libs/1_62_0/libs/python/doc/html/tutorial/index.html

The example is quite simple: it only contains 4 files:

  1. hello.cpp
  2. hello.py
  3. Jamfile
  4. ../Jamroot

For simplicity I´m pasting below the content of each file :

    // hello.cpp

    #include <boost/python/module.hpp>
    #include <boost/python/def.hpp>

    char const* greet()
       return "hello, world";

        using namespace boost::python;
        def("greet", greet);

    // hello.py

    import hello_ext

And finally the boost configuration file:

    // Jamfile

    import python ;

    project tutorial
      : requirements

    python-extension hello_ext : hello.cpp ;

    run-test hello : hello_ext hello.py ;

    alias test : hello ;
    explicit test ;

// ../Jamroot

import python ;

if ! [ python.configured ]
  ECHO "warning: no Python configured in user-config.jam" ;
  ECHO "warning: will use default configuration" ;
  using python ;

# Adjust the following if Boost.Python isn't installed in a default location
lib boost_python ;

  : requirements
#    <include>/path/to/boost/python

rule run-test ( test-name : sources + )
  import testing ;
  testing.make-test run-pyd : $(sources) : : $(test-name) ;

build-project quickstart ;
build-project tutorial ;
if [ python.numpy ]
  build-project numpy ;

When I execute bjam.exe from my cmd prompt (after properly adding in the environment variables the path where bjam.exe is located) I get the following errors:

...found 12 targets...
...updating 5 targets...
compile-c-c++ hello.obj
hello.cpp(7) : fatal error C1083: Cannot open include file: 'boost/python/module.hpp': No such file or directory

    call "C:\Users\...\AppData\Local\Temp\b2_msvc_11.0_vcvarsall_x86.cmd" >nul
cl /Zm800 -nologo @"hello.obj.rsp"

...failed compile-c-c++ hello.obj...
...skipped <p.>hello_ext.pyd for lack of <p.>hello.obj...
...skipped <p.>hello_ext.pdb for lack of <p.>hello.obj...
...skipped <p.>hello for lack of <p.>hello_ext.pyd...
...failed updating 1 target...
...skipped 4 targets...

When I try and build the project from VS2012 I can build it properly because i know hot to add additional include libraries to the project, but I cannot find the proper way to config the Jamfile to make it build from command line.

I tried to config the Jamroot file by changing the path to the boost/python libraries local path but with no luck.

I wonder where and how should I add the absoulute path of the boost/python libraries.

Any help would be much appreciated

Thanks in advance!

Boost-users mailing list
[hidden email]