xeus-cling
xeus-cling copied to clipboard
Installing without conda on Debian-based systems
UPDATE 2023
For Ubuntu 20.04 and 22.04 use this PPA instead:
https://launchpad.net/~ppa-verse/+archive/ubuntu/cling
See more details in https://github.com/jupyter-xeus/xeus-cling/issues/423#issuecomment-987249343
ORIGINAL POST
In case anyone is interested, I've created Debian packages for Cling and xeus-cling along with patched version of LLVM/Clang libraries, which can be easily installed through @ppa-verse/cling PPA without having to use conda.
I've tested these on Ubuntu 21.04, but I imagine they should also work on any other Debian-based system.
You can install the PPA on your system as follows:
curl https://ppa-verse.github.io/cling/cling.list | \
sudo tee /etc/apt/sources.list.d/cling.list
curl https://ppa-verse.github.io/cling/KEY.gpg | \
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/cling-keyring.gpg --import
sudo apt update
To install Cling run:
sudo apt install cling
To install xeus-cling run:
sudo apt install xeus-cling
Share and enjoy.
Wow this is awemsome! Congratz and thanks for the hard work and for sharing this!
Thanks for this. It is great!
I would really like to see the xeus parts packaged into core Debian at some point!
I would really like to see the xeus parts packaged into core Debian at some point!
That would require the Cling patches being accepted into LLVM/Clang 9. I can submit a PR and see where it goes. 🤷🏻 Although, Cling is transitioning to Clang-repl, so I am not holding my breath for them being accepted:
https://root.cern/blog/cling-in-llvm/
@SylvainCorlay FYI https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/merge_requests/75
Thanks @dimitry-ishenko!
Indeed, packaging cling is hard, but core xeus should be easier. Streamlining the packaging of xeus would enable many other kernels (xeus-robot, xeus-lua, xeus-sql).
@SylvainCorlay but xeus is already in Debian:
https://packages.debian.org/sid/libxeus1 https://packages.debian.org/sid/xeus-dev
Or am I misunderstanding you?
If you are interested, I can try to package xeus-{robot,lua,sql} and make them available in my PPA for now.
@dimitry-ishenko that would be awesome!
Thanks for this, I would love to be able to install this on debian without conda but it seems there are some unmet dependencies that can't be installed
The following packages have unmet dependencies: cling : Depends: cling-common (= 0.9.1-2) but it is not going to be installed Depends: libclang-cpp9 (> 2:9~) but it is not going to be installed Depends: libc6 (>= 2.33) but 2.31-13+deb11u2 is to be installed Depends: libllvm9 (> 2:9~) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
and libllvm9 : Depends: libc6 (>= 2.33) but 2.31-13+deb11u2 is to be installed Depends: libffi8ubuntu1 (>= 3.4~20200819) but it is not installable
this is on debian 11 bullseye. Thanks!
@BretG137 I am in the process of moving everything to launchpad, so that I can support both LTS and current version of Ubuntu. The PPA can be found here:
https://launchpad.net/~ppa-verse/+archive/ubuntu/cling
It doesn't have xeus-cling at the moment, as I need to fix one dependency. Should be able to do that in the next day or two.
Unfortunately, there is no support for Debian on launchpad... I would also like to add support for Debian, but need to figure out how to do that.
@BretG137 all the packages are now in my launchpad PPA called: cling. Debian bullseye seems to be roughly equivalent to Ubuntu LTS 20.04 (aka, focal). So, you can try the following:
# add the PPA
echo "deb [signed-by=/usr/share/keyrings/ppa-verse-keyring.gpg] http://ppa.launchpad.net/ppa-verse/cling/ubuntu focal main" | \
sudo tee /etc/apt/sources.list.d/cling.list
# import the key
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/ppa-verse-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 9A571B8F2E9F9D11
sudo apt update
# install cling
sudo apt install cling
# and/or xeus-cling
sudo apt install xeus-cling
I've tried it in a bullseye chroot and was able to install both.
@BretG137 all the packages are now in my launchpad PPA called: cling. Debian bullseye seems to be roughly equivalent to Ubuntu LTS 18.04 (aka, focal). So, you can try the following:
# add the PPA echo "deb [signed-by=/usr/share/keyrings/ppa-verse-keyring.gpg] http://ppa.launchpad.net/ppa-verse/cling/ubuntu focal main" \ sudo tee /etc/apt/sources.list.d/cling.list # import the key sudo gpg --no-default-keyring --keyring /usr/share/keyrings/ppa-verse-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 9A571B8F2E9F9D11 sudo apt update # install cling sudo apt install cling # and/or xeus-cling sudo apt install xeus-clingI've tried it in a bullseye chroot and was able to install both.
Thanks for doing this but I wound up installing it through miniconda instead.
@BretG137 all the packages are now in my launchpad PPA called: cling. Debian bullseye seems to be roughly equivalent to Ubuntu LTS 18.04 (aka, focal). So, you can try the following:
# add the PPA echo "deb [signed-by=/usr/share/keyrings/ppa-verse-keyring.gpg] http://ppa.launchpad.net/ppa-verse/cling/ubuntu focal main" \ sudo tee /etc/apt/sources.list.d/cling.list # import the key sudo gpg --no-default-keyring --keyring /usr/share/keyrings/ppa-verse-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 9A571B8F2E9F9D11 sudo apt update # install cling sudo apt install cling # and/or xeus-cling sudo apt install xeus-clingI've tried it in a bullseye chroot and was able to install both.
@dimitry-ishenko
- The first instruction is missing a pipe operator.
- xeus-cling is not available on 20.04? I could install cling, but not xeus-cling
@qlibp thanks I've fixed the instructions. Will try to add 20.04 version of xeus-cling soon.
@dimitry-ishenko Yet another question, can clang compiled xeus-cling load gcc-compiled share lib? If not, is there a way to achieve this? Manually compile cling & xeus-cling with os-provided compiler?
@dimitry-ishenko Would you please show us the way to compile cling & xeus-cling from source manually? The cling version provided in ppa supports only c++11. However, the lib I would like to use require an c++14 version.
It would be great if I could build it for my own environment
@dimitry-ishenko Yet another question, can clang compiled xeus-cling load gcc-compiled share lib?
I've never tried it, but I believe so. IIRC in cling you can load shared libs with the .L command. I imagine there is a way to do that with xeus-cling as well. You might want to open another issue for this. I just do Debian packaging for xeus-cling.
If not, is there a way to achieve this? Manually compile cling & xeus-cling with os-provided compiler?
Well, both cling and xeus-cling are compiled with the OS provided compiler. Not sure I understand the question
The cling version provided in ppa supports only c++11. However, the lib I would like to use require an c++14 version.
cling 0.9 in my PPA supports whatever Clang 9 does, which is up to and including c++17. I did have issues with using std::filesystem classes though.
Here is a c++17 example:
@dimitry-ishenko Would you please show us the way to compile cling & xeus-cling from source manually?
It's pretty much a matter of running cmake followed by make. That's about it. The only thing is, cling depends on a patched version of LLVM/Clang 9.
Maybe if you tell me what you are trying to accomplish and I will see if I can help you?
@qlibp also check out issue https://github.com/jupyter-xeus/xeus-cling/issues/87 which tells you how to load 3rd party shared libs.
@qlibp there is now Ubuntu 20.04 version of xeus-cling in the PPA. You can give it shot
The cling version provided in ppa supports only c++11. However, the lib I would like to use require an c++14 version.
cling 0.9 in my PPA supports whatever Clang 9 does, which is up to and including c++17. I did have issues with using
std::filesystemclasses though.
@dimitry-ishenko Thanks for your demonstration. It's my bad. I even don't know how to enable cling to use c++14!
Hint, just type in __cplusplus, cling will return the c++ standard it's using.
Also, another question, if we use std=c++14, I guess we could still load c++11-compiled share libs?
@dimitry-ishenko Would you please show us the way to compile cling & xeus-cling from source manually?
It's pretty much a matter of running
cmakefollowed bymake. That's about it. The only thing is, cling depends on a patched version of LLVM/Clang 9.Maybe if you tell me what you are trying to accomplish and I will see if I can help you?
@dimitry-ishenko In my situation, I would like to use cling + xeus-cling to set up my ROS env(a robotics eco-system). And most of their packages are delivered through apt(i.e. debian pacakge) relying on os-packed gcc compiler. I'm not pretty sure if those gcc-compiled packages can be loaded with the clang-compiled cling(correct me if I misunderstand how cling & xeus-cling is built, i saw you use the llvm toolchain so i assume that all these stuffs are built with clang). I will try it out today and see if this could work out.
If the gcc-compiled debian packages can't be loaded by clang-compiled cling, then I guess i need to use the os-packed gcc toolchain to built cling & xeus-cling in order to enable my workflow
@qlibp there is now Ubuntu 20.04 version of xeus-cling in the PPA. You can give it shot
@dimitry-ishenko
Q1: it's weird that when I apt-get install xeus-cling, it told me that unable to locate package xeus-cling though i could see it in the weblink.
A1: OK, searching around the apt-cache, I figure out the correct package name
apt-get install xeus-cling-dev but not apt-get install xeus-cling
Q2: But I could not find out the xcpp kernel executable?
A2: apt-get install xcpp
Also, another question, if we use std=c++14, I guess we could still load c++11-compiled share libs?
@qlibp AFAIK there is no ABI changes between c++11 and c++14, so you should be fine.
Q1: it's weird that when I apt-get install xeus-cling, it told me that unable to locate package xeus-cling though i could see it in the weblink. A1: OK, searching around the apt-cache, I figure out the correct package name apt-get install xeus-cling-dev but not apt-get install xeus-cling
Q2: But I could not find out the xcpp kernel executable? A2: apt-get install xcpp
That's right you just need to install xcpp to use the kernel in jupyter.
In my situation, I would like to use cling + xeus-cling to set up my ROS env(a robotics eco-system). And most of their packages are delivered through apt(i.e. debian pacakge) relying on os-packed gcc compiler. I'm not pretty sure if those gcc-compiled packages can be loaded with the clang-compiled cling(correct me if I misunderstand how cling & xeus-cling is built, i saw you use the llvm toolchain so i assume that all these stuffs are built with clang). I will try it out today and see if this could work out.
@qlibp both cling and xeus-cling (which simply uses libcling under the hood) are compiled using gcc that comes with Ubuntu. cling does use LLVM/Clang 9 to interpret your c++ code, but you should still be able to link with other shared libs installed in the system.
In my situation, I would like to use cling + xeus-cling to set up my ROS env(a robotics eco-system). And most of their packages are delivered through apt(i.e. debian pacakge) relying on os-packed gcc compiler. I'm not pretty sure if those gcc-compiled packages can be loaded with the clang-compiled cling(correct me if I misunderstand how cling & xeus-cling is built, i saw you use the llvm toolchain so i assume that all these stuffs are built with clang). I will try it out today and see if this could work out.
@qlibp both cling and xeus-cling (which simply uses libcling under the hood) are compiled using gcc that comes with Ubuntu. cling does use LLVM/Clang 9 to interpret your c++ code, but you should still be able to link with other shared libs installed in the system.
Cool, thanks for correcting me! So down to earth, cling&xeus-cling and all their dependencies(including llvm/Clang libs) are compiled with gcc?
So, down to earth, the c++ code is translated into some middle level language by llvm and finally follows the gcc abi to translate it into the binary?
@qlibp
Cool, thanks for correcting me! So down to earth, cling&xeus-cling and all their dependencies(including llvm/Clang libs) are compiled with gcc?
Correct.
So, down to earth, the c++ code is translated into some middle level language by llvm and finally follows the gcc abi to translate it into the binary?
Also correct. Watch me link against a GUI library called Qt and create a blank window straight from cling:
