Boost logo

Boost-Build :

Subject: Re: [Boost-build] Problem with Intel compiler and pch support
From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-10-26 07:20:28


[Adding list to CC]

On Sunday 26 October 2008 13:42:24 John Maddock wrote:
> Vladimir Prus wrote:
> >> For intel-linux, can you try the attached? It produces the following
> >> commands:
> >>
> >> intel-linux.compile.c++.pch bin/intel-linux/debug/include/pch.hpp.pch
> >>
> >> "icpc" -x c++-header -O0 -g -Ob0 -w1 -fPIC
> >> -DBOOST_BUILD_PCH_ENABLED -I"include" -c -create_pch
> >> "bin/intel-linux/debug/include/pch.hpp.pch" "include/pch.hpp"
> >>
> >> intel-linux.compile.c++ bin/intel-linux/debug/hello_world.o
> >>
> >> "icpc" -c -xc++ -O0 -g -Ob0 -w1 -fPIC -DBOOST_BUILD_PCH_ENABLED
> >> -I"include" "-use_pch "<pbin/intel-linux/debug>include/pch.hpp.pch
> >> -c -o "bin/intel-linux/debug/hello_world.o" "source/hello_world.cpp"
> >>
> >> I'm not exactly sure how right is this -- hopefully you can tell
> >> what changes to the command line should be made?
>
> The file extension should be .pchi again, but more importantly the name of
> the pch file passed to -use_pch is wrong:
>
> <pbin/intel-linux/debug>include/pch.hpp.pch
>
> Shouldn't have the angle brackets in there, but I can't see where they're
> coming from?

It's coming from bjam name of the target corresponding to PCH file, passed
in the PCH_FILE variable. Unless the action say it wants to use it as file,
it's not resolved into a filepath and remains string name of the target.

With the attached patch I get output like:

intel-linux.compile.c++.pch bin/intel-linux/debug/include/pch.hpp.pchi

    "icpc" -x c++-header -O0 -g -Ob0 -w1 -fPIC -DBOOST_BUILD_PCH_ENABLED -I"include" -c -create_pch "bin/intel-linux/debug/include/pch.hpp.pchi" "include/pch.hpp"

intel-linux.compile.c++ bin/intel-linux/debug/hello_world.o

    "icpc" -c -xc++ -O0 -g -Ob0 -w1 -fPIC -DBOOST_BUILD_PCH_ENABLED -I"include" "-use_pch "bin/intel-linux/debug/include/pch.hpp.pchi -c -o "bin/intel-linux/debug/hello_world.o" "source/hello_world.cpp"

Is it gonna work? Can you actually try to tools/build/v2/example/pch example?

The thing that I think might break is compiling a hpp into pchi with "-x c++-header" option.
Is that how it should work? Is intel-linux really uses msvc model where you compile .cpp into .o
and as a side effect, PCH is produced? I could not really tell from the link you've sent.

Thanks,
Volodya




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