Dear root support,
I’ve successfully build a macro locally on my laptop against root and roounfold and run it.
For larger data processing I need to run it now remote on a tier 2 machine. I have problems compiling it. I work in a so called cms envirnoment.
locally I compile it against root and roounfold with clang (on macbook with XTools):
Local software on mac:
clang -v
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.6.0
Thread model: posix
root: root-6.05.02/
roofunfold: RooUnfold-1.1.1
I try to use compile on tier2 (in cms environment) against:
root: 5.32.00
roofunfold: RooUnfold-1.1.1
gcc: gcc472
(for futher info, I put output of printenv in attachment)
The compiler gives the following errors about the root Clone function and Copy function (it complains many times about copy, I do this often):
UnfoldMC_RedChiBackSmeared.cc:277:49: error: invalid conversion from ‘TObject*’ to ‘TH1F*’ [-fpermissive]
In file included from /cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_32/external/slc6_amd64_gcc472/bin/…/…/…/…/…/…/lcg/root/5.32.00-cms/include/TH1F.h:25:0,
from UnfoldMC_RedChiBackSmeared.cc:16:
/cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_32/external/slc6_amd64_gcc472/bin/…/…/…/…/…/…/lcg/root/5.32.00-cms/include/TH1.h:124:21: error: ‘virtual void TH1::Copy(TObject&) const’ is protected
UnfoldMC_RedChiBackSmeared.cc:318:31: error: within this context
THis are the offending terms in the code:
277:
TH1F* fakecheck=scaledfakes->Clone(“fakecheck”);
//line 318
TH1F* FakeS=new TH1F();
scaledfakes->Copy(*FakeS);
Perturb1DHisto(FakeS);
My compiler flags (I’ve made sure header path and LDFLAGS point to correct include and library dirs):
CXXFLAGS+=(shell root-config --cflags) -Wall -I(HeaderPath) -ggdb3 -fPIC -Wno-overloaded-virtual -Wno-unused-variable
LDFLAGS+=-L$(libUnfold) -ggdb3
LDFLAGS+=$(shell root-config --glibs) -ggdb3
Build
all:
(CXX) -g UnfoldMC_RedChiBackSmeared.cc (CXXFLAGS) < (LDFLAGS) -o UnfoldMC_RedChiBackSmeared
Strangely, when I start root and load the libraries (gSystem->Load()) I can compile and run the macro. I would prefer to be able to compile it standalone though (my normal way of working…)
Cheers
Merijn
PS: I’ve also tried to do it without the cms environment, just using
/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/external/gcc/4.9.3/bin/gcc
as compiler.
compiled root v5-32-01 with it, but now roounfold won’t compile:
/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/external/gcc/4.9.3/include/c++/4.9.3/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.
/storage_mnt/storage/user/mvandekl/UnfoldingPlay/NothingPreset/RooUnfold-1.1.1/src/RooUnfoldSvd.cxx: In member function ‘virtual void RooUnfoldSvd::Streamer(TBuffer&)’:
/storage_mnt/storage/user/mvandekl/UnfoldingPlay/NothingPreset/RooUnfold-1.1.1/src/RooUnfoldSvd.cxx:225:11: error: invalid use of incomplete type ‘class TBuffer’
if (R__b.IsReading()) {
^
retried with first setting:
export CXXFLAGS+=’-stdlib=libc++ -std=c++11 -m64’
But didn’t solve it. Aside the buffer issue seems hard to get around. Any idea?
printenv.txt (25 KB)