SampleAnalyzer fails to compile with clang

Bug #1250337 reported by Yi Cai
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MadAnalysis 5
Fix Released
Medium
Benjamin Fuks

Bug Description

Hi,

With the latest version of MacOsX 'mavericks' and xcode, we found that MadAnalysis (1.19) does not
compile when compiling with clang.

Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

The errors are found in DataFormat/ParticleBaseFormat.h line 207
because the operator * is returning a double (the dot product) and there is no double constructor for the class.
In gcc this does not produce a compiling error but we think is a bug.

We added a
  ParticleBaseFormat(double)
  { }

and fixed that problem but it failed with the following errors:

c -o JetClustering/cTagger.o JetClustering/cTagger.cpp
JetClustering/TauTagger.cpp:136:33: error: calling a private constructor of class 'std::__1::__wrap_iter<MA5::RecJetFormat *>'
    myEvent.rec()->jets().erase((std::vector<RecJetFormat>::iterator) Candidates[i-1]);
                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:1187:31: note: declared private here
    _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
                              ^
JetClustering/TauTagger.cpp:219:33: error: calling a private constructor of class 'std::__1::__wrap_iter<MA5::RecJetFormat *>'
    myEvent.rec()->jets().erase((std::vector<RecJetFormat>::iterator) Taus[j-1]);
                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:1187:31: note: declared private here
    _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
                              ^
c++ -Wall -O3 -pthread -stdlib=libc++ -m64 -I/usr/local/include/root -I./../ -DZIP_USE -c -o Plot/Histo.o Plot/Histo.cpp
2 errors generated.
make: *** [JetClustering/TauTagger.o] Error 1

Could you please let us know what we could do to fix the problem?

Cheers,
Yi Cai and Aldo Saavedra

Revision history for this message
Benjamin Fuks (fuks) wrote :

Hi Yi and Aldo,

The problem is due to a change in the default c++ libraries in macos, and arise in v10.9 and more recent versions. This will be fixed with version 1.5.10 of madanalysis. 5. I will let you know when the patch will be available.

Cheers,

Benjamin

Changed in madanalysis5:
assignee: nobody → Benjamin Fuks (fuks)
importance: Undecided → Medium
milestone: none → v1.1.10
status: New → In Progress
Revision history for this message
Benjamin Fuks (fuks) wrote :

Hi Yi and Aldo,

MadAnalysis is not supposed to use clang in principle, since it has only be validated in the context of the g++ compiler. This will be fixed in v1.1.10. You can download the beta version here:
  https://code.launchpad.net/~ma5/madanalysis5/v1.1.10beta
where the fix is implemented.

Cheers,

Benjamin

Changed in madanalysis5:
status: In Progress → Fix Committed
Benjamin Fuks (fuks)
Changed in madanalysis5:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.