[Scons-users] scons and clang++
Florian Lindner
mailinglists at xgm.de
Fri Jul 18 04:00:37 EDT 2014
Gary Oberbrunner wrote:
> There isn't any magic; it still seems to me likely it's something in your
> shell environment (not construction environment). You're sure you did
> env['ENV'] = os.environ after constructing the environment?
This is the code I use http://pastebin.com/GrJ2SFTu
I am currently trying it with env['ENV'] = os.environ but on production code
I rather want to keep it out to have a sane build environment.
> Is this
> causing failures in the main part of your build, or just in SConf (i.e.
> Configure())?
>
> I don't see a call to env = conf.Finish() after your Configure() call; is
> that just a cut/paste problem or is it really missing? See the man page
> under Configure Contexts for how to use Configure(). All of your
> configure checks should be between Configure() and conf.Finish().
env = conf.Finish() is at line 262, conf = Configure(env) at line 74.
Right after line 74 I placed the env['ENV'] = os.environ.
It works until the linking stage when using this command line
PRECICE_MPI_LIB=mpi PRECICE_MPI_INC_PATH=/usr/include/openmpi
PRECICE_MPI_LIB_PATH=/usr/lib/openmpi scons boost_inst=True compiler=clang
It prints tons of linking errors which I think are because it does not find
the STL libraries. When I take the linking command and replace clang with
clang++ the STL linking errors vanish, but threre are still some boost
linking errors.
As soon as I uncomment like 173 or 174 which adds a CCFLAGS scons fails
before starting the compilation with not finding the C++ header
boost/array.hpp.
When explicitely set env["CXX"] = "clang++" (in line 173) it works until
these boost errors at the linking stage. But when I modify my script to
allow clang++ been set from the command line scons fails before compilation.
EDIT: Ok, it seems to be working now. I'm still not exactly sure what the
problem was. One thing was that I had a type in the boost_inst command line
variable. Still, I don't know why scons wa acting so differently on clang,
clang++ and g++.
Best Regards,
Florian
> I suggest trying a simple SConstruct without using Configure() and see if
> that works.
>
>
>
> On Thu, Jul 17, 2014 at 7:29 AM, Florian Lindner <mailinglists at xgm.de>
> wrote:
>
>> Hello,
>>
>> I find scons more and more confusing when it comes to clang interaction.
>>
>> It seems scons is doing some magic when env["CXX"] = "clang". Magic it
>> does not do, when CXX = clang++. Therefore it seems to work only when you
>> set your compiler to clang.
>>
>> It works fine as long as I don't add any CCFLAGS to the environment. But
>> as soon as I use clang and add the line
>>
>> env.Append(CCFLAGS = ["-stdlib=libc++"])
>>
>> it fails with not finding boost/array.hpp which actually is in
>> /usr/include/boost/array.hpp.
>>
>> When I uncomment this line above it finds it.
>>
>> Anybody can shed some light on this for me?
>>
>> Regards,
>> Florian
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> http://four.pairlist.net/mailman/listinfo/scons-users
>>
>
>
>
More information about the Scons-users
mailing list