Posts Tagged ‘howto’

Articles

PyROOT installation on Ubuntu 10.04

In howto on Jul 13, 2012 by theoryl Tagged: , , , , , , , ,

Last time I installed ROOT, I did not have PyROOT enabled. So I have to recompile. The following assumes Python 2.6 has been installed.

Install ROOT v5.27/06b on Ubuntu 10.04:

# Download ROOT via svn checkout. For simplicity, download to the home area
svn co http://root.cern.ch/svn/root/tags/v5-27-06d ~/root
cd ~/root
svn switch http://root.cern.ch/svn/root/branches/v5-27-06-patches

# Get all the dependencies for Ubuntu
sudo apt-get install build-essential libx11-dev libxpm-dev libxft-dev libxext-dev

# Configure. Enable PyROOT along with many useful features
# (to change the installation directory, add `--prefix=/path/to/installation/directory/`)
./configure linux --enable-python --with-python-incdir=/usr/include/python2.6/ --with-python-libdir=/usr/lib/ --enable-mathcore --enable-mathmore --enable-roofit --enable-minuit2 --enable-gdml --enable-table

# Make
# (to use n number of cores, do `make -j n`)
make

# Install
# (to gain superuser privilege, do `sudo make install`)
make install

To run ROOT, the environment variables need to be set. For bash shell:

export ROOTSYS=$HOME/root
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH

For c-shell:

setenv ROOTSYS $HOME/root
setenv PATH $ROOTSYS/bin:$PATH
setenv LD_LIBRARY_PATH $ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH
setenv PYTHONPATH $ROOTSYS/lib:$PYTHONPATH

Equivalently, they can be set by doing

source $HOME/root/bin/thisroot.sh
#< for c-shell, do `source $HOME/root/bin/thisroot.csh`

To avoid setting the above variables every time, you can put the commands into ~/.bashrc (or ~/.cshrc).

Now try running ROOT:

root

If the ROOT splash screen shows up, quit and try running PyROOT:

python ~/root/tutorials/pyroot/demo.py

Please report any inaccuracy.

Advertisements

Articles

ROOT installation on Ubuntu 10.04

In howto on Apr 16, 2010 by theoryl Tagged: , , , , , , ,

I upgraded Ubuntu from 8.04 to 10.04, so I needed to build ROOT, which is the bread and butter of some scientists (but perhaps not a lot of love). ROOT is now available via subversion (svn), making it much easier to update/patch.

Install ROOT v5.26/00b on Ubuntu 10.04:

  1. Download ROOT via svn checkout. For simplicity, I assume it is downloaded to the home area:
    $ svn co http://root.cern.ch/svn/root/tags/v5-26-00b ~/root
    $ cd ~/root
  2. Get all the dependencies:
    $ sudo apt-get install build-essential libx11-dev libxpm-dev libxft-dev libxext-dev
  3. Configure. Here I enable most of the features to save myself worry about missing libraries in the future:
    $ ./configure linux --enable-mathcore --enable-mathmore --enable-roofit --enable-minuit2 --enable-gdml --enable-table
    (to change the installation directory, add --prefix=/path/to/installation/directory/)
  4. Make
    $ make
    (use make -j n if you have a n-core machine)
  5. Install
    $ make install
    (might need sudo depending on which directory ROOT is installed into)

Read More »

Articles

Ubuntu installation via USB stick+hard disk mix

In howto on Apr 11, 2010 by theoryl Tagged: , , , , , , ,

The easiest way to install Ubuntu on a machine is of course to go grab a CD image from the Ubuntu release page and burn it. If for whatever reason, you can’t burn the CD, be it you have a machine without a CD drive or with a CDROM but not CDRW, or, like this author, you don’t have a writable disc, the alternative is to use a USB stick. There already exist a variety of tools out there to “convert” a USB stick into a boot-able media like a CD, such as usb-creator in Ubuntu and UNetbootin for both Windows & Linux. However, if your USB stick has < 700 MB of memory, or, like this author, it has some faulty memory sector**, fear not — here’s a guide for you!
(** received a bunch of SQUASHFS errors and the help page didn’t help)

This guide assumes that you want to:

  1. dual boot Windows and Ubuntu in the machine, with Windows being already installed. This is the “target” machine. The tested Ubuntu version is Lucid Lynx 10.04 beta 2, but this guide should work for all Ubuntu versions >8.04.

and you have:

  1. a USB stick with a minimum of 15 MB of memory (to be safe, get one with >25 MB);
  2. the BIOS of the target machine does support booting via a USB media. Its Windows partition should be large enough to hold the Ubuntu installation disc image (~700 MB);
  3. another machine that is already running Unix/Linux. Strictly speaking, this is only used to prepare the boot sector in the USB stick. Presumably Windows can do it too, this author just didn’t try;
  4. free time and an adventurous soul.

The articles referenced below helped this author a lot. It is therefore strongly recommended to go through these well-written articles before you attempt this guide:

  1. https://help.ubuntu.com/community/Installation/FromUSBStick
  2. https://help.ubuntu.com/9.10/installation-guide/i386/boot-usb-files.html

Read More »