Bash terminal only runs root macros

I have a mac book pro and i am only able to run root macros on my terminal but I need to run the tutorials.

Pls, how can I run the tutorials on my terminal?

MY TERMINAL OUTPUT

abis-MacBook-Pro:~ abi$ /Users/abi/root/tutorials/hsimple.C 
-bash: /Users/abi/root/tutorials/hsimple.C: Permission denied

abis-MacBook-Pro:~ abi$ cd root/bin
abis-MacBook-Pro:bin abi$ ./root.exe

   ------------------------------------------------------------
  | Welcome to ROOT 6.10/00                http://root.cern.ch |
  |                               (c) 1995-2017, The ROOT Team |
  | Built for macosx64                                         |
  | From tag v6-10-00, 13 June 2017                            |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

//hsimple.C is in the ROOT tutorials directory
root [0] .x hsimple.C
Error in <TApplication::ExecuteFile>: macro hsimple.C not found in path .:/Users/abi/root/macros
root [1]

I don’t understand what your issue is. How would you like to run the macros? Using the terminal is the usual way.

You will find all the tutorial in $ROOTSYS/tutorials.
cd ro this directory (or copy the tutorials from there) and the you will be able to execute them as at the ROOT prompt. As @amadio said this is the only way to run ROOT macros.

Question updated for clarification. pls take a look at it…

Hi,
that error is normal. hsimple.C is, in fact, not in ‘/Users/abi/root/macros’.

Open your terminal, setup ROOT’s environment (if you don’t do it automatically in your .bashrc script) with source /Users/abi/root/bin/thisroot.sh, then do a cd /Users/abi/root/tutorials, and from the root prompt you can now type .x hsimple.C because hsimple.C is now in your current directory.

Tried your suggestion, but I got a permission denied.

At which point? I just suggested to cd into the tutorials directory and the execute root from there.
If that does not work you might have some issues with your ROOT installation.

okay thanks… the problem is with the installation which i am yet to figure out.

i keep getting the “permission denied” prompt in the terminal.

You are really not giving us much information here :slight_smile:
How did you install ROOT? Which command gives you a permission denied error exactly?

If your aim is simply running hsimple.C from the ROOT prompt, you can do
source /path/to/root/bin/thisroot.sh (where I think your /path/to/root is /Users/abi/root) and then start root (just type root and press enter). From ROOT’s prompt you can execute any tutorial if you know its location. I think in your case it should be
root[0] .x /Users/abi/root/tutorials/hsimple.C
but you probably know your system better than me :smiley:

I have tried to modify the info you gave in your 1st post. Several things were wrong. It should be something like:

$ cd ~/root
$ . bin/thisroot.sh
$ cd tutorials
$ root

   ------------------------------------------------------------
  | Welcome to ROOT 6.10/00                http://root.cern.ch |
  |                               (c) 1995-2017, The ROOT Team |
  | Built for macosx64                                         |
  | From tag v6-10-00, 13 June 2017                            |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

root [0] .x hsimple.C
root [1]

Note that the 2nd line should be put in your .bashrc file to avoid re-typeing this commend each time you start a new terminal.

The message permission denied you get is because your tried to execute hsimple.C at the shell prompt … it is a ROOT macro … it should be executed in ROOT…

I assume ROOT binaries are installed in your directory ~/root … it seems it is, given the terminal output you posted.

1 Like

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