Xcode Mac OSX Lion and abnormal rootcint includes behavior

I am running OSx Lion. I was attempting to install ROOT v5.34.2 and was having the problem located here:
[url]Issue compiling trunk in Mac OS X
The solution suggested was to update XCode and clang++ and reinstall. I did this.
Now I am running XCode 4.5.1.

$ clang++ -v
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

Now when I use rootcint, I run

Now here is the problem. The specific include directories include headers that I need, but also may contain their own LinkDef.hh file. So now I get errors which say things like

Error: link requested for unknown class ${A CLASS FROM A DIFFERENT DIRECTORY} ../${AN INCLUDED DIRECTORY}/LinkDef.hh:32: Warning: Error occurred during reading source files Warning: Error occurred during dictionary source generation

Now to my understanding the included directories should contain header files, if the compiler needs them, it knows where to look, if it does not need a header file in one of the include directories, it ignores it. But rootcint appears to be trying to deal with the LinkDef file in the include directories.

This did not occur yesterday before upgrading ROOT and Xcode. And STILL occurs if I use ROOT v5.32.00 which previously ran fine. I have seen discussions of errors similar to this and the solution was removing -I/usr/include from the rootcint command, that doesnt help and is irrelevant here. The problem I am having is that rootcint is picking up LinkDef files recursively. I think.

Any suggestions?

[quote] But rootcint appears to be trying to deal with the LinkDef file in the include directories.[/quote]This is the expected behavior. The linkdef file is search for as any other include files. I you need a specific linkdef you may have to specify more its path or use a different name for the linkdef (for example Alinkdef.h )

Cheers,
Philippe.

So I am compiling in the directory ‘./’ And I have the LinkDef file ‘./LinkDef.hh’. And an include directory ‘…/AnotherDir’/.

‘…/AnotherDir/’ has its own ‘LinkDef.hh’ file for compiling a different library.

While in the dir ‘./’, I type

I need it to use ./LinkDef.hh, but it is also trying to parse …/AnotherDir/LinkDef.hh.

Why would it try to parse …/AnotherDir/LinkDef.hh. No where in the command do I tell it to consider …/AnotherDir/LinkDef.hh. I pass the file ./LinkDef.hh and …/AnotherDir/ as an include directory.

–Jon

Hi Jon,

[quote]No where in the command do I tell it to consider …/AnotherDir/LinkDef.hh.[/quote]The name passed as the linkdef file as well as all the other include files names are treated as if you had:#include "filename"in code and thus all directory in the include path (-I) will be searched. (Besides arguing whether CINT should or not look in the current directory first), I strongly recommend that you use distinctive name for all your linkdef file or to not store them along side the other header file (i.e use AnotherDir/AnotherLinkDef.hh and ThatLinkDef.hh, etc.).

Cheers,
Philippe.

So why does this only happen with the newer version of Xcode? But not on older versions or Linux based?

HI,

A priori the version of Xcode should not be a factor. The version of ROOT (ore more exactly CINT) might be introduce a difference.

Philippe.

So I have managed a work around by specifying ${PWD} before the LinkDef file. Which gives it a specific one. But I think rootcint should check the pwd for a LinkDef file before searching the include directories. I am not sure what caused this problem, especially since I have not see it on any other systems. I do have ‘-I./’ before all the other -I{Dir} flags. Perhaps its attempting to parse ALL the LinkDef files? In which case I do not see why it should do that.

As for renaming each LinkDef file. Thats beyond my control. I dont write the software. And this has never been a problem before.

–Jon