Embedded cling error with latest xcode

Hi,

my cling embedding app stopped working as soon as I switched Xcode 6.3.1 (it still builds but it fails at runtime).

Can you please help?

Thanks,
A

ERROR LOG:

ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
echo | LC_ALL=C clang++ -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Wcast-qual -fno-strict-aliasing -xc++ -E -v - 2>&1 >/dev/null | awk ‘/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}’ | grep -E "(c|g)++"
results in
with exit code 256
input_line_1:1:10: fatal error: ‘new’ file not found
#include
^
Assertion failed: (Val && “isa<> used on a null pointer”), function doit, file /Volumes/MACPHSFT14HD2/ec/build/cling-2441d473ecbf-full-2133214/cling-src-2441d473ecbf3a29e4d05084e2a30129456ce145/include/llvm/Support/Casting.h, line 95.

PS: I tried downloading today’s version of cling and updating libraries and includes to the latest version and I get the same error.

Hi,

It’s good that our error messages are verbose :slight_smile: Let’s see - what does

echo | LC_ALL=C clang++ -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Wcast-qual -fno-strict-aliasing -xc++ -E -v - 2>&1

show?

Axel.

I’ve gotten the same problem.

echo | LC_ALL=C clang++ -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Wcast-qual -fno-strict-aliasing -xc++ -E -v - 2>&1 shows:

Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.9.0 -E -disable-free -disable-llvm-verifier -main-file-name - -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 242 -v -dwarf-column-info -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0 -D _DEBUG -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -stdlib=libc++ -O3 -Wcast-qual -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/wilkacarvalho/projects/dirc/dircobjects/build -ferror-limit 19 -fmessage-length 86 -fvisibility-inlines-hidden -stack-protector 1 -mstackrealign -fblocks -fno-rtti -fobjc-runtime=macosx-10.9.0 -fencode-extended-block-signature -fmax-type-align=16 -fno-common -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o - -x c++ -
clang -cc1 version 6.1.0 based upon LLVM 3.6.0svn default target x86_64-apple-darwin14.3.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 337 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2

Hi,

That’s correct. So what does the whole invocation show?

echo | LC_ALL=C clang++ -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Wcast-qual -fno-strict-aliasing -xc++ -E -v - 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | grep -E "(c|g)\+\+"

And what about

which clang++
which awk
which grep

Cheers, Axel.

Dear all,
I can confirm this problem already at ROOT start.
I have been running root 6.04.00 for a while on a MacBookPro. Last night I upgraded xcodebuild to version 7.0:

[quote]Xcode 7.0
Build version 7A220[/quote]
As it happened with a working 5.34.18 version too, after a xcodebuild upgrade root fails at start with the same message about missing ‘’, mentioned in the previous posts.
I had installed root 6.05.00 and the problem went away. I reverted to 6.04.00 and it now works!
What happened in between? The only thing I can imagine is that I run:

between the 2 tests with 6.04.00.

I am really confused and also a bit unsatisfied by the fact that xcodebuild new versions break working root installations.

Am I missing something?

Any hint will be greatly appreciated.

Many thanks in advance and best regards,
Marco Bomben

PS

[quote]Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix[/quote]

Hi,

What was the exact error message before the error about ?

Cheers, Axel.

Hello Axel,
the line that brought me to this topic was the following:

Unfortunately I don’t think I have nothing more than this (or should I look into some /var/*log maybe?).

Thanks for looking into this,
Marco

Hi all,

I am experiencing the same problem after downloading the most recent command line tools on OS X Yosemite 10.10.5.

Since I am running Yosemite on two other other machines with previous command line tool version and root executes fine there, I suspect it is really a compliance issue with new clang-700 but I can’t be sure.

Code compile fine when linking to root libraries but execution and interactive root sessions crash as follows.

MacBook-Pro-de-Pierre-2:~ psaouter$ root
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
    echo | LC_ALL=C /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++  -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -Wno-deprecated-declarations -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -stdlib=libc++ -Wno-comment -Wno-unused-parameter -Wno-conditional-uninitialized -Wno-parentheses-equality -Wno-unused-private-field -fPIC -fvisibility-inlines-hidden -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -O2 -DNDEBUG -xc++ -E -v - 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | grep -E "(c|g)\+\+"
results in
with exit code 256
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
input_line_3:38:10: fatal error: 'string' file not found
#include <string>
   ------------------------------------------------------------
  | Welcome to ROOT 6.05/02                http://root.cern.ch |
  |                               (c) 1995-2014, The ROOT Team |
  | Built for macosx64                                         |
  | From tag v6-05-02, 14 September 2015                       |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

input_line_8:1:10: fatal error: 'iostream' file not found
#include <iostream>
IncrementalExecutor::executeFunction: symbol '_ZN5cling7runtime6gClingE' unresolved while linking [cling interface function]!
You are probably missing the definition of cling::runtime::gCling
Maybe you need to load the corresponding shared library?

Any help will be appreciated.

Best.

Pierre

Hi,

what’s the output of

 echo | LC_ALL=C /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++  -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -Wno-deprecated-declarations -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -stdlib=libc++ -Wno-comment -Wno-unused-parameter -Wno-conditional-uninitialized -Wno-parentheses-equality -Wno-unused-private-field -fPIC -fvisibility-inlines-hidden -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -O2 -DNDEBUG -xc++ -E -v -

Cheers, Axel.

Hi Axel,

The output is the following

I was convinced I could stick to command line tools only and not have to install the full Xcode package but perhaps I’m wrong.

In fact on my other machines where root works fine, the output is the same.

Also :

MacBook-Pro-de-Pierre-2:~ psaouter$ which clang++ /usr/bin/clang++

Thanks,

Pierre

I have installed the full Xcode package and everything runs fine again. I am ok with this working solution for now but there is certainly more to understand on this topic.

Thanks for your help.

Pierre

Problem is due to not agreeing to the new licence agreement of Xcode and the SDK. For mee launching Xcode and accepting the (new) license agreement fixed the problem.

Does anyone know how to fix this problem without installing Xcode? My student got a similar error, and I had to ask him to install the full Xcode package, which is a waste of disk space.

Hi,

What message are you getting?

For the time being (at least until the clang precompiled module work within cling) … you will need access to the header file provided by XCode.

Cheers,
Philippe.

Dear all,
I want to add a bit of information here. This morning I have updated xcode and a root macro that was working yesterday stopped working with error messages very similar to the ones already presented here above:

Accepting the Xcode license agreement using the command here below makes root working again:

sudo xcodebuild -license

The xcode version is:

but I think it is true for all the xcode/OSX/root versions since a while.

Hope this helps!
Regards,
Marco Bomben

Thanks, Marco!

Hello,
I have a similar error to those presented here, that is:

ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
    echo | LC_ALL=C clang++  -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -Wno-deprecated-declarations -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -stdlib=libc++ -DR__HAVE_CONFIG -Wno-comment -Wno-unused-parameter -Wno-conditional-uninitialized -Wno-parentheses-equality -Wno-unused-private-field  -fPIC -fvisibility-inlines-hidden -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-unused-local-typedefs -O2 -DNDEBUG -xc++ -E -v - 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | grep -E "(c|g)\+\+"
results in
with exit code 256
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^
input_line_3:38:10: fatal error: 'string' file not found
#include <string>
         ^
   -------------------------------------------------------------------------
  | Welcome to ROOT 6.06/08                             http://root.cern.ch |
  |                                            (c) 1995-2016, The ROOT Team |
  | Built for macosx64                                                      |
  | From heads/v6-06-00-patches@v6-06-06-30-g3bae07b, Sep 01 2016, 14:28:05 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'              |
   -------------------------------------------------------------------------

input_line_7:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^
root [0]

I have accepted the Xcode license using the command line (as suggested here and elsewhere) but it DID NOT make root work.

Some extra information that may be useful:

OS: Mac OS Sierra 10.12
Xcode Version 8.0 (8A218a)
Root version: 6.06/08, Built for macosx64 From heads/v6-06-00-patches@v6-06-06-30-g3bae07b, Sep 01 2016, 14:28:05
clang version 3.7.0 (http://root.cern.ch/git/clang.git 74fc5c43a975e53670382cf3cecf15925154d1ad) (http://root.cern.ch/git/llvm.git 4f6e66a29b11d6c6398f7e8cfa90356d07c1036a)
Target: x86_64-apple-darwin16.0.0
Thread model: posix

Thank you very much in advance!

Apologies, you have already printed the relevant information.

Hi,

Does “xcode-select --install” (without the quotes) help?

Axel.