Hello,
I am trying to run a macro which compiles some other macros in ROOT (Version 5.34), and some of the header files need C++ 11. I run a script which looks like this:
#!/bin/bash
COMPILE_LOGON=“~/analysis_master/customize_root/compile_logon.C”
root.exe -n $COMPILE_LOGON <<EOF
.L detector.hh++
.q
EOF
Where compile_logon.C is a ROOT macro which looks like this:
{
#include “string”
string ANAHOME=“~/”;
string tmp;
tmp = ANAHOME; tmp += “analysis_master/lib/lib64/root”;
char* inc = gSystem->ExpandPathName(tmp.c_str());
gInterpreter->AddIncludePath(inc);
delete inc;
gSystem->SetMakeSharedLib("g++-std=c++11-c $Opt -I. -I/user/sweeper/develop/unpacker/library/inc -fPIC $IncludePath $SourceFiles ; g++ $ObjectFiles -shared -L/user/sweeper/develop/unpacker/library/src -lSweeperUnpacker -Wl,-rpath=/user/sweeper/develop/unpacker/library/src -Wl,-soname,$LibName.so -m64 -O2 $LinkedLibs -o $SharedLib");
tmp = ANAHOME; tmp += “analysis_master/include”;
char* inc = gSystem->ExpandPathName(tmp.c_str());
gInterpreter->AddIncludePath(inc);
delete inc;
tmp = ANAHOME; tmp += “analysis_master/customize_root”;
char* inc = gSystem->ExpandPathName(tmp.c_str());
char* inc = gSystem->ExpandPathName(“~/analysis_master/customize_root”);
gInterpreter->AddIncludePath(inc);
gInterpreter->AddIncludePath(“/user/sweeper/develop/unpacker/library/inc”);
gSystem->SetFlagsDebug(“-std=c++11”);
gSystem->AddLinkedLibs(“-std=c++11”);
gSystem->SetFlagsOpt(“-std=c++11”);
delete inc;
}
As you can see, we have tried various ways to get the compiler to recognize the “-std=c++11” flag. But when I run it, I get an error which looks like this:
/usr/include/c++/4.9/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the
^
Error: external preprocessing failed. :0:
!!!Removing /user/e15091/analysis_master/src/sweeper_cc_ACLiC_dict.cxx /user/e15091/analysis_master/src/sweeper_cc_ACLiC_dict.h !!!
Error: /mnt/misc/sw/x86_64/Debian/8/root/gnu/5.34.32/bin/rootcint: error loading headers…
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
Info in : The compiler has not found any problem with your macro.
Probably your macro uses something rootcint can’t parse.
Check http://root.cern.ch/viewvc/branches/v5-34-00-patches/cint/doc/limitati.txt for Cint’s limitations.
So despite all of our attempts, it seems like the compiler still doesn’t recognize the C++ 11 flag, and the compilation is failing.
Is there something I can do to get rid of this error?
Thank you.