Difference between revisions of "Tips and Tricks"

From LHCb Wiki
Jump to navigation Jump to search
Line 3: Line 3:
 
desktop, here is my recipe:
 
desktop, here is my recipe:
  
1. Install Python-2.3.5 in your home dir(for example) by compiling it with options:<br>  
+
Download python: http://www.python.org/ftp/python/2.3.5/Python-2.3.5.tgz <br>
--enable-shared --prefix=$HOME/python_dir <br>
+
tar xvzf Python-2.3.5.tgz<br>
 +
cd Python-2.3.5<br>
 +
mkdir ../python_dir
 +
<br>
 +
1. Install it in your home dir(for example) by compiling it with options:<br>  
 +
<br>
 +
./configure --enable-shared --prefix=$HOME/python_dir <br>
 +
make <br>
 +
make install <br>
  
 
2. Add in your .tcshrc file the following lines:<br>
 
2. Add in your .tcshrc file the following lines:<br>
Line 17: Line 25:
 
setenv PYTHONPATH ${ROOTSYS}/lib/:${PYTHONPATH} <br>
 
setenv PYTHONPATH ${ROOTSYS}/lib/:${PYTHONPATH} <br>
  
Then, the last thing one should do is: <br>
+
3. Then, the last thing one should do is: <br>
 
cd $HOME/python_dir/lib/python2.3 <br>
 
cd $HOME/python_dir/lib/python2.3 <br>
 
ln -s  $HOME/python_dir/lib/libpython2.3.so.1.0 libpython2.3.so.1.0
 
ln -s  $HOME/python_dir/lib/libpython2.3.so.1.0 libpython2.3.so.1.0
 +
 +
4. Try it:<br>
 +
$HOME/python_dir/bin/python <br>
 +
>>> import ROOT <br>
 +
 +
5. If you don't get any strange warnings or errors, then everything is working ... :) <br>

Revision as of 12:45, 20 June 2006

PyRoot and Roofit

For those who are interested to have PyROOT running on their NIKHEF linux desktop, here is my recipe:

Download python: http://www.python.org/ftp/python/2.3.5/Python-2.3.5.tgz
tar xvzf Python-2.3.5.tgz
cd Python-2.3.5
mkdir ../python_dir
1. Install it in your home dir(for example) by compiling it with options:

./configure --enable-shared --prefix=$HOME/python_dir
make
make install

2. Add in your .tcshrc file the following lines:

setenv ROOTSYS /project/bfys/root/root-5.10.00
setenv PATH ${ROOTSYS}/bin:${PATH}
setenv LD_LIBRARY_PATH

setenv PYTHONDIR $HOME/python_dir/lib/python2.3
setenv PYTHONPATH $HOME/python_dir/lib/python2.3
setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${PYTHONDIR}:${LD_LIBRARY_PATH}
setenv PYTHONPATH ${ROOTSYS}/lib/:${PYTHONPATH}

3. Then, the last thing one should do is:
cd $HOME/python_dir/lib/python2.3
ln -s $HOME/python_dir/lib/libpython2.3.so.1.0 libpython2.3.so.1.0

4. Try it:
$HOME/python_dir/bin/python
>>> import ROOT

5. If you don't get any strange warnings or errors, then everything is working ... :)