Troubleshooting ROOT Installation on MacOs

  • Thread starter Thread starter CAF123
  • Start date Start date
  • Tags Tags
    installation Root
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting the installation of ROOT on MacOS, specifically addressing issues related to missing header files during the installation of dependent software. Participants explore command-line flags, environment variable settings, and the use of installation scripts.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant describes an issue with missing files after attempting to install ROOT via 'brew install root' and questions how to verify the installation.
  • Another participant suggests that the C compiler requires the use of the -I flag for include files, indicating that modifying the PATH is not the correct approach.
  • A participant acknowledges the advice and seeks clarification on how to apply the -I flag in the context of running an installation script.
  • Further clarification is provided on the use of the -I flag with the gcc command to specify the location of header files.
  • A participant raises concerns about the efficiency of using multiple -I flags and questions whether there is a way to specify include directories in the .zshrc file instead.

Areas of Agreement / Disagreement

Participants express differing views on the necessity and application of the -I flag versus modifying the PATH, indicating that multiple competing views remain regarding the best approach to resolve the installation issues.

Contextual Notes

There are unresolved questions about the correct application of the -I flag in installation scripts and the efficiency of managing multiple include directories.

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!
 

Similar threads

Replies
6
Views
9K
Replies
2
Views
3K
Replies
6
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
3
Views
2K
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