Rootcint problem with automatically included files on OSX

Hi,
I’m having trouble building a dictionary on OSX 10.5.6, with the latest developer tools. The following command:

returns:

[quote]g++ -E -C “-DG__APPLE=1” “-DG__GNUC=4” “-DG__GNUC_MINOR=0” “-DG__GNUC_VER=4000” “-DG__i386=1” “-DG__ROOT=1” “-DG__NATIVELONGLONG=1” “-DUSE_ROOT” “-DTRUE=1” “-DFALSE=0” “-Dexternalref=extern” “-DSYSV” “-D__MAKECINT__” “-DG__CINTVERSION=50170000” -I. -Iinclude -I…/include -I/Applications/Scientific/ROOT/root/include -I/Applications/Scientific/ROOT/root/src -D__CINT__ -I/Applications/Scientific/ROOT/root/cint/cint/include -I/Applications/Scientific/ROOT/root/cint/cint/stl -I/Applications/Scientific/ROOT/root/cint/cint/lib /var/tmp/tmp.1.K0WuBW_cint.cxx > /var/tmp/tmp.2.15EYvf_cint
/Applications/Scientific/ROOT/root/cint/cint/include/stdfunc.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/vector.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/vectorbool.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/stdexcept.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/exception.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/map.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/map2.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/multimap.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/multimap2.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/set.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/multiset.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
/Applications/Scientific/ROOT/root/cint/cint/stl/list.dll:DLLREV=30051515
This cint accepts DLLREV=30051501~30051599 and creates 30051515
Error: class,struct,union or type __builtin_va_list not defined /usr/include/i386/_types.h:96:
Error: Too many ‘}’ /usr/include/sys/_select.h:57:
Error: Missing closing brace for the block opened around line 201.
Error: Unexpected end of file (G__exec_statement()) /var/tmp/tmp.1.K0WuBW_cint.cxx:2:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing out/utilitiesDict.C out/utilitiesDict.h !!!
Error: /Applications/Scientific/ROOT/root/bin/rootcint: error loading headers…
[/quote]
Obviously this is a peculiarity of the particular program I’m trying to compile, but it seems to be related to generic system headers like _select.h and _types.h. In fact the errors make no sense since _select.h contains no { or } characters and is less than 57 lines long!

Has anyone seen anything like this before, and does anyone know how to get round it. Also, it seems like rootcint will only use the command g++, which defaults to g+±4.0 on OSX 10.5, is there any way to force it to use g+±4.2 or does this depend upon what compiler ROOT was built with?

Cheers,

Hugh

I should probably mention that this code does compile under linux.

HI,

Can you provide the smallest example reproducing this problem?

Thanks,
Philippe.

Hi,

This code is a module of a very large analysis suite with multiple dependencies, so there isn’t really a small version I can give you. It’ll probably take me a while to find out which particular code is causing the problem. I had hoped(!) that it might be a familiar problem for somebody because of the apparent involvement of system headers. I’ll see if I can get some more details for you to help diagnose the problem. In the meantime I’m willing to try any ideas!

Cheers,

Hugh

Hi Hugh,

To reduce the problem, you could start to remove some of the header on the rootcint command line until only one is left (and still produce the error). From there we will be able to extract (for example by using g++ -E -C the cause of the problem).

Cheers,
Philippe.

Okay. I narrowed the problem down to the file ProgressBar.hh. I’ve attached the output of:

Any suggestions welcome.

Cheers,

Hugh
ProgressBar.txt (1.01 MB)

Actually, it looks like this problem has cropped up before (See here). The problem is the “sys/time.h” header on OSX 10.5. The solution is as described before. Add:

before including sys/time.h, which prevents inclusion of sys/_select.h (not ideal really) and then add:

to the rootcint command line.

Although this is a rather unsatisfactory solution, it does seem to work. Hopefully the file included in the previous post will help with a more robust solution.

Cheers,

Hugh