Embedding cling

Hi,

I have seen on the web that there is a libCling to be used for embedding cling into other apps.

I did not find it in the cling distribution for OS X though. Maybe it’s just me being blind but could you please tell me how to find it?

Also, I tried embedding by using the static libs used to compile cling.cpp as written on another post and it looks like there is a dependency with termcap (or ncurses).

How do I remove this dependency?

Thanks,
Alessandro

Hi Alessandro,

The static libs are the way to go; libCling is ROOT’s packaging of cling. the dependency on curses comes from libclingUserInterface; just don’t link that if you don’t want a prompt. Easy! :slight_smile:

Cheers, Axel.

Thanks :slight_smile:

FYI to me it looks like the dependency comes from LLVM, not cling:

…/lib/libLLVMSupport.a(Process.o): In function llvm::sys::Process::FileDescriptorHasColors(int)': Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x76): undefined reference tosetupterm’
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x98): undefined reference to tigetnum' Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0xa1): undefined reference toset_curterm’
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0xa9): undefined reference to `del_curterm’

and apparently this is a bug in ‘llvm-config’ which does not add ‘-ltinfo’

bugzilla.xamarin.com/show_bug.cgi?id=17931

To summarize I needed ‘-ltinfo -ldl -lz’ in addition to

llvm-config --cxxflags --ldflags --libs
-lclangFrontend
-lclangDriver
-lclangSerialization
-lclangCodeGen
-lclangParse
-lclangSema
-lclangAnalysis
-lclangEdit
-lclangAST
-lclangLex
-lclangBasic

to build code with ‘-lclingInterpreter -lclingUtils -lclingMetaProcessor’.

Hi,

try llvm-config --system-libs

Axel.