Cling on OSX 10.9 Mavericks

Hi,

I was trying the provided CLING executable from your nightly build, namely cling-MacOSX-10.8-64bit-4d98a76dec.

On First run I am getting:

ERROR in cling::CIFactory::createCI(): Possible C++ standard library mismatch, compiled with __GLIBCXX__ v20070719 but cannot extract standard library version from current compiler clang++ input_line_1:1:10: fatal error: 'cling/Interpreter/RuntimeUniverse.h' file not found #include "cling/Interpreter/RuntimeUniverse.h" ^ Assertion failed: (clingAtExit && "cling_cxa_atexit must exist."), function remapCXAAtExit, file /ec/build/cling-4d98a76decae-full-1247013/cling-src-4d98a76decaefccfabdbcc9a73b124ecbe93260d/tools/cling/lib/Interpreter/ExecutionContext.cpp, line 57. Illegal instruction: 4

So I have copied cling includes in /usr/local/include, the include error has disappeared but now I get:

ERROR in cling::CIFactory::createCI(): Possible C++ standard library mismatch, compiled with __GLIBCXX__ v20070719 but cannot extract standard library version from current compiler clang++ ExecutionContext: use of undefined symbol '_ZN5cling7runtime8internal21__trigger__cxa_atexitD1Ev'! ExecutionContext::runStaticInitializersOnce: symbol '_ZN5cling7runtime8internal21__trigger__cxa_atexitD1Ev' unresolved while linking static initializer '_GLOBAL__I_a'! Assertion failed: (0 && "Error on inits."), function commitTransaction, file /ec/build/cling-4d98a76decae-full-1247013/cling-src-4d98a76decaefccfabdbcc9a73b124ecbe93260d/tools/cling/lib/Interpreter/IncrementalParser.cpp, line 279. Illegal instruction: 4

My configuration is OSX 10.9 Mavericks with Xcode 5.0.2 installed (not sure if it affects anything, I am actually “starting” to understand how cling works :wink: )
Any hints?

Thanks and keep up your great work :smiley: .

Just as an update, I’ve also tried to rebuild cling on the same config (10.9 xcode 5.0.2), following closely the README file in the patches directory:

[code]The patches are now tracked in the git repositories

http://root.cern.ch/git/llvm.git (mirror of llvm’s git)
http://root.cern.ch/git/clang.git (mirror of clang’s git)

To build cling check out the tag called “cling-patches-rREV” from both repos,
where REV comes from LastKnownGoodLLVMSVNRevision.txt, for instance:

$ cd src; git checkout cling-patches-r191429
$ cd tools/clang; git checkout cling-patches-r191429

See http://cern.ch/cling for build instructions.
[/code]

the build is successful but running the resulting cling yields:

In file included from input_line_3:1:
In file included from /Users/stefano/Code/External/cling/llvm/tools/cling/include/cling/Interpreter/ValuePrinter.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:430:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:90:10: fatal error: 'wchar.h' file not found
#include <wchar.h>  // for mbstate_t
         ^
Segmentation fault: 11

So I’ve added path to wchar.h for 10.9 sdk but still getting errors on the linker.

[code]stefano$ ./cling -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include

****************** CLING ******************

  • Type C++ code and press enter to run it *
  •         Type .q to exit             *
    

[cling]$ auto a = “asd”;
[cling]$ a
ExecutionContext: use of undefined symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv’!
ExecutionContext: use of undefined symbol ‘ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS4’!
ExecutionContext: use of undefined symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4sizeEv’!
ExecutionContext: use of undefined symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4dataEv’!
ExecutionContext::executeFunction: symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv’ unresolved while linking function ‘_Z15__cling_Un1Qu31v’!
ExecutionContext::executeFunction: symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4dataEv’ unresolved while linking function ‘_Z15__cling_Un1Qu31v’!
ExecutionContext::executeFunction: symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4sizeEv’ unresolved while linking function ‘_Z15__cling_Un1Qu31v’!
ExecutionContext::executeFunction: symbol ‘ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS4’ unresolved while linking function ‘_Z15__cling_Un1Qu31v’![/code]

Hi,
MacOS 10.9 is not supported yet.
Cheers,
Vassil

Ok, it’s great to know that it wasn’t me at least :wink:

By the way, I was able to run some basic code from the REPL and it works (even C++11), as long as you don’t ask for printing something from the REPL.

Thanks.

Stefano

Yes doesn’t need a lot of work to fix it.
Vassil

Hi,

I have just fixed this a few minutes ago: cling now works properly on MacOS 10.9! Enjoy!

The builds on ecsft.cern.ch/dist/cling/ still suffer from a broken include search path so please build your own for now.

Cheers, Axel.