Compiling ROOT with Clang++ (xcode 4)

Hi all,

Apple and the Clang/LLVM team just released the new Xcode 4 yesterday, and they proclaim full C++ support, so with the promise of static analysis, faster build times and much more, I figured it was time to try it out.

The venture didn’t go perfectly though, it fails after a while with:

clang++ -O2 -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude -DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL -DG__STD_EXCEPTION -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY -I/Developer/root/trunk/cint/cint/inc -I/Developer/root/trunk/cint/cint/src -I/Developer/root/trunk/cint/cint/src/dict -D_REENTRANT -pthread -Icint/cint/lib/libstrm -Icint/cint/lib/stream -I. -o cint/cint/src/dict/libstrm.o -c cint/cint/src/dict/libstrm.cxx
In file included from cint/cint/src/dict/libstrm.cxx:14:
In file included from /Developer/root/trunk/cint/cint/src/dict/libstrm.h:41:
cint/cint/lib/stream/strstrm.h:25:10: fatal error: ‘strstream.h’ file not found
#include <strstream.h>
1 error generated.
make: *** [cint/cint/src/dict/libstrm.o] Error 1

The complete installation from check-out to failure is attached.

I tried with 5.28.00a as well, with the same result.
root_trunk_clang_fail.txt (716 KB)


the clang -v command for the Apple Xcode 4 clang compiler gives different output than the pure clang compiler so the wrong info version was used. This is now corrected in the ROOT trunk. However, I see that the Apple clang is failing here:
make: *** [tree/treeplayer/src/G__TreePlayer.cxx] Segmentation fault

However, building with clang built from the llvm/clang trunk works fine.

Cheers, Fons.

Correction, the issue with Clang++ from Xcode 4 is now fixed in for the trunk and the v5-28-00-patches branch.

Cheers, Fons.

Hi Fons,

The trunk version works like a charm, thank you!