Install ExRootAnalysis with root problem

Asked by Jianyu Gong on 2017-07-30

Hi!
When I installed ExRootAnalysis, the madgraph5 told me that
"Command "install ExRootAnalysis " interrupted in sub-command:
       "install ExRootAnalysis" with error:
        InvalidCmd : The environment variable ROOTSYS is not configured.
 You can set it by adding the following lines in your .bashrc [.bash_profile for mac]:
 export ROOTSYS=/usr
 export PATH=$PATH:$ROOTSYS/bin
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ROOTSYS/lib
 This will take effect only in a NEW terminal"
And I did as it told me, with ROOTSYS set as my own directory, like this.
        export ROOTSYS=/home/dino/Desktop/root
        export PATH=$PATH:$ROOTSYS/bin
        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
        export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ROOTSYS/lib
        . /home/dino/Desktop/root/bin/thisroot.sh
The last line was added as the "root" says.
However, when I installed ExRootAnalysis again, it had the same problem.
Could you please help me solve the problem. Thanks a lot!

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
2017-07-30
Last reply:
2017-07-30

Hi,

Did you restart a new shell? (Or did you do source ~/.bashrc
In order to have those modification to be working?

Cheers,

Olivier
> On 30 Jul 2017, at 10:12, Jianyu Gong <email address hidden> wrote:
>
> New question #654214 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/654214
>
> Hi!
> When I installed ExRootAnalysis, the madgraph5 told me that
> "Command "install ExRootAnalysis " interrupted in sub-command:
> "install ExRootAnalysis" with error:
> InvalidCmd : The environment variable ROOTSYS is not configured.
> You can set it by adding the following lines in your .bashrc [.bash_profile for mac]:
> export ROOTSYS=/usr
> export PATH=$PATH:$ROOTSYS/bin
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
> export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ROOTSYS/lib
> This will take effect only in a NEW terminal"
> And I did as it told me, with ROOTSYS set as my own directory, like this.
> export ROOTSYS=/home/dino/Desktop/root
> export PATH=$PATH:$ROOTSYS/bin
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
> export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ROOTSYS/lib
> . /home/dino/Desktop/root/bin/thisroot.sh
> The last line was added as the "root" says.
> However, when I installed ExRootAnalysis again, it had the same problem.
> Could you please help me solve the problem. Thanks a lot!
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Jianyu Gong (dinogong) said : #2

Yes, I have restarted the shell, and I also used "source ~/.bashrc".

For some reason, it is not set correctly.
What happen when you do
echo $ROOTSYS

Did you read the content of
. /home/dino/Desktop/root/bin/thisroot.sh

Maybe that script remove such variable.

Cheers,

Olivier

> On 30 Jul 2017, at 11:23, Jianyu Gong <email address hidden> wrote:
>
> Question #654214 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/654214
>
> Status: Answered => Open
>
> Jianyu Gong is still having a problem:
> Yes, I have restarted the shell, and I also used "source ~/.bashrc".
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Jianyu Gong (dinogong) said : #4

When I do echo $ROOTSYS, it shows
/home/dino/Desktop/root;
And in the file thisroot.sh, I have
if [ -n "${ROOTSYS}" ] ; then
   old_rootsys=${ROOTSYS}
fi

SOURCE=${BASH_ARGV[0]}
if [ "x$SOURCE" = "x" ]; then
    SOURCE=${(%):-%N} # for zsh
fi

if [ "x${SOURCE}" = "x" ]; then
    if [ -f bin/thisroot.sh ]; then
        ROOTSYS="$PWD"; export ROOTSYS
    elif [ -f ./thisroot.sh ]; then
        ROOTSYS=$(cd .. > /dev/null; pwd); export ROOTSYS
    else
        echo ERROR: must "cd where/root/is" before calling ". bin/thisroot.sh" for this version of bash!
        ROOTSYS=; export ROOTSYS
        return 1
    fi
else
    # get param to "."
    thisroot=$(dirname ${SOURCE})
    ROOTSYS=$(cd ${thisroot}/.. > /dev/null;pwd); export ROOTSYS
fi
I have no idea about this script...

Hi,

This sounds correct. Then I have no clue what's happening.

You can try to install ExRootAnalysis from Source.
or bypass the crash inside madgraph:

and replace (l1174 of madgraph/interface/madgraph_interface.py)
            if 'ROOTSYS' not in os.environ:
                raise self.InvalidCmd(
'''The environment variable ROOTSYS is not configured.
You can set it by adding the following lines in your .bashrc [.bash_profile for mac]:
export ROOTSYS=%s
export PATH=$PATH:$ROOTSYS/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ROOTSYS/lib
This will take effect only in a NEW terminal
''' % os.path.realpath(pjoin(misc.which('root'), \
                                               os.path.pardir, os.path.pardir)))
by
   os.environ['ROOTSYS'] = '/home/dino/Desktop/root'

Cheers,

Olivier

Can you help with this problem?

Provide an answer of your own, or ask Jianyu Gong for more information if necessary.

To post a message you must log in.