We used ‘custom CINT’ (CINT built with our proprietary compiled functions) many years ago with older versions of linux (Ubuntu 12.x and earlier). We are now moving to Ubuntu 22.x and would like to similarly build a custom interpreter like we had with CINT.
I was able to download the ROOT source and build it on our platform for simple command line usage to test it out. But I am not finding any similarities in terms of easily building ROOT with our compiled code like I did with ‘makecint’.
We don’t need all the power of ROOT. I think the best way is to use Cling but I am not sure if I am on the right track as I have not found anything that would integrate several source files into the interpreter. Perhaps I am not looking in the right place.
Our code is quite extensive with its directory structure and makefiles that will build the dozens of .o files properly. The aim is to integrate the API into the interpreter so that users can write their own scripts with the functions defined in the API.
Where can I find examples/of building Cling with our code? Or is there another solution?
I have not made much headway. I was wondering if there is something wrong with my environment (build/installation) or just with my understanding. I am able to do a few things but nothing close to being able to get a single custom interpreter tool (say, ‘myroot’) that would have the ability to run a script that invokes functions that are built into ‘myroot’.
But before I go there, I’d like to know why I get 2 different outputs with the same script/source file if I execute it differently.
Yes, that is absolutely right. Additionally, the __CINT__ and __ROOTCLING__ preprocessor macros are defined by rootcling during dictionary generation.
Did you progress with that? If you don’t need any features from ROOT, but just the C++ interpreter services, then you should probably take cling as a (leaner) base.
If you want to use cling as a library from your program, here is an example that can be used as a starting point: cling/tools/demo at master · root-project/cling · GitHub.
When I tried doing some things on the lines of the demo, I got several errors of the “not found”, “not defined” nature. For ex., make could not resolve
I can see the above header file in several subdirectories but don’t understand why the path for the right one is not set. On another error, I specified the path (to cmake) with -D and got a warning that “manually specified variables were not used”.
I decided to rebuild cling in case I had missed something the first time. Using this -
I noticed an error on the build instructions. The following line in the second block of commands to confiigure and build cling -
cmake -DCMAKE_INSTALL_PREFIX=[Install Path] -DCMAKE_BUILD_TYPE=[Build configuration, e.g. Release or Debug] …\src
It should be -
cmake -DCMAKE_INSTALL_PREFIX=[Install Path] -DCMAKE_BUILD_TYPE=[Build configuration, e.g. Release or Debug] …/…/src
In the first block of instructions to check out from Git, we cd down 3 levels from top, then cd up 2 levels. We are in “src” where we do mkdir build and then cd build. Now “src” is two levels up.
(Minor bug - there is a mix of forward and back (Windows?) slashes for paths)
I saw something similar while building root.
After my build of cling completes, I will see what I can do and report back. Thank you.
I don’t know why my msg above puts 3 dots in the paths instead of 2. Editing only shows 2 dots.
Could someone point me to the tools for posting on this forum? It does not have some std features I am used to (I am not seeing/finding them). For example, how to quote a post selectively before replying, how to mark something as a code block etc. Is there a way to preview how the post is going to look before I press “Reply”?
When I clicked on the " on the toolbar, it printed “> Blockquote”. No idea what that would do and didn’t want to quote an entire post.
So, I copied ClingConfig.cmake to clingConfig.cmake in the install-dir and the error went away.
Since the cling config files I found have an uppercase C in the name, I tried -DCling_DIR in the cmake command and got this warning for Cling_DIR -
“manually specified variables were not used by the project”
Is copying the “ClingConfig.cmake” to “clingConfig.cmake” the right way forward?
I am at a dead end. I started another thread to find a solution via Cling because we mostly need an interpreter and not the other features of ROOT. My requirements and limitations are described in that thread.
I am able to build (a kind of) custom Cling with a shared library that has our proprietary functions but don’t have many answers that would enable us to use Cling instead of Cint for our existing tool set of test scripts.
With Cint, it was possible to automate some functionality and do things “behind the scenes” without requiring the user to type anything. I have been unable to find similar features in Cling so far.