Troubleshooting ROOT Installation on MacOs

  • Thread starter Thread starter CAF123
  • Start date Start date
  • Tags Tags
    installation Root
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
CAF123
Gold Member
Messages
2,918
Reaction score
87
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
 
on Phys.org
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 !
 
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
 
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!