Closed dabro closed 6 years ago
How would "the system" have put it into /usr/local/lib/clang/lib/ if you configured /usr/local/lib/cling/lib/? I guess this is from an earlier build?
No feedback, closing...
Still had the issue when installed as a user. I had to change the clingkernel.py:
if whichCling:
clingInstDir = os.path.realpath(shutil.which('cling'))[:-len('/bin/cling')]
llvmResourceDir = clingInstDir
else:
The main issue was that the instDir was poluted by the current directory.
Is this still an issue after today's update to the "where's my libclingJupyter" logic?
I am still getting the error as well, I can't even find the location of libclingJupyter. Cannot find ' + clingInstDir + '/lib/libclingJupyter.{so,dylib,dll}
Same problem here. I tried installing a kernel for jupyter via
wget https://raw.githubusercontent.com/root-project/cling/master/tools/packaging/cpt.py
./cpt.py --check-requirements && ./cpt.py --create-dev-env Debug --with-workdir=./cling-build/
cd cling-Ubuntu-16.04-x86_64-0.6~dev-3a5d26e/share/cling/Jupyter/kernel/
pip install -e .
jupyer kernelspec install cling-cpp17 --user
(inside a virtualenv using python 3.6).
If I start jupyter notebook it allows me to start a C++17 kernel. However, the kernel dies immediately.
If I run the kernel manually via commandline it says
$ jupyter-cling-kernel
NOTE: When using the ipython kernel entry point, Ctrl-C will not work.
To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.
To read more about this, see https://github.com/ipython/ipython/issues/2049
To connect another client to this kernel, use:
--existing kernel-9898.json
Traceback (most recent call last):
File "~/.virtualenvs/jupyter/bin/jupyter-cling-kernel", line 6, in <module>
exec(compile(open(__file__).read(), __file__, 'exec'))
File "~/bin/cling-Ubuntu-16.04-x86_64-0.6~dev-3a5d26e/share/cling/Jupyter/kernel/scripts/jupyter-cling-kernel", line 4, in <module>
main()
File "~/bin/cling-Ubuntu-16.04-x86_64-0.6~dev-3a5d26e/share/cling/Jupyter/kernel/clingkernel.py", line 354, in main
ClingKernelApp.launch_instance()
File "~/.virtualenvs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "<decorator-gen-123>", line 2, in initialize
File "~/.virtualenvs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "~/.virtualenvs/jupyter/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 465, in initialize
self.init_kernel()
File "~/.virtualenvs/jupyter/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 376, in init_kernel
user_ns=self.user_ns,
File "~/.virtualenvs/jupyter/lib/python3.6/site-packages/traitlets/config/configurable.py", line 412, in instance
inst = cls(*args, **kwargs)
File "~/bin/cling-Ubuntu-16.04-x86_64-0.6~dev-3a5d26e/share/cling/Jupyter/kernel/clingkernel.py", line 138, in __init__
raise RuntimeError('Cannot find ' + clingInstDir + '/lib/libclingJupyter.{so,dylib,dll}')
RuntimeError: Cannot find /home/mkreim/bin/cling-Ubuntu-16.04-x86_64-0.6~dev-3a5d26e/lib/libclingJupyter.{so,dylib,dll}
Like @aisaro , I cannot find the lib via find / -iname "*clingJupyter*"
on my system.
But running cling
works like expected.
Do you have any ideas what is going wrong here? Thanks a lot.
@aisaro - where did you get cling from?
@mkreim - I don't have a lot of experience with cpt.py
, @vgvassilev mind helping out? (And why did you decide to do a Debug build - that's really really slow...) An alternative is the good old traditional build, see here: https://root.cern.ch/cling-build-instructions
@Axel-Naumann : Thanks a lot for your answer and please excuse by delayed answer. There was no reason for doing a Debug build. I simply did not see it (copy & past can be a curse). I retried installing cling using your steps (really much faster and using less resources. Thanks!) and everything went through without any errors:
git clone http://root.cern.ch/git/llvm.git
cd llvm/
git checkout cling-patches
cd tools/
git clone http://root.cern.ch/git/cling.git
git clone http://root.cern.ch/git/clang.git
cd clang
git checkout cling-patches
cd ../../
mkdir build
cd build/
cmake -DCMAKE_INSTALL_PREFIX=~/bin/cling/ -DCMAKE_BUILD_TYPE=Release ../llvm
cmake --build . && cmake --build . --target install
cd ~/bin/cling/share/cling/Jupyter/kernel/
pip install -e .
jupyter kernelspec install cling-cpp11 --user
jupyter kernelspec install cling-cpp14 --user
jupyter kernelspec install cling-cpp17 --user
jupyter kernelspec install cling-cpp1z --user
Again cling works as expected but all four kernels crash immediately after opening a notebook in jupyter (like before). However, this time I could find the needed library ~/bin/cling/lib/libclingJupyter.so
So all I was left to do was adding the library path to my .bashrc:
CLANG_PATH=~/bin/cling/
export LIBRARY_PATH=${CLANG_PATH}/lib/:$LIBRARY_PATH
export CPATH=${CLANG_PATH}/include/:$CPATH
export LD_LIBRARY_PATH=${CLANG_PATH}/lib/:$LD_LIBRARY_PATH
And after a restart of jupyter I can now run silly C++ code:
So Thanks a lot, @Axel-Naumann !
OK looks like this was settled years ago - let me close it then :-) Please suggest PRs to READMEs and build files as needed to make things more stable!
After troubleshooting the following:
I found libclingJupyter.dylib in
/usr/local/lib/clang/lib/
instead of/usr/local/lib/cling/lib
, where the system expected it:https://github.com/root-mirror/cling/blob/master/tools/Jupyter/kernel/clingkernel.py https://github.com/root-mirror/cling/commit/cc2ca03981c993a432942afbc31803fc8a5dc2dd
for me, either
which cling
in bash orwhichCling = shutil.which('cling')
in python return/usr/local/lib/cling
.I installed using cmake:
after removing
CBackend\;