Second ACLiC compilation fails

Here is MWE which reproduces the problem
I compile hsimple.cxx

double hsimple(double px1) {
   return px1;
}

and load it as a shared library

root [0] .L src/hsimple.cxx++
Info in <TUnixSystem::ACLiC>: creating shared library ${HOME}/src/hsimple_cxx.so

and it works!

Now, without quiting the root session I delete produced files:

rm hsimple_cxx.d hsimple_cxx_ACLiC_dict_rdict.pcm hsimple_cxx.so

and try to compile again.

root [1] .L src/hsimple.cxx++
Info in <ACLiC>: script has already been loaded in interpreted mode
Info in <ACLiC>: unloading ${HOME}/src/hsimple.cxx and compiling it
Info in <TUnixSystem::ACLiC>: creating shared library ${HOME}/src/hsimple_cxx.so
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
Error in <ACLiC>: Compilation failed!

There must be something in the session which is possible to clean to be able to compile again.

Hi,

I think that what you are attempting is not possible and restarting root is required.

Cheers,
D

The original problem was with the TTree Draw function
Let’s say there are two files with functions. The first one is hsimple1.cxx

double hsimple1() {
   return px1;
}

The second file is hsimple2.cxx

double hsimple2() {
   return px2;
}

where px1 and px2 are branches of by tree.
Then I do

tree->Draw("hsimple1.cxx");  // Works
tree->Draw("hsimple2.cxx");  // Error

It fails because of some conflict…

Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <ACLiC>: modified script has already been compiled and loaded
Info in <ACLiC>: it will be regenerated and reloaded!
Info in <TUnixSystem::ACLiC>: creating shared library ${HOME}/generatedSel_h.so
c++: error: ${HOME}/generatedSel_h.so: No such file or directory
Error in <ACLiC>: Compilation failed!
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1

Indeed generatedSel_h.so from the first command is deleted, the new one is not created.

For curiosity I tried with the ntuple stored in the standard example “hsimple.root”. I replaced px1 by px in hsimple1.cxx and px2 by py in hsimple2.cxx. I get the following:

$ root
   --------------------------------------------------------------------
  | Welcome to ROOT 6.15/01                        http://root.cern.ch |
  |                                       (c) 1995-2018, The ROOT Team |
  | Built for macosx64                                                 |
  | From heads/master@v6-13-04-1008-g5028941cbe, Aug 24 2018, 08:26:52 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'         |
   --------------------------------------------------------------------

root [0] ntuple->Draw("hsimple1.cxx");
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/couet/roottest/./generatedSel_h.so
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [1] ntuple->Draw("hsimple2.cxx");
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <ACLiC>: modified script has already been compiled and loaded
Info in <ACLiC>: it will be regenerated and reloaded!
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/couet/roottest/./generatedSel_h.so
root [2] 

It seems fine. I get the plots also.

Thank you for the check!
That is weird. Can it be something with versions?

root-config --version  # 6.14/00
# is clang relevant?
clang --version # clang version 3.4.2 (tags/RELEASE_34/dot2-final)

I will check with newer setup tonight.

I do not know. May be, on your side, you can do the check I did ? ie: using the file hsimple.root generated by $ROOTSYS/tutorials/hsimple.C

I just did, the same error

Attaching file hsimple.root as _file0...
(TFile *) 0x248f160
root [1] ntuple->Draw("hsimple1.cxx");
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <TUnixSystem::ACLiC>: creating shared library /home/mikhasenko/Documents/dynamics-3pi-plots/./generatedSel_h.so
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [2] ntuple->Draw("hsimple2.cxx");
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in interpreted mode yet. The script will be compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <ACLiC>: modified script has already been compiled and loaded
Info in <ACLiC>: it will be regenerated and reloaded!
Info in <TUnixSystem::ACLiC>: creating shared library /home/mikhasenko/Documents/dynamics-3pi-plots/./generatedSel_h.so
c++: error: /home/mikhasenko/Documents/dynamics-3pi-plots/generatedSel_h.so: No such file or directory
Error in <ACLiC>: Compilation failed!

Ok, in that case it might be a good idea to try with a more recent version.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.