Including -I/usr/include breaks rootcint dictionary generation

I’m using Ubuntu 14.04 with ROOT 5.34/30. Issue occurs for both g++4.8 and clang 3.4.

The makefile for a package I’m building adds the path to a library’s include files. On my system, these are in the standard location of /usr/include.

This adds -I/usr/include to the ‘rootcint’ invocation, after which I get this message:

#error "You need a ISO C conforming compiler to use the glibc headers" Error: Missing one of ' \/' expected at or after line 97. Error: Unexpected end of file (G__fgetstream():2) /usr/include/sys/cdefs.h:419: Error: Symbol extern"C"{#define __need_size_t#define __need_NULL#include<stddef is not defined in current scope /usr/include/stdio.h:44: Error: Failed to evaluate extern"C"{#define __need_size_t#define __need_NULL#include<stddef.h>#include<bits/types Error: Failed to evaluate extern"C"{#define __need_size_t#define __need_NULL#include<stddef.h>#include<bits/types.h>#define __need_FILE#define __need___FILE#endif#if!defined __FILE_defined&&defined __need_FILE struct _IO_FILE Error: Symbol __BEGIN_NAMESPACE_STD typedef struct _IO_FILE FILE is not defined in current scope /usr/include/stdio.h:48: Error: Missing one of '{' expected at or after line 90. Error: Unexpected end of file (G__fignorestream():3) /usr/include/stdio.h:948: Error: Missing one of '{' expected at or after line 518. Error: Unexpected end of file (G__fignorestream():3) /usr/include/string.h:647: Error: Missing one of '{' expected at or after line 71. Error: Unexpected end of file (G__fignorestream():3) /usr/include/assert.h:123: Error: Symbol div_t is not defined in current scope /usr/include/stdlib.h:101: Error: Symbol lldiv_t is not defined in current scope /usr/include/stdlib.h:121: Error: Missing one of '{' expected at or after line 466. Error: Unexpected end of file (G__fignorestream():3) /usr/include/stdlib.h:971: Error: Missing whitespace at or after line 489. Error: Unexpected end of file (G__fgetspace():2) /usr/include/math.h:492: Report: Unrecognized string '__END_DECLS' ignored /usr/include/math.h:493: Warning: Error occurred during reading source files Warning: Error occurred during dictionary source generation

/usr/include is obviously the culprit, but it seems that this is something that it should be possible to avoid - given that we get files from there anyway, manually specifying it shouldn’t be fatal.

Do we need to manually add logic to the makefile builder to explicitly avoid this folder?

The makefile for a package I’m building adds the path to a library’s include files.

Why does it? What is their intent? This is in most case already taken care by the compiler and adding -I/usr/include actually ‘slightly’ change the semantic of this include directory (no longer quite a system directory).

I’m using Ubuntu 14.04 with ROOT 5.34/30. … This adds -I/usr/include to the ‘rootcint’ invocation, after which I get this message:

Yes, the rootcint in v5 (based on CINT) can not handle being passed /usr/include as this over-ride the set of customized system header that CINT must use (because it can not fully parsed the real system headers).

Do we need to manually add logic to the makefile builder to explicitly avoid this folder?

Yes (as we are no longer adding new feature/work-arounds to v5.34 … i.e. you may want to try v6). However I also (see above) suspect that the package’s makefile is ‘wrong’ in the first place (unless I am missing something).

Cheers,
Philippe.

Thanks for the rapid response. I’ve altered the build system so that ROOT’s versions of these get found at higher priority.

. I’ve altered the build system so that ROOT’s versions of these get found at higher priority.

That is likely to not work properly. The ‘ROOT version’ of /usr/include headers should be seen only by CINT (and never by the compiler) and CINT already knows where to find them.

Cheers,
Philippe.