Advice for running multiple ROOT installs?

Hi, I have ROOT 5 and 6 both installed locally in separate prefixes. Currently I switch between them by using “source” on the specific bin/thisroot.sh file and then just using “root”. It would be nice to be able to call upon either without this step. I can easily make aliases “root5” and “root6” for the specific binary executables, but then all the environment variables are wrong.

I am wondering if there is a better way that does not depend on a script & environment variables. Is there any way that I can have root 5 and 6 available at the same time? What about different versions of ROOT 5?

I guess the obvious workaround for me is to have “root5” and “root6” be more elaborate functions that source the correct thisroot.sh script before running root. Is there any problem with repeatedly running thisroot.sh every time I run root? Definitely a problem with this approach is that it leaves the meaning of bare “root” dependent on which of the previous roots was run. I guess it’s not so much of a problem if I get used to always using root5 or root6 instead of root.

Jean-François

I am doing that. It is fine for me. (I am working with 6 versions of ROOT: 5.34, 6 head, 6.02 each of them with X11 and cocoa).

for instance you can have:

root5 ==>

CWD=$PWD
cd where-your-root5-is-installed
. bin/thisroot.sh
cd $CWD
root

root6 ==>

CWD=$PWD
cd where-your-root6-is-installed
. bin/thisroot.sh
cd $CWD
root

You can run root5 and root6 alternatively

Thanks. I did:

alias root5='source ~/Software/custom_root/compiled/bin/thisroot.sh;root -l'
alias root6='source ~/Software/custom_root/root6/root/bin/thisroot.sh;root -l'

and it seems to work. As far as I can tell, you only need to actually cd to the bin directory to run thisroot.sh if your shell is kind of old and cranky. (according to my reading of thisroot.sh)

Yes your solution is good too.
Having scripts has two advantages:

  1. you can have options. In my case I can choose between cocoa and X11
  2. A new shell is created so the environment variables of your current shell are not changed by “thisroot.sh”.

Hi! Are you doing this on Linux? What would be the equivalent into Windows environment?

Use the root\bin\thisroot.bat batch script

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