Overwriting root.systemrc settings in a snapd install


ROOT Version: 6.30/02
Platform: Ubuntu 11.4.0-lubuntul-22.04
Compiler: Not Provided


I’ve install root-Framework on ubuntu which is a snap installation. The system.rootrc file is located in /snap/root-framework/current/usr/local/etc/ which is a read only file system. When I use root on Fedora, an rpm based linux system, system.rootrc is installed in /usr/share/root/etc or something like that but more importantly, it’s a read-write file system so I can edit system.rootrc. What’s the way to modify the values in system.rootrc, for example Unix.*.Root.MacroPath so I can add to the directory search for my macros without editing system.rootrc?

Thanks.

Create a .rootrc file in your ${HOME} directory

I created the .rootrc in my home directory but it doesn’t seem to be working. Is there a way to find out if root on startup is picking up the .rootrc file?

You can start root and ask to print a value, for example X11.UseXft:

root [0] gEnv->GetValue("X11.UseXft",1)
(int) 1
root [1] .q

then modify this value in your ${HOME}/.rootrc (set it to no):

X11.UseXft:              no

and try again:

root [0] gEnv->GetValue("X11.UseXft",1)
(int) 0
root [1] .q

And you can also print the value of Unix.*.Root.MacroPath:

root [1] gEnv->GetValue("Unix.*.Root.MacroPath","")
(const char *) ".:C:\root-dev\build\x64\debug/macros:/whatever"
root [2]
tsadler@nci-02219888-vx:~$ pwd
/home/sadler
sadler@nci-02219888-vx:~$ more .rootrc

# Author: Fons Rademakers  22/09/95

# ROOT Environment settings are handled via the class TEnv. To see
# which values are active do: gEnv->Print().

# Path used by dynamic loader to find shared libraries.
# This path will be appended to the (DY)LD_LIBRARY_PATH on Unix
# and to PATH on Windows.
# Paths are different for Unix and Windows. The example shows the defaults
# for all ROOT applications for either Unix or Windows.
#Unix.*.Root.DynamicPath:    .:$(ROOTSYS)/lib
#WinNT.*.Root.DynamicPath:   .;$(ROOTSYS)/bin

# Path used to find macros.
# Paths are different for Unix and Windows. The example shows the defaults
# for all ROOT applications for either Unix or Windows.
#Unix.*.Root.MacroPath:      .:$(ROOTSYS)/macros
#WinNT.*.Root.MacroPath:     .;$(ROOTSYS)/macros
Unix.*.Root.MacroPath:      .:$(ROOTSYS)/macros:$(HOME)/develspace/uDoseCal/Trun
k/uDoseCTools:$(HOME)/develspace/uDoseCal/Trunk/Macros:$(HOME)/develspace/TelaTo
ols/Trunk

sadler@nci-02219888-vx:~$ root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.30/02                        https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Nov 28 2023, 21:57:24                 |
  | From tags/v6-30-02@                                              |
  | With c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0                   |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

Error in <TRint::ProcessLine>: macro libTelaTools.so not found in path .:/snap/root-framework/928/usr/local/macros
Error in <TRint::ProcessLine>: macro libEnergyCalib.so not found in path .:/snap/root-framework/928/usr/local/macros
Error in <TRint::ProcessLine>: macro MacroUtil.C not found in path .:/snap/root-framework/928/usr/local/macros
root [0] gEnv->GetValue("Unix.*.Root.MacroPath","")
(const char *) ""
root [1] 
ype or paste code here

I can confirm that the root distribution I installed on RHEL 8 works. In that I can copy system.rootrc to my home directory as .rootrc and I can customize the root environment. But it does not seem to work on ubuntu. :frowning:

That’s weird. Maybe someone having experience on Ubuntu could help here. Maybe @vpadulan ?

I installed root using the “apt install root-Framework” command. I’m going to install the prebuilt ubuntu binaries and see how that goes.

I’d like to report that the ubuntu pre-built binaries for root 6.31/01

type or paste    ------------------------------------------------------------------
  | Welcome to ROOT 6.31/01                        https://root.cern |
  | (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Jan 31 2024, 02:31:37                 |
  | From remotes/origin/master@v6-31-01-878-g0afffc6fc9              |
  | With c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0                   |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

works fine, in that this version properly picks up the .rootrc in my home directory. I’ve removed the snap installed root-Framework package and I’m now using the pre-built binaries…

OK, thanks for the information. And sorry, but I have no experience with snap…

Hey,

Sorry for the long delay. The equivilent for $HOME/.rootrc for the snap would be $HOME/snap/root-framework/current/.rootrc, this is because the Snap sandboxing prevents hidden files in the top level of $HOME to prevent access to .config, .ssh, etc; as well as to allow having multiple differing configs if people have multiple versions of the snap installed.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.