Boost logo

Boost-Build :

Subject: [Boost-build] Help me decode this error message
From: Anthony Foglia (AFoglia_at_[hidden])
Date: 2009-06-11 16:30:30


        Here's an error I'm getting from bjam -a :

--- begin error ---

/usr/share/boost-build/kernel/class.jam:93: in new
*** argument error
* rule object(searched-lib-target)@60.__init__ ( name : project : shared
? : search * : action )
* called with: ( : object(project-target)@35 : true : /usr/lib :
object(null-action)@59 : : : : )
* missing argument name
/usr/share/boost-build/tools/builtin.jam:341:see definition of rule
'__init__' being called
/usr/share/boost-build/tools/builtin.jam:575: in searched-lib-generator.run
/usr/share/boost-build/tools/unix.jam:113: in
object(unix-searched-lib-generator)@21.run
/usr/share/boost-build/build/generators.jam:840: in try-one-generator-really
/usr/share/boost-build/build/generators.jam:902: in try-one-generator
/usr/share/boost-build/build/generators.jam:1110: in construct-really
/usr/share/boost-build/build/generators.jam:1186: in generators.construct
/usr/share/boost-build/tools/builtin.jam:481: in object(lib-generator)@5.run
/usr/share/boost-build/build/generators.jam:840: in try-one-generator-really
/usr/share/boost-build/build/generators.jam:902: in try-one-generator
/usr/share/boost-build/build/generators.jam:1110: in construct-really
/usr/share/boost-build/build/generators.jam:1186: in generators.construct
/usr/share/boost-build/build/targets.jam:1408: in construct
/usr/share/boost-build/build/targets.jam:1252: in
object(typed-target)@40.generate
/usr/share/boost-build/build/targets.jam:765: in generate-really
/usr/share/boost-build/build/targets.jam:738: in
object(main-target)@52.generate
/usr/share/boost-build/build/targets.jam:895: in
targets.generate-from-reference
/usr/share/boost-build/build/targets.jam:1170: in generate-dependencies
/usr/share/boost-build/build/targets.jam:1224: in
object(typed-target)@41.generate
/usr/share/boost-build/build/targets.jam:765: in generate-really
/usr/share/boost-build/build/targets.jam:738: in
object(main-target)@45.generate
/usr/share/boost-build/build/targets.jam:255: in
object(project-target)@33.generate
/usr/share/boost-build/build-system.jam:414: in load
/usr/share/boost-build/kernel/modules.jam:261: in import
/usr/share/boost-build/kernel/bootstrap.jam:132: in boost-build
/usr/share/boost-build/boost-build.jam:1: in module scope

---- end error ----

which is almost the platonic ideal of unhelpful. Here's my Jamroot:

--- begin Jamroot ---
import ./sysdefs ;

exe filesystem-test
    : filesystem_test.cpp
      /sysdefs//boost-filesystem
    ;
---- end Jamroot ----

The error is obviously coming from the included file sysdefs.jam

--- begin sysdefs.jam ---
import project ;
project.initialize $(__name__) ;
project sysdefs ;

# In the work-around for boost libraries compiled with gcc42 on
# bulb and gcc42 on tulip, because boost by default adds compilier
# extension to name.
import path ;

#################################################################
# Directory Names + misc
#################################################################

sysdefs-boost-dir = /usr ;

#
# Use lib64 subdirectory for libraries if it exists.
# (Override by setting sysdefs-boost-lib-dir.)
#
if ( ! $(sysdefs-boost-lib-dir) )
{
    if ( [ path.exists $(sysdefs-boost-dir)/lib64 ] )
    {
       sysdefs-boost-lib-dir = $(sysdefs-boost-dir)/lib64 ;
    }
    else
    {
       sysdefs-boost-lib-dir = $(sysdefs-boost-dir)/lib ;
    }
}

#################################################################
# Boost libraries
#################################################################

# Deal with the combinatorial complexity of the boost libraries,
# for which we have:
# 1) Debug and release versions
# 2) Single and multi-threaded version
# 3) 64-bit and 32 bit versions
# Also, we avoid adding the boost includes and library directories
# to the search path multiple times.

alias boost-headers : : : : #FOR: boost headers
       <include>$(sysdefs-boost-dir)/include ;

#deprecated
alias sysdefs-boost-search : : : : ;
#alias sysdefs-boost-search : : : :
# <search>$(sysdefs-boost-dir)/lib ;

rule sysdefs-boost-lib-deps ( lib-name-root : properties * )
{
# echo "lib-name-root: " $(lib-name-root) ;
# echo "properties: " $(properties) ;
    local name = $(lib-name-root)-$(sysdefs-boost-compiler-extension) ;

    if ( <threading>multi in $(properties)
             || $(lib-name-root) = boost_thread )
    {
       name = $(name)-mt ;
    }

    if ( <variant>debug in $(properties) )
    {
       name = $(name)-d ;
    }

    local result = "<name>$(name)" ;

    if ( <address-model>32 in $(properties) )
    {
       result += "<search>$(sysdefs-boost-dir-32bit)/lib" ;
    }
    else
    {
      result += "<search>$(sysdefs-boost-dir)/lib" ;
    }

    return $(result) ;
}

rule sysdefs-boost-filesystem-deps ( properties * )
{
# echo "properties: " $(properties) ;
    return [ sysdefs-boost-lib-deps "boost_filesystem" : $(properties) ] ;
}

# echo [ sysdefs-boost-filesystem-deps ] ;

lib boost-filesystem #FOR: directories and files
    : boost-headers sysdefs-boost-search
    : <conditional>@sysdefs-boost-filesystem-deps
    ;

---- end sysdefs.jam ----

        This basic sysdefs was working with in a previous version of our
repository. I made some changes a few months which I just realized
broke the library lookups (e.g. it would always look for and link to
single threaded, even when compiling with threading=multi). To fix
that, I started with this old version, and got this nonsensical error
message above. I pruned down the project to this minimal Jamroot and
sysdefs.jam file and one .cpp file.

        My goal was to slowly replace this logic with that in contrib/boost.jam
and learn more about boost-build.

-- 
Anthony Foglia
Princeton Consultants
(609) 987-8787 x233

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk