Installation of root on Mac

Hi everyone,
I am trying to install root on my new macbook. so I did something like this:

cd root-6.08.06_build/
sudo cmake -DCMAKE_INSTALL_PREFIX=/opt/root/root-6.08.06_install/ /opt/root/root-6.08.06
sudo make

After a while running, I type root but it says command root not found.
Could someone tell me please it doesn’t work.
I would appreciate.
Cheers

Dear diboye,

If the build was successful, have you tried sourcing the thisroot script as suggested here?

https://root.cern.ch/building-root

You also need to run “make install” if you want ROOT to be installed at /opt/root/root-6.08.06_install/

Best,

Enric

Dear Enric
Thanks for replying.
Here is for instance the list of directories I have in /opt/root:
root-6.08.06 root-6.08.06_build root-6.08.06_install root_v6.08.06.source.tar
And the last commands I did are:

sudo cmake -DCMAKE_INSTALL_PREFIX=/opt/root/root-6.08.06_install/ /opt/root/root-6.08.06
sudo make

In root-6.08.06_build directory.
After that following your link in your message I did this:

source ./bin/thisroot.sh

in root-6.08.06_build directory, and when I run root it works.
I do also this:

cmake --build . --target install

still in the building directory.
But when I closed the terminal and open another one I got still “command root not found” when I run root.
Cheers

Dear All again,
I realize that I have to do always this:

source /opt/root/root-6.08.06_install/bin/thisroot.sh

whenever I open a new terminal to be able to run root. I thought putting this line in the .bashrc file would resolve that but it’s not the case.
Could someone tell me please how to resolve this.
Cheers

Dear diboye,

Adding the line to .bashrc should indeed solve the issue if you are using a non-login shell.

Can you check that your .bashrc is actually being taken into account? What happens if you add a variable definition there, is it kept?

Enric

Dear Enric,
if I add “source /opt/root/root-6.08.06_build/bin/thisroot.sh” on my .bashrc file, I can still see it if I do vi ~/.bashrc so I deduced that’s kept.
Cheers

Dear diboye,

What I tried to suggest is, what happens if you export a environment variable in your .bashrc, save the file and then open a new terminal? Do you see the variable? If yes, the same thing should happen when you source thisroot.sh from your .bashrc.

If you still have the issue, please paste here your .bashrc.

Enric

Dear diboye,

is the .bashrc actually sourced properly when you open a new terminal?
I remember it is not done automatically on Mac, one needs to add the line “source ~./bashrc” specifically in the terminal settings.

Cheers,
heico

Dear all,
thanks for replying.
I am not sure to understand how to know that the .bashrc is sourced properly so I prefer to put here what I got if I open a new terminal, this is what I got:

Last login: Tue Apr 25 12:23:35 on ttys000
boyemacpro:~ dialloboye$

And if I do vi ~/.bashrc, this is what I can see inside the bashrc file:

source /opt/root/root-6.08.06_install/bin/thisroot.sh
~                                                                               
~                                                                               
~                                                                               
~                                                                                                                                                                                                                                                                                                                                                                         
"~/.bashrc" 1L, 54C

Cheers

By default on macs a new terminal is launched as a login terminal and read .profile. Simply move the source command to this file.

Dear ksmith,
I moved the source command line to this profile file .
But I still need to do:
source /opt/root/root-6.08.06_install/bin/thisroot.sh
before running root if I open a new terminal
Cheers

Dear diboye,

You might find your answer here, e.g. you can also try ~/.bash_profile (although ~/.profile should be read too):

Enric

Dear Enric,
Thanks a lot I put the command line on .bash_profile file and it works now.
Cheers

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.