LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   problems with editing .tcshrc file (http://www.linuxquestions.org/questions/linux-software-2/problems-with-editing-tcshrc-file-806989/)

kirillpushkin 05-10-2010 12:52 PM

problems with editing .tcshrc file
 
Hi,

I have a problem with setting up 2 programs ROOT and GEANT4 through .tcshrc file. In order to better understand what I mean, I have attached the contents of my .tcshrc below. So, when I open a new Terminal, ROOT would not work, but the Geant4 works. Although everything is set up correctly, I have checked the commands for ROOT later, and in that case it works perfectly fine. When I switch ROOT and Geant4, and put Geant4 commands first, and later ROOT commands then ROOT would work, but the GEANT4 libraries won't. Please let me know what is wrong with my .tcshrc file.

# Running ROOT
setenv ROOTSYS /home/kirillpushkin/Documents/root
setenv PATH ${ROOTSYS}/bin:${PATH}
setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${LD_LIBRARY_PATH}

# Running GEANT4
setenv G4WORKDIR /home/kirillpushkin/geant4
source /home/kirillpushkin/Documents/geant4.9.2.p02/env.csh
setenv LD_LIBRARY_PATH /home/kirillpushkin/Documents/geant4.9.2.p02/lib/Linux-g++
setenv LD_LIBRARY_PATH /home/kirillpushkin/Documents/2.0.4.2/CLHEP/lib/:$LD_LIBRARY_PATH

colucix 05-10-2010 01:04 PM

Hi and welcome to LinuxQuestions!

Maybe the line
Code:

setenv LD_LIBRARY_PATH /home/kirillpushkin/Documents/geant4.9.2.p02/lib/Linux-g++
should be
Code:

setenv LD_LIBRARY_PATH /home/kirillpushkin/Documents/geant4.9.2.p02/lib/Linux-g++:$LD_LIBRARY_PATH
Please, can you post the exact error messages in both cases?

kirillpushkin 05-10-2010 01:28 PM

Hi, thank you very much for your reply, and I am sorry for being unclear. So, there are no error messages. Clearly, when I set in .tcshrc first 3 command lines related to ROOT as it is below they do not get executed, and as result ROOT does not work, whereas 3 last lines related to GEANT4 get executed, the program GEANT works.

# Running ROOT
setenv ROOTSYS /home/kirillpushkin/Documents/root
setenv PATH ${ROOTSYS}/bin:${PATH}
setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${LD_LIBRARY_PATH}

# Running GEANT4
setenv G4WORKDIR /home/kirillpushkin/geant4
source /home/kirillpushkin/Documents/geant4.9.2.p02/env.csh
setenv LD_LIBRARY_PATH /home/kirillpushkin/Documents/geant4.9.2.p02/lib/Linux-g++

when I switch them like that below Geant4 doesn't work, but ROOT works successfully. In other words, it seems that the file ignores now the first 3 lines related to GEANT4, but rather executes the last 3 lines related to ROOT. My goal is to have them both working!

# Running GEANT4
setenv G4WORKDIR /home/kirillpushkin/geant4
source /home/kirillpushkin/Documents/geant4.9.2.p02/env.csh
setenv LD_LIBRARY_PATH /home/kirillpushkin/Documents/geant4.9.2.p02/lib/Linux-g++
setenv LD_LIBRARY_PATH /home/kirillpushkin/Documents/2.0.4.2/CLHEP/lib/:$LD_LIBRARY_PATH

# Running ROOT
setenv ROOTSYS /home/kirillpushkin/Documents/root
setenv PATH ${ROOTSYS}/bin:${PATH}
setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${LD_LIBRARY_PATH}

kirillpushkin 05-11-2010 11:25 PM

Problems with .tcshrc source file
 
Looks like nobody knows an answer on my problem. :(

makyo 05-12-2010 05:42 AM

Hi.

I think what colucix was suggesting is that you are resetting environment variable LD_LIBRARY_PATH in the second set of commands. That effectively removes the first setting. We also don't know what you have in file "...env.csh", which may affect the variable.

Perhaps to see this more clearly, after you login, display the value:
Code:

echo "LD_LIB  : $LD_LIBRARY_PATH"
echo "ROOTSYS  : $ROOTSYS"
echo "G4WORKDIR: $G4WORKDIR"

Best wishes ... cheers, makyo

kirillpushkin 05-12-2010 08:27 PM

Thanks guys. It helped! I appreciate it!


All times are GMT -5. The time now is 12:26 PM.