[Solved] Re: Default Macro Path

Hello, I will first identify myself as an undergrad physics student and I am not very familiar with Linux or ROOT.

I managed to install ROOT on Linux Mint 17 with several different sources online.

Something I am having difficulty with is to set a default path for the ROOT, crrently I can access the files that I wish to by using TBrowser or opening root from my “Rootdocs” directory in home.

With Python I was able to find something like this to add on my .bashrc

#Allows modules loaded on Pydocs to be imorted without hassle
export PYTHONPATH=$PYTHONPATH:~/Pydocs
export PYTHON_PATH=$PYTHON_PATH:~/Pydocs

but with Root, I haven’t been able to find a way to setup a default path for it.

I was wondering if there was a way to set a default path for ROOT.

Thank you for your time
-SJL.

If you mean a default path for finding macros (like for finding python modules), then that would be the MacroPath variable in your .rootrc file. The .rootrc file is probably hidden because it starts with a “.”, so use “ls -a” to list all files. It normally lives in your home directory at ~, or /home/yourusername/. If you have a file there called .rootrc, then open it with a text editor and either edit this line, or add it if it’s not present:

Unix.*.Root.MacroPath:      .:$(HOME)/Macros:/opt/local/etc/root/plugins:

That’s the MacroPath for my system. It’s a typical PATH variable format, basically a list of directories separated by “:”. In my case the MacroPath includes “.” (the current directory), $(HOME)/Macros (where I keep my own macros), and a system directory where ROOT keeps plugins. You can add your own MacroPath entry to the end of the list. Keep in mind that when looking for Macros, ROOT uses the first one it finds, so if you have a Macro whose name is the same as something in a later path, there might be conflicts.

If you don’t have a file called .rootrc, you can create a new text file at ~/.rootrc and just add the line above. Everything else will be the system default unless you override it.

Jean-François

Thank you very much. It’s working great