Boost logo

Boost-Build :

Subject: [Boost-build] Boost.Build: Strange behavior with use-project
From: Raphael Walker (web_at_[hidden])
Date: 2011-09-28 16:42:19


Hello all,

Working on:
-----------

Platforms: Linux rhel64-build 2.6.18-274.el5, win7_64
Compiler: - g++44 (GCC) 4.4.4 20100726 (Red Hat 4.4.4-13),
           - Microsoft Visual Studio 9.0
Boost versions: - 1.45.0 -> works fine
                  - 1.46.0 -> fails
                  - 1.47.0 -> fails

Trying to run a unit-test with Boost.Build failed.
So I set up a simple example to find the problem.

The error only occurs when having targets in two different directories.
The first directory "src" has the library and the second one "test" the
unit-test depending on the library from "" directory. and there is a
external header file in "include".

The problem seems to be with the "use-project" rule.
If I remove the definition the example compiles correct. Uncomment the
"use-project" rule shows up the problem.
Compiling on the project level (where Jamroot is) works fine too.

Here are the different outputs I get from my example. Only tested on linux.

"use-project" commented out in Jamroot:
---------------------------------------

e.g.:
app/test> bjam release -n

  "g++44" <some statements> -I"../../include" -I"../src"
-I"/home/even/bb_test2/boost_1_47_0" -c -o
"../../bin/app/src/gcc-4.4/release/node.o" "../src/node.cpp"

Works fine:
  * the library gets the requirements and includes from the project root
  * includes are correctly set
  * build-dir is correctly set

"use-project" enabled in Jamroot:
---------------------------------

e.g.:
app/test> bjam release -n

"g++44" <some statements> -I"../../app/src" -c -o
"../../app/src/bin/gcc-4.4/release/node.o" "../../app/src/node.cpp"

  * the library doesn't have the requirements and variables from the root
  * includes missing
  * build-dir wrong

To reproduce the error:
=======================

Extract sources "bb_test.tar.gz" and unpack boost_1_47 in "bb_test" or
fix "boost-build.jam".

bb_test> cd app/test
bb_test/app/test> bjam release
...patience...
...found 1333 targets...
...updating 8 targets...
common.mkdir ../../bin/app/src
common.mkdir ../../bin/app/src/gcc-4.4
common.mkdir ../../bin/app/src/gcc-4.4/release
gcc.compile.c++ ../../bin/app/src/gcc-4.4/release/node.o
gcc.link.dll ../../bin/app/src/gcc-4.4/release/libnode.so
gcc.link ../../bin/app/test/node_test.test/gcc-4.4/release/node_test
testing.capture-output
../../bin/app/test/node_test.test/gcc-4.4/release/node_test.run
**passed** ../../bin/app/test/node_test.test/gcc-4.4/release/node_test.test
...updated 8 targets...

Uncomment "use_project" in "Jamroot"
use-project app/src : app/src ;

bb_test> cd app/test
bb_test/app/test> bjam release
In file included from ../../app/src/node.cpp:1:
../../app/src/node.h:1:22: error: dep/some.h: No such file or directory
In file included from ../../app/src/node.cpp:1:
../../app/src/node.h:11: error: âfloat_typeâ does not name a type
../../app/src/node.cpp: In constructor ânode::node()â:
../../app/src/node.cpp:4: error: class ânodeâ does not have any field
named âxâ
../../app/src/node.cpp: At global scope:
../../app/src/node.cpp:6: error: âfloat_typeâ has not been declared
../../app/src/node.cpp:6: error: prototype for ânode::node(int, int)â
does not match any in class ânodeâ
../../app/src/node.h:3: error: candidates are: node::node(const node&)
../../app/src/node.h:6: error: node::node(int, double)
../../app/src/node.cpp:3: error: node::node()

     "g++44" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline
-Wall -fPIC -DNDEBUG -I"../../app/src" -c -o
"../../app/src/bin/gcc-4.4/release/node.o" "../../app/src/node.cpp"

-> compiling on Jamroot level works fine!!!
bb_test> bjam release app/test

Please can somebody reproduce it and give a hint whats going wrong.

Regards,
Raphael

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



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