GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » Why is there a hardcoded $PATH in config.sh?
Why is there a hardcoded $PATH in config.sh? [message #15164] Fri, 09 August 2013 13:56 Go to next message
Andreas Herten is currently offline  Andreas Herten
Messages: 25
Registered: October 2011
Location: Jülich
continuous participant

From: *ikp.kfa-juelich.de
Every time I source the config.sh file from my build directory, my $PATH environment variable is set to the status that it had while compiling.

Is there a particular reason for this?
Why does PandaRoot not extend the $PATH, like every other program does?

For once, I think this is quite illogical. Why should PandaRoot be the program that takes care about what's in this variable?
It's quite a hassle to always remember that everytime you change your $PATH, there's always this one shell script where you have to put the changes in (when you finally have found out that this was the reason it wasn't working before... Rolling Eyes ).
Also it might be a point for PandaRoot beginners and occasional users to stumble over.
Re: Why is there a hardcoded $PATH in config.sh? [message #15167 is a reply to message #15164] Fri, 09 August 2013 15:24 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 2.235.190*
In reality it is just the opposite. Since the beginners could have another ROOT installed in some root folder, then the PATH is reset in order to avoid possible conflicts. If you use pandaroot, then you have to use ONLY pandaroot Razz
At least, this is what I remember.
Re: Why is there a hardcoded $PATH in config.sh? [message #15168 is a reply to message #15167] Fri, 09 August 2013 15:43 Go to previous messageGo to next message
Andreas Herten is currently offline  Andreas Herten
Messages: 25
Registered: October 2011
Location: Jülich
continuous participant

From: *ikp.kfa-juelich.de
Wouldn't the better solution to that problem be to prepend the $PATH variable with PandaRoot's ROOT dir? Like
  export PATH="$SIMPATH/bin:$PATH"


By the way, the line in my config.sh looks like this
export PATH="/home/ikp1/herten/fairsoft/extpkg/bin:/private/cuda-5.0/bin:/home/ikp1/herten/bin:
/usr/lib64/mpi/gcc/openmpi/bin:.:/home/ikp1/herten:/usr/local_64/bin:/usr/local/bin:/usr/bin:/bin:
/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:
/usr/lib/qt3/bin:/home/ikp1/herten/programme/sublime-text-2"

(with no spaces of course)
Re: Why is there a hardcoded $PATH in config.sh? [message #15175 is a reply to message #15168] Fri, 09 August 2013 21:55 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *pools.arcor-ip.net
Hi Andreas,

the reason why we have this strict settings is that we had many problems with wrong environment settings. As Stefano already pointed out people have several different Root or Geant versions.
To find problems with mismatches of libraries took so much time that we decide to have a very strict config file.

You are one of very few users which complain about this issue, so I think for most of the users this strict settings are okay. If you don't like this strict settings the best way is to change the config.sh file and add $PATH at the end of the of the "export PATH=" line. The disadvantage is that in case you switch between several versions of pandaroot, your PATH variable will become longer and longer.


Ciao

Florian
Re: Why is there a hardcoded $PATH in config.sh? [message #15180 is a reply to message #15175] Mon, 12 August 2013 10:01 Go to previous messageGo to next message
Andreas Herten is currently offline  Andreas Herten
Messages: 25
Registered: October 2011
Location: Jülich
continuous participant

From: *ikp.kfa-juelich.de
Hey Florian,

Ok, debugging experience is a very good reason for doing it this way. I accept Wink. And will think about modifying my own config.sh.


Just for curiosity, another question:
Wouldn't the way I suggested defining $PATH in the previous answer also solve any wrongly set variable? Prepending the PandaRoot-specific paths like
export PATH="$SIMPATH/bin:OTHERPATHS/:$PATH"

For ROOT / GEANT executables would then be searched first in the PandaRoot directories.

(PandaRoot version switching and $PATH lengthening would be a problem. That's true. There would be a script needed to strip the old PandaRoot/bin directory out of $PATH before adding it again (maybe based on the previous $SIMPATH value)...)

See you,
-Andreas
Re: Why is there a hardcoded $PATH in config.sh? [message #15194 is a reply to message #15180] Tue, 13 August 2013 13:57 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Andreas,

there is a option USE_PATH_INFO which you can use when running cmake. If the option is true $PATH is added in the config file.
The default setting is to add the explicit lst of directories.

To use this option pass it on the command line

cmake <source_dir> -DUSE_PATH_INFO=TRUE


Hope this solves your poblem.

Ciao

Florian
Re: Why is there a hardcoded $PATH in config.sh? [message #15196 is a reply to message #15194] Tue, 13 August 2013 14:59 Go to previous message
Andreas Herten is currently offline  Andreas Herten
Messages: 25
Registered: October 2011
Location: Jülich
continuous participant

From: *ikp.kfa-juelich.de
Thanks Florian! It works Smile.

(Btw, interesting svn commit message (your string "$PATH" got extended to the content of your $PATH variable) Wink.)
Previous Topic: pbarpSystem
Next Topic: Subversion HOWTO
Goto Forum:
  


Current Time: Mon Nov 18 20:13:39 CET 2024

Total time taken to generate the page: 0.00712 seconds