# Cling results for ninja check-cling, FreeBSD 12-stable, llvm10, git HEAD

**URL:** <https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373>\
**Category:** Newbie\
**Created:** [March 11, 2020, 8:13pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373 "2020-03-11T20:13:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcarter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/3be4f8/32.png) [@rcarter](https://root-forum.cern.ch/u/rcarter)\
**Post date:** [March 11, 2020, 8:13pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/1 "2020-03-11T20:13:11Z")

</div>

Hi,  
I couldn’t get a build of ROOT pushed through, though I am quite far. I decided to first try to get cling up. After burning quite a bit of carbon I have cling and the tests built. However I am getting some failures for the check-cling target:

* * *

Testing Time: 146.84s

* * *

Failing Tests (23):  
Cling :: CodeGeneration/RecursiveInit.C  
Cling :: ErrorRecovery/Diagnostics.C  
Cling :: ErrorRecovery/SubsequentDecls.C  
Cling :: Extensions/Lookup/Arrays.C  
Cling :: Extensions/Lookup/ControlFlow.C  
Cling :: Extensions/Lookup/LifetimeHandler.C  
Cling :: Extensions/Lookup/Simple.C  
Cling :: Extensions/Lookup/SimpleDynamicExprs.C  
Cling :: Extensions/Lookup/StillError.C  
Cling :: Interfaces/address.C  
Cling :: Interfaces/compileFunc.C  
Cling :: Interfaces/transactionReuse.C  
Cling :: Lookup/args.C  
Cling :: Lookup/data.C  
Cling :: Lookup/func.C  
Cling :: Lookup/named.C  
Cling :: Lookup/scope.C  
Cling :: Lookup/tag.C  
Cling :: Lookup/template.C  
Cling :: Lookup/type.C  
Cling :: Pragmas/opt.C  
Cling :: Prompt/globalinit.C  
Cling :: Utils/Transform.C

Expected Passes : 102  
Expected Failures : 13  
Unsupported Tests : 12  
Unexpected Failures: 23  
FAILED: tools/cling/test/CMakeFiles/check-cling

My cmake CL args are:  
std::vectorstd::string config\_vec{  
“-DCMAKE\_INSTALL\_PREFIX=/usr/local/pkg/cling”,  
“-DLLVM\_ENABLE\_CXX1Y=ON”,  
“-DLLVM\_ENABLE\_CXX1Z=ON”,  
“-DCMAKE\_C\_COMPILER=clang10”,  
“-DCMAKE\_CXX\_COMPILER=clang++10”,  
“-DCMAKE\_CXX\_STANDARD=14”,  
“-DCLING\_CXX\_HEADERS=/usr/local/llvm10/include”,  
“-DCLING\_INCLUDE\_PATHS=/usr/local/llvm10/include”,  
“-DCLING\_INCLUDE\_TESTS=ON”,  
“-G”,  
“Ninja”,  
“…/src”  
};

First, is the newbie category appropriate (I’m definitely a newbie).  
Second, any suggestions on how to diagnose the failures would be appreciated.

Many thanks.

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [March 13, 2020, 1:20pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/2 "2020-03-13T13:20:40Z")

</div>

Hi Russell,  
I think we might need a few background details in order to better help:

- what operating system are you on?
- what ROOT version are you trying to compile?
- what’s the exact cmake invocation you use to compiler ROOT?
- do you get any errors or warnings (and which)?

@Axel or @vvassilev might be able to comment on cling’s test failures.

Cheers,  
Enrico

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [March 13, 2020, 4:45pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/3 "2020-03-13T16:45:28Z")

</div>

What’s the test output for `cat ../tools/cling/test/Lookup/named.C | ./bin/cling -fno-rtti`?

---

<div class="post-metadata">

**Author:** ![rcarter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/3be4f8/32.png) [@rcarter](https://root-forum.cern.ch/u/rcarter)\
**Post date:** [March 13, 2020, 6:59pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/4 "2020-03-13T18:59:19Z")

</div>

Greetings,

> Hi Russell,  
> I think we might need a few background details in order to better help:
> 
> - what operating system are you on?

FreeBSD 12-stable, i.e. FreeBSD 12 kept up to date with the  
source repo. I tried both llvm90 and llvm10. Doesn’t  
appear to make a difference.

> - what ROOT version are you trying to compile?

The version obtained by following the cling build instructions  
here:

[https://root.cern.ch/cling-build-instructions](https://root.cern.ch/cling-build-instructions)

git log reports commit e0b472e46eb5861570497c2b9efabf96f2d4a485  
is HEAD.

> - what’s the exact cmake invocation you use to compiler ROOT?

I use ‘ ninja'. To run the tests, ' ninja check-cling’

I figured this out by examining the python packaging script.

> - do you get any errors or warnings (and which)?

Yes, here’s the first:

[0/1] Running the Cling regression tests  
lit.py:  
/usr/local/pkg/repo/jupyter/cling/src/tools/cling/test/lit.cfg:269:  
note: using cling: ‘/usr/local/pkg/repo/jupyter/cling/build/./bin/cling’  
lit.py:  
/usr/local/pkg/repo/jupyter/cling/src/tools/cling/test/lit.cfg:280:  
note: Running tests from build tree  
– Testing: 150 tests, 8 threads –  
Testing: 0 … 10  
FAIL: Cling :: CodeGeneration/RecursiveInit.C (19 of 150)  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* TEST ‘Cling :: CodeGeneration/RecursiveInit.C’  
FAILED \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Script:

---

<div class="post-metadata">

**Author:** ![rcarter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/3be4f8/32.png) [@rcarter](https://root-forum.cern.ch/u/rcarter)\
**Post date:** [March 13, 2020, 7:39pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/5 "2020-03-13T19:39:48Z")

</div>

Greetings:

> What’s the test output for |cat …/tools/cling/test/Lookup/named.C |  
> ./bin/cling -fno-rtti|?

Below, the ‘build/’ directory holds a freshly built cling, and the  
‘src/’ is what is obtained from

[https://root.cern.ch/cling-build-instructions](https://root.cern.ch/cling-build-instructions)

(.venv) rcarter@bruno\> ls  
build/ src/ test.out  
(.venv) rcarter@bruno\> cd build  
(.venv) rcarter@bruno\> ls  
bin/ CPackConfig.cmake libexec/  
share/  
build.ninja CPackSourceConfig.cmake llvm.spec  
test/  
cmake/ docs/ LLVMBuild.cmake  
tools/  
cmake\_install.cmake DummyConfigureOutput man/  
unittests/  
CMakeCache.txt examples/ projects/  
utils/  
CMakeFiles/ include/ rules.ninja  
compile\_commands.json lib/ runtimes/  
(.venv) rcarter@bruno\> cat …/src/tools/cling/test/Lookup/named.C |  
./bin/cling -fno-rtti  
ERROR in cling::CIFactory::createCI():  
resource directory …/lib/clang/5.0.0 not found!

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* CLING \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

- Type C++ code and press enter to run it \*
- 

```
        Type .q to exit *

```

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [March 13, 2020, 8:55pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/6 "2020-03-13T20:55:07Z")

</div>

> resource directory …/lib/clang/5.0.0

sounds very weird. Did you build the install target? Make sure you install into say …/install - no sudo needed for that.

Axel.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [March 13, 2020, 8:57pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/7 "2020-03-13T20:57:43Z")

</div>

O, and IIRC we had a problem with one of FreeBSD’s system APIs - `putenv` or similar… Again IIRC it prevented cling from finding its directories back. Now - I won’t get to look at this over the weekend; please ping me next week should you not hear back from me!

---

<div class="post-metadata">

**Author:** ![rcarter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/3be4f8/32.png) [@rcarter](https://root-forum.cern.ch/u/rcarter)\
**Post date:** [March 13, 2020, 9:19pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/8 "2020-03-13T21:19:33Z")

</div>

> O, and IIRC we had a problem with one of FreeBSD’s system APIs -
> 
> > putenv\> or similar… Again IIRC it prevented cling from finding its  
> > directories back. Now - I won’t get to look at this over the weekend;  
> > please ping me next week should you not hear back from me!

So I’ve now got the build installed and cling up and running,  
(rpaths work, glad I didn’t have to work through that) and yes, it  
is having trouble finding its llvm directories. I at least have  
something to look for now.

Thank you,  
Russell

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [March 15, 2020, 3:37pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/9 "2020-03-15T15:37:04Z")

</div>

These might be relevant:  
[https://sft.its.cern.ch/jira/browse/ROOT-9498](https://sft.its.cern.ch/jira/browse/ROOT-9498)  
[https://sft.its.cern.ch/jira/browse/ROOT-9484](https://sft.its.cern.ch/jira/browse/ROOT-9484)

---

<div class="post-metadata">

**Author:** ![rcarter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/3be4f8/32.png) [@rcarter](https://root-forum.cern.ch/u/rcarter)\
**Post date:** [March 15, 2020, 9:56pm UTC](https://root-forum.cern.ch/t/cling-results-for-ninja-check-cling-freebsd-12-stable-llvm10-git-head/38373/10 "2020-03-15T21:56:33Z")

</div>

> These might be relevant:  
> [Loading...](https://sft.its.cern.ch/jira/browse/ROOT-9498)  
> [Loading...](https://sft.its.cern.ch/jira/browse/ROOT-9484)
> 
> * * *

Thanks for the pointers. I suspect I will need to insert  
tools/cling/lib/Interpreter/CIFactory.cpp into my brain in order to  
fix this.

However, I was able to make some progress with the ‘ninja cling-test’  
(or check-cling, doesn’t seem to matter) failures. I was able to make  
a few of tests work by replacing the ‘lit’ generated -I include. For  
instance ninja cling-test produces this sort of output:

FAIL: Cling :: Extensions/Lookup/ControlFlow.C (119 of 150)  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* TEST ‘Cling :: Extensions/Lookup/ControlFlow.C’  
FAILED \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Script:

cat  
/usr/local/pkg/repo/jupyter/cling/src/tools/cling/test/Extensions/Lookup/ControlFlow.C

> /usr/local/pkg/repo/jupyter/cling/build/./bin/cling --nologo  
> -I/usr/local/pkg/repo/jupyter/cling/build/tools/clang/include  
> -I/usr/local/pkg/repo/jupyter/cling/src/tools/cling/test/Extensions/Lookup  
> /usr/local/pkg/repo/jupyter/cling/build/./bin/FileCheck  
> /usr/local/pkg/repo/jupyter/cling/src/tools/cling/test/Extensions/Lookup/ControlFlow.C

Fails with that -I build include path, but it does work if I  
substitute the installation include path, in my case,  
/usr/local/pkg/cling/include. Reading the various ‘lit’ scripts, I  
thought I might be able to fix this by exporting  
INCLUDE=/usr/local/pkg/cling/include before running ninja cling-test,  
but no luck. If you could point out where the lit test runner sets  
it that might help me.

Thanks very much,  
Russell
