Bug in cling when returning any value

Hello,

I posted a bug on Jira for this but I think there is more traffic here.

It appears to be a bug when cling returns a value and does not terminate with “;”

root [0] TObject obj;
root [1] TObject obj2
IncrementalExecutor::executeFunction: symbol '_ZN5cling10printValueEP7TObject' unresolved while linking [cling interface function]!
You are probably missing the definition of cling::printValue(TObject*)
Maybe you need to load the corresponding shared library?
(TObject &) 
root [2] 

It does this on every machine (laptop, desktop, server) I have compiled on. I am using version 6.05.02.

I used to be able to use root a simple calculator but that is now broken

root [0] 4*2
IncrementalExecutor::executeFunction: symbol '_ZN5cling10printValueEPKi' unresolved while linking [cling interface function]!
You are probably missing the definition of cling::printValue(int const*)
Maybe you need to load the corresponding shared library?
(int) 

This affects all scripts that don’t return void

$ root -b -q -n func.cxx 
root [0] 
Processing func.cxx...
IncrementalExecutor::executeFunction: symbol '_ZN5cling10printValueEPKi' unresolved while linking [cling interface function]!
You are probably missing the definition of cling::printValue(int const*)
Maybe you need to load the corresponding shared library?
(int) 

where

int func(){
   return 123;
}

Cheers

Hi,.

It seems to work with the master:

[code][bellenot@bbslc6x64-dev rootdev]$ root -l
root [0] TObject obj;
root [1] TObject obj2
(TObject &) Name: TObject Title: Basic ROOT object
root [2] 4*2
(int) 8
root [3] .q
[bellenot@bbslc6x64-dev rootdev]$ root -b -q -n func.cxx

| Welcome to ROOT 6.05/03 http://root.cern.ch |
| © 1995-2014, The ROOT Team |
| Built for linuxx8664gcc |
| From heads/master@v6-05-02-429-g40cf9cc, Oct 22 2015, 09:02:00 |

Try ‘.help’, ‘.demo’, ‘.license’, ‘.credits’, ‘.quit’/’.q’

root [0]
Processing func.cxx…
(int) 123
[bellenot@bbslc6x64-dev rootdev]$
[/code]
Cheers, Bertrand.

Hi,

I tried also on osx and Ubuntu 15.05, 6.05.02, all clear. Maybe there was a problem during the build?

Danilo

It must be specific to the build since I am creating identical builds. Here is my CMakeCache.txt for one of the builds.
CMakeCache_root6.txt (99.4 KB)

Does it work with a simple cmake path/to/src ; make ?
If not, what is the output of the cmake command? Do you see any warning during compilation?

Danilo

Here is the cmake command

cmake -DCMAKE_INSTALL_PREFIX=/opt/jlab_software/cestow/Linux_Ubuntu15.04-x86_64-gcc5.2.0/root_6.05.02 /opt/jlab_software/cestow/sources/root_6.05.02_source/root-6.05.02/. -Dcxx14=ON -DLLVM_ENABLE_CXX1Y=ON -Dopengl=ON -Dgdml=ON -Dpython=ON -Dminuit2=ON -Dmathmore=ON -Droofit=ON

If I had to make a guess, I would imagine it has to do with the LLVM _ENABLE_CXX1Y flag.

I’ll try a simple build and playing around with the options.

Edit:

I have uploaded the cmake output. Everything looks normal right?cmake_output.txt (1.62 KB)

Well even after doing a simple build without any flags I get the same thing.

I should note that I am using gcc 5.2 which I built locally.

Edit: So this is a problem only when using gcc 5.2. It doesn’t show up with gcc 4.9.2.

Hi,

thanks for your efforts in finding out the reason of this issue.
At the moment gcc5 is supported provided that the old ABI is used (see for example developerblog.redhat.com/2015/02 … e-c11-abi/). We will get rid of this limitation once the llvm upgrade we leverage for our interpreter takes place.

Cheers,
Danilo

Dear Danilo,

sorry for re-opening this question, but I was wondering - will this limitation be fixed only for the >6.05.02 version, or is it planned also as a patch release for the older series ? To compile ROOT with old ABI on a system with gcc 5.2, one actually has to recompile with old ABI also all the ROOT dependencies (well, just all that would potentially suffer from the ABI differences). And similarly, e.g. if one wants to use geant4 or whatever other application together with ROOT, it would have to be compiled with the old ABI too. That is a bit anyoing, if one would have to keep such an approach for long time, and has also potential to break completelly if there would be an ABI-sensitive system library on which ROOT depends too.

The thing is that seldom one needs to stick to a specific ROOT version, and thus I am keeping on my system some of the older ROOT versions too. But if they wouldn’t be fixed w.r.t. the old ABI problem, it would force me to keep the newest ROOT versions with the old ABI too.

PS: I hope I haven’t overlooked some clever solution to this, seeing that according to sft.its.cern.ch/jira/browse/ROOT-7640 , Belle2 is using gcc 5.2 together with ROOT without too many complains. But may be it is connected with that the problem above appears only in the interactive ROOT session (?).

Thanks,
Pavel

Hi,

the upgrade of LLVM will have an effect only for ROOT releases newer than the forthcoming 6.06.

Cheers,
Danilo