[C++-sig] Re: help building hello world example on Debian
Faheem Mitha
faheem at email.unc.edu
Fri Apr 16 08:31:39 CEST 2004
On Tue, 13 Apr 2004 08:37:57 -0400, David Abrahams
<dave at boost-consulting.com> wrote:
> ??? You seem to have said tools/build/v1/ is missing?
Missing in the packages. Not missing in the source.
> Uh, sorry, that might be good for someone who downloads a Debian
> installation including prebuilt libraries, but it's no good for
> someone who downloads a Boost release. See the updated building.html
> page I pointed at:
>
> <p>
> The <tt>libs/python/example/</tt> project we're going to build is
> set up to automatically rebuild the Boost.Python library in place
> whenever it's out-of-date rather than just reusing an existing
> library, so you'll also need the Boost.Python library sources in
> <tt>boost/python/src/</tt>.
> </p>
I'm hoping this is not compulsory, else I am in trouble.
>> If people have questions, they will email the relevant free software
>> project's mailing list as I am doing now, not a RedHat mailing list
>> (or whatever).
>
> I wouldn't count on it. People email whoever they think is
> responsible for their problems. Note that you came here about working
> with your Debian package ;-)
Yes, but there was no documentation included (no example or anything)
on how to build boost.python extensions specifically on Debian. I'm
trying to correct this (see below).
>> 1) Try moving the /tools/build/v1 directory out of the sources and
>> seeing whether I can still build a hello world extension.
I'm trying to do this, but getting error messages I don't
understand. The hello.cpp referred to is the one in the
tutorial. Please tell me your best guess as to what I am doing wrong.
I have a directory containing build-boost.jam, Jamrules, Jamfile, and
hello.cpp. All but hello.cpp are given below.
The error (on typing bjam followed by pretty much anything) is
--------------------------------------------------------------------
faheem ~/wc/boost-build-files>bjam
syntax error at EOF
/usr/local/lib/boost/tools/build/v1/boost-base.jam:934: in
fixup-path-properties
*** argument error
* rule root-paths ( paths * : root )
* called with: ( <sysinclude> : )
* missing argument root
/usr/local/lib/boost/tools/build/v1/allyourbase.jam:1441:see
definition of rule 'root-paths' being called
/usr/local/lib/boost/tools/build/v1/boost-base.jam:1199: in
expand-build-request
/usr/local/lib/boost/tools/build/v1/boost-base.jam:1963: in
expand-target-subvariants
/usr/local/lib/boost/tools/build/v1/boost-base.jam:2002: in
main-target
/usr/local/lib/boost/tools/build/v1/boost-base.jam:1349: in
declare-local-target
/usr/local/lib/boost/tools/build/v1/python.jam:438: in extension
Jamfile:18: in load-jamfiles
/usr/local/lib/boost/tools/build/v1/bootstrap.jam:15: in boost-build
/home/faheem/wc/boost-build-files/boost-build.jam:7: in module scope
---------------------------------------------------------------------
Thanks. Faheem.
**********************************************************************
boost-build.jam
**********************************************************************
# Copyright David Abrahams 2003. See accompanying LICENSE for terms
# and conditions of use.
# Edit this path to point at the tools/build/v1 subdirectory of your
# Boost installation. Absolute paths work, too.
#boost-build ../../../tools/build/v1 ;
boost-build /usr/local/lib/boost/tools/build/v1 ;
**********************************************************************
**********************************************************************
Jamrules
**********************************************************************
# Copyright David Abrahams 2003. See accompanying LICENSE for terms
# and conditions of use.
# If you move this example from its place in the Boost tree, edit this
# path to point at the root directory of your Boost installation (the
# one containing a subdirectory called "boost/" and a sub-subdirectory
# "boost/python/" full of .hpp files). Absolute paths work, too.
#
#path-global BOOST_ROOT : ../../.. ;
path-global BOOST_ROOT : /usr/include ;
# Boost.Python configuration variables, as described in
# http://www.boost.org/libs/python/doc/building.html#configuration.
# Usually you don't need to set these; the defaults will work. If you
# do set them, try to change as few of them as possible, starting with
# the first ones.
# PYTHON_VERSION = <the two-part Major.Minor version number,
e.g. 2.2> ;
path-global PYTHON VERSION : 2.3 ;
# PYTHON_ROOT = <root directory of your Python installation,
e.g. /usr> ;
path-global PYTHON_ROOT : /usr ;
# PYTHON_INCLUDES = <path to Python #include directories> ;
# PYTHON_LIB_PATH = <path to Python library object> ;
# You may need to configure your compiler toolset, especially if you
# want to build with a compiler that is not the "system default" or if
# it is installed in a nonstandard place; see
# http://www.boost.org/more/getting_started.html#Configuring for
# details.
# Makes a project id for boost so that other Boost.Build projects can
# refer to it by name.
#
# project boost : $(BOOST_ROOT) ;
# Change this setting to have all your built products placed under a
# single directory:
#
# ALL_LOCATE_TARGET = <root directory for all built products>
ALL_LOCATE_TARGET = .
**********************************************************************
**********************************************************************
Jamfile
**********************************************************************
# Daniel Holth <dholth at fastmail.fm>, 2004
# based on David Abraham's example from Boost.Python
# This file is not important unless you want to use boost-jam;
# bjam -sBUILD=release builds a smaller binary than setup.py
# This is the top of our own project tree
project-root ;
import python ;
include python.jam ;
# The Python extension
extension hello
: # sources
hello.cpp
: # requirements
<find-library>boost_python
;
**********************************************************************
More information about the Cplusplus-sig
mailing list