Source root installed from snap

Hello All,

I am using root in Ubuntu OS. It was pre-installed by someone using snap. So, I can’t seem to find the version info there.

I need to source it because I need it to install some other packages where ROOT is required. They can’t find root as the bashrc file doesn’t contain path of thisroot.sh.

I tried to search thisroot.sh and added that path in the bashrc file. That didn’t work either. Is there some other way to source root installed via snap?

Thank You

Using find on thisroot.sh does not tell you where thisroot.sh is ?

I tried locating thisroot.sh using locate. I added that address (/snap/…) in the .bashrc file. But still, I got the same problem. I also tried using source thisroot.sh in that location, but that doesn’t add the source /snap/…/thisroot.sh line in the .bashrc file either.

You should source it. Once done you should have the $ROOTSYS defined.
Try to check if it is the case with:

echo $ROOTSYS

Hello,

The ROOT Snap isn’t ideal for linking to arbitary external packages, since it runs in a container, it’s impossible to guarantee ABI compatibility with anything other than the contents shipped directly inside its own container. This is why there’s no thisRoot.sh for it, because the constraints of the design make it impractical to be used in this manner.

I’m curious which package you’re trying to link against? It’s possible it might make sense to include in the upstream snap itself, might make sense as another snap, or might possibly work if built and run in the container itself (but while you can give it a go using this, it’s not something usually advertised because it has its own caveats).

E.G, you can run cmake inside the snap with root-framework.cmake /path/to/build/dir, or work with gcc more directly with root-framework.gcc. Binaries produced this way can be run with root-framework.run executableName, and will run inside the container itself. The caveats are the snap won’t have source built in for common packages you might need (e.g, QT), and you’d likely desire to prevent updates to future releases, or you might find that you have to repeat building in this manner overtime.

But ultimately, it’s probably easiest if you downloaded and used pre-built binary packages, Conda, etc, which work much more traditionally. (You could even have multiple of these existing together and swap between them, if that makes sense for you!). The pre-compiled binary packages would have thisRoot.sh as you expect and hopefully be a drop in solution for you.