Troubleshooting ROOT Installation on MacOs

In summary, to install root on a MacOs system you need to either use 'brew install root' or add the -I flag to the gcc command when running the program.
  • #1
CAF123
Gold Member
2,948
88
ROOT is required as a pre-requisite for some software that I am trying to install. I'm on a MacOs system and I have tried to install using 'brew install root'. Do I need to do anything else? How can I check that root was successfully installed?

When I tried to install said software, apparently files in the root directory cannot be found, e.g. error

/usr/local/Cellar/root/6.22.06_1/etc/root/cling/lib/clang/5.0.0/include/assert.h:8:15: fatal error: 'assert.h' file not found

I have checked this manually and the file is there so I don't understand why it is not found. I also tried the following line in my .zshrc file

export PATH=$PATH:/usr/local/Cellar/root/6.22.06_1/etc/root/cling/lib/clang/5.0.0/include/assert.h

and

export PATH=$PATH:/usr/local/bin/thisroot.sh

Any ideas of what may be going wrong? Thanks in advance
 
Computer science news on Phys.org
  • #3
Hi jedishrfu, thanks for your reply
jedishrfu said:
The C compiler requires setting a command flag for include files usually the -I flag on the command line call.

https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html

Basically adding the header to the PATH is the wrong approach.
I installed root via 'brew install root' and apparently:

'As of ROOT 6.22, you should not need the thisroot scripts; but if you depend on the custom variables set by them, you can still run them:

For bash users:
. /usr/local/bin/thisroot.sh
For zsh users:
pushd /usr/local >/dev/null; . bin/thisroot.sh; popd >/dev/null
For csh/tcsh users:
source /usr/local/bin/thisroot.csh
For fish users:
. /usr/local/bin/thisroot.fish'

I've tried also the zsh profile command (I have a .zshrc file) but it does not fix the problem. Could you elaborate on the -I flags you mentioned? I am running an installation script for a piece of software via ./ command. Do you mean I need to append this command by some -I flags? If so, could you show me an example of what such a flag might look like? Thanks !
 
  • #4
The -I flag is used with the cc or gcc command to indicate where certain header files are located.

Bash:
$$ gcc myprogram.c -o myprogram -I /usr/local/Cellar/root/6.22.06_1/etc/root/cling/lib/clang/5.0.0/include
 
  • #5
Thanks. Few comments:
1) In my case, I am running an installation script via ./ Does this mean I need to append this command with -I flags or just the line(s) in the script where gcc is used?
2) If the number of include files gets arbitrarily large then appending gcc myprogram.c with lots and lots of -I flags seems inefficient. Is there not some way to specify the directory of all these include files with a single command in a .zshrc file? This is what I had been trying to do before and, in particular, all sources I have read indicate that sourcing thisroot.sh is sufficient (and actually in root 6.22 even doing this is not required).
Thanks!
 

1. What is ROOT and why would I need to install it on MacOs?

ROOT is a software framework used in high-energy physics to store, analyze, and visualize data. It is used by researchers and scientists to process and interpret large amounts of data from experiments. If you are working in this field or conducting research in a related area, installing ROOT on MacOs can greatly improve your data analysis capabilities.

2. How do I install ROOT on MacOs?

There are a few different methods for installing ROOT on MacOs, but the most common and recommended way is to use the Homebrew package manager. This can be done by opening the Terminal application and entering the command "brew install root". Alternatively, you can also download the installation package from the ROOT website and follow the instructions provided.

3. Are there any system requirements for installing ROOT on MacOs?

Yes, there are some system requirements that must be met in order to successfully install and run ROOT on MacOs. These include having a 64-bit operating system, at least 4GB of RAM, and a recent version of Xcode and its command line tools installed. It is also recommended to have a fast internet connection for downloading the necessary packages.

4. Can I have multiple versions of ROOT installed on my MacOs?

Yes, it is possible to have multiple versions of ROOT installed on your MacOs. This can be useful if you need to work with different versions of ROOT for different projects. You can use Homebrew to manage multiple versions by using the "brew switch" command, or you can manually install different versions in separate directories.

5. Is it necessary to have any prior programming experience to use ROOT on MacOs?

While having programming experience can certainly be helpful when using ROOT, it is not necessary to have any prior experience to use the software. ROOT has a user-friendly interface and provides a variety of tools for data analysis and visualization, making it accessible to users with varying levels of programming knowledge.

Similar threads

Replies
6
Views
6K
Replies
2
Views
2K
Replies
6
Views
3K
  • Nuclear Engineering
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
896
  • Programming and Computer Science
Replies
3
Views
680
  • Programming and Computer Science
Replies
2
Views
314
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
0
Views
517
Replies
2
Views
5K
Back
Top