ROOT ACLiC Problems

I am compiling and running a macro in ROOT; however ACLiC fails to generate the dependency file for my code and it takes a really long time for it to run and compile. My C++ source code is long(817 lines) and I posted it in pastebin.com/du2sd0Mh. This C++ source file used to compile without any warnings at all before.

Info in <TUnixSystem::ACLiC>: creating shared library /DIRECTORY/./readerSummerStd_C.so ACLiC:0: RuntimeWarning: Failed to generate the dependency file for /DIRECTORY/./readerSummerStd_C.so Note: Link requested for already precompiled class map<string,int,less<string>,allocator<pair<const string,int> > > (ignore this message) :0:

This warning is displayed inside ROOT after running the following command:

For actual execution of the code I use a Python script(pastebin.com/dhSWFABe). I am not able to pinpoint the mistake and would appreciate your help in doing so.

Thanks in advance

You didn’t provide “NtupleTools3.h”, but I guess your first command should be something like:
root [0] .L EasyChain.C++

[quote=“Wile E. Coyote”]You didn’t provide “NtupleTools3.h”, but I think your first command should be something like:
root [0] .L EasyChain.C++[/quote]

Yeah I apoligise for that actually the Python scripts take care of it for me but I tried it in CINT just to make sure that the Python script was not problematic. You can find the “NtupleTools3.h” in the following link: pastebin.com/ARkV2y18

I have also tried running the other code and it compiled flawlessly without first loading the EasyChain and it generated the shared object file which is not generated in my case.

Well, I don’t get the “Failed to generate the dependency” error with my ROOT v5-34-20.

Try to “clean” your working subdirectory:
rm -f AutoDict ACLiC *.d *.so
then create in there a “rootlogon.C” file: { if (!(gInterpreter->IsLoaded("utility"))) gInterpreter->ProcessLine("#include <utility>"); if (!(gInterpreter->IsLoaded("map"))) gInterpreter->ProcessLine("#include <map>"); } and finally try again (the “EasyChain” class comes from the “NtupleTools3.h” file):
root [0] .L readerSummerStd.C++

You can get rid of the warning “Link requested for already precompiled class” if in the “NtupleTools3.h” file you comment out the line (the appropriate “link” will be loaded by "#include " from the above “rootlogon.C” file):
#pragma link C++ class map<string,int>+;

[quote=“Wile E. Coyote”]Well, I don’t get the “Failed to generate the dependency” error with my ROOT v5-34-20.

Try to “clean” your working subdirectory:
rm -f AutoDict ACLiC *.d *.so
then create in there a “rootlogon.C” file: { if (!(gInterpreter->IsLoaded("utility"))) gInterpreter->ProcessLine("#include <utility>"); if (!(gInterpreter->IsLoaded("map"))) gInterpreter->ProcessLine("#include <map>"); } and finally try again (the “EasyChain” class comes from the “NtupleTools3.h” file):
root [0] .L readerSummerStd.C++

You can get rid of the warning “Link requested for already precompiled class” if in the “NtupleTools3.h” file you comment out the line (the appropriate “link” will be loaded by "#include " from the above “rootlogon.C” file):
#pragma link C++ class map<string,int>+;[/quote]

Thanks for the answer, I cleaned the directory of AutoDicts and generated the “rootlogon.C” file but the problem persists. The ROOT version is 5.34/04 (10 January 2013) and the output of the commands follow below:

.L readerSummerStd.C++ Info in <TUnixSystem::ACLiC>: creating shared library /afs/desy.de/user/a/arisevon/Summer_Students/nTupler_topness/tupleAnalyzer/./readerSummerStd_C.so Warning in <ACLiC>: Failed to generate the dependency file for /afs/desy.de/user/a/arisevon/Summer_Students/nTupler_topness/tupleAnalyzer/./readerSummerStd_C.so Note: Link requested for already precompiled class map<string,int,less<string>,allocator<pair<const string,int> > > (ignore this message) :0:

or when I use the Python script for running it the same warning again:

tupleAnalyzer% ./NEWrunReader.py SummerStd 140PU_NM1 Info in <TUnixSystem::ACLiC>: creating shared library /afs/desy.de/user/a/arisevon/Summer_Students/nTupler_topness/tupleAnalyzer/./readerSummerStd_C.so ACLiC:0: RuntimeWarning: Failed to generate the dependency file for /afs/desy.de/user/a/arisevon/Summer_Students/nTupler_topness/tupleAnalyzer/./readerSummerStd_C.so Note: Link requested for already precompiled class map<string,int,less<string>,allocator<pair<const string,int> > > (ignore this message) :0:

The code runs but I did not get why one of the C++ source codes work whereas the other does not work. I think you have checked both of them.

Strangely, the problem was solved after copy pasting the same code into another file(using GUI Gedit and system clipboard) and running it instead. Does that hint the text editor I use(VIM 7.2) might have messed up with file encoding or something like that?

I’ve met a similar problem several times already. While editing a source code file, an additional character slipped into the text (I probably pressed some strange key combination). This additional character was completely “invisible” in the editor’s window (not even as an additional space) but the compiler was mysteriously breaking.

Next time I run into a similar problem I will keep it in mind, I appreciate your help.