[Halld-offline] Fwd: c++11 compilation error

Shepherd, Matthew mashephe at indiana.edu
Tue Jun 21 07:03:25 EDT 2016


David,

Thanks so much for the quick answer - that worked.  (And thanks for answering my question even though I didn't post to Google groups.)

Indeed the SConstruct file was missing that first line in the env declaration.  Was that previously a default for Hall D software and then only added later?

Matt

This was the fix:

[mashephe at h2 pi0g_incl]$ diff SConstruct~ SConstruct
42c42,43
< env = Environment(    CPPPATH = [include],
---
> env = Environment(    ENV = os.environ,
> 		      CPPPATH = [include],


---------------------------------------------------------------------
Matthew Shepherd, Associate Professor
Department of Physics, Indiana University, Swain West 265
727 East Third Street, Bloomington, IN 47405

Office Phone:  +1 812 856 5808

> On Jun 21, 2016, at 6:57 AM, David Lawrence <davidl at jlab.org> wrote:
> 
> Hi Matt,
> 
>   One possibility is if your default environment doesn’t place the C++11 compliant compiler in
> your PATH. Older SConstruct files don’t pull in your PATH environment so when it runs g++,
> it is not running the one in your current shell. Your SConstruct should have something that looks
> like this:
> 
> env = Environment(        ENV = os.environ,  # Bring in full environment, including PATH
>                       CPPPATH = [include],
>                       LIBPATH = ["%s/%s/lib" %(halld_home, osname)],  # n.b. add HALLD_HOME here and prepend HALLD_MY below
>                   variant_dir = ".%s" % (osname))
> 
> That first argument with “os.environ” is critical.
> 
> Regards,
> -David
> 
> 
>> On Jun 21, 2016, at 6:51 AM, Shepherd, Matthew <mashephe at indiana.edu> wrote:
>> 
>> 
>> Tried posting to google groups but got bounced, then joined the group and the message still bounced... I might help to get help...
>> 
>>> Begin forwarded message:
>>> 
>>> From: "Shepherd, Matthew" <mashephe at indiana.edu>
>>> Subject: c++11 compilation error
>>> Date: June 21, 2016 at 6:48:54 AM EDT
>>> To: gluex-software at googlegroups.com
>>> 
>>> 
>>> Hi all,
>>> 
>>> I'm having trouble with compiler flags when building a plugin.  The problem seems to be with the option:  -std="c++11" that is generated by root-config.  It seems the compiler I use supports this option, and I can't figured out why this is causing an error.  Any help/ideas?
>>> 
>>> Thanks!
>>> 
>>> [mashephe at h1 pi0g_incl]$ gcc --version
>>> gcc (GCC) 4.9.2
>>> Copyright (C) 2014 Free Software Foundation, Inc.
>>> This is free software; see the source for copying conditions.  There is NO
>>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>> 
>>> [mashephe at h1 pi0g_incl]$ scons SHOWBUILD=1
>>> scons: Reading SConscript files ...
>>> looking for sbms_Linux.py
>>> No module named sbms_Linux
>>> looking for sbms_build.py
>>> No module named sbms_build
>>> scons: done reading SConscript files.
>>> scons: Building targets ...
>>> g++ -o DCustomAction_pi0g_incl.os -c -g -fPIC -Wall -std=c++11 -DHAVE_CCDB -DHAVE_EVIO -fPIC -pthread -Wno-deprecated-declarations -m64 -fPIC -I. -I/gpfs/home/m/a/mashephe/Karst/gluex/gluex_offline/sim-recon/sim-recon-recon-2016_02-ver01/src -I/gpfs/home/m/a/mashephe/Karst/gluex/gluex_offline/sim-recon/sim-recon-recon-2016_02-ver01/src/libraries -I/gpfs/home/m/a/mashephe/Karst/gluex/gluex_offline/sim-recon/sim-recon-recon-2016_02-ver01/src/libraries/include -I/N/u/mashephe/Karst/gluex/my_src/src -I/N/u/mashephe/Karst/gluex/my_src/src/libraries -I/N/u/mashephe/Karst/gluex/my_src/src/libraries/include -I/gpfs/home/m/a/mashephe/Karst/gluex/gluex_offline/sim-recon/sim-recon-recon-2016_02-ver01/build/include -Iexternal/xstream/include -I/gpfs/home/m/a/mashephe/Karst/root/include -I/gpfs/home/m/a/mashephe/Karst/gluex/gluex_offline/jana/jana_0.7.5p2/Linux_RH-x86_64-gcc4.9.2/include -I/N/u/mashephe/Karst/gluex/gluex_offline/ccdb/ccdb_1.06.01/include -I/N/u/mashephe/Karst/gluex/glu!
>> ex_offline/hdds/hdds-recon-2016_02-ver01/build/src -I/N/u/mashephe/Karst/gluex/gluex_offline/xerces-c/xerces-c-3.1.2/include -I/N/u/mashephe/Karst/gluex/gluex_offline/evio/evio-4.3.1/Linux-x86_64/include DCustomAction_pi0g_incl.cc
>>> cc1plus: error: unrecognized command line option "-std=c++11"
>>> scons: *** [DCustomAction_pi0g_incl.os] Error 1
>>> scons: building terminated because of errors.
>>> 
>>> ---------------------------------------------------------------------
>>> Matthew Shepherd, Associate Professor
>>> Department of Physics, Indiana University, Swain West 265
>>> 727 East Third Street, Bloomington, IN 47405
>>> 
>>> Office Phone:  +1 812 856 5808
>>> 
>> 
>> 
>> _______________________________________________
>> Halld-offline mailing list
>> Halld-offline at jlab.org
>> https://mailman.jlab.org/mailman/listinfo/halld-offline
> 





More information about the Halld-offline mailing list