Troubleshooting ROOT Installation on MacOs

  • Thread starter Thread starter CAF123
  • Start date Start date
  • Tags Tags
    installation Root
Click For Summary
ROOT installation on MacOS via 'brew install root' may require additional configuration to resolve include file errors, such as 'assert.h' not found. Users should utilize the -I flag with the gcc command to specify the directory of header files instead of modifying the PATH variable. When running installation scripts, the -I flag should be added to the specific gcc command lines within the script. While sourcing thisroot.sh was previously necessary, ROOT 6.22 has reduced this requirement, leading to confusion about its necessity. Properly configuring the include paths is essential for successful software installation.
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
 
Computer science news 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!
 
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...

Similar threads

Replies
6
Views
9K
Replies
2
Views
3K
Replies
6
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
3
Views
1K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
2
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K