Installing ROOT from Source


Getting the source

To install ROOT from source you first have to get the tar file containing the source. This tar file can be found in the usual ROOT download area. The files are named root-<version>.source.tar.gz.

Here's a short summary:

  1. Get access to the FTP area (substitute any FTP client and appropriate email address below):
         prompt% ftp root.cern.ch
         User: anonymous
         Password: <your-email-address>
    
  2. Go to the directory, and prepare for binary transfer of files:
         ftp> cd /root
         ftp> bin
    
  3. Get the sources tar-ball (substitute the appropriate version number), and exit FTP client:
         ftp> get root-<version>.source.tar.gz
         ftp> bye
    
  4. Unpack the distribution:
         prompt% gzip -dc root-<version>.source.tar.gz | tar -xf -
    
An alternative approach is to use our public CVS repository to get the latest version. See URL: http://root.cern.ch/root/CVS.html.

Here's a short summary:

  1. Login to server, using anonymous read-only access:
         prompt% cvs -d :pserver:cvs@root.cern.ch:/user/cvs login
         Password: cvs
    
  2. Get a specific version (>= 2.25/00), e.g.: version 2.25/03:
         prompt% cvs -d :pserver:cvs@root.cern.ch:/user/cvs export \
                    -r v2-25-03 root
    
  3. Alternatively, checkout the head (development version) of the sources:
         prompt% cvs -d :pserver:cvs@root.cern.ch:/user/cvs co root
    
In both cases you should have a subdirectory called "root" in the directory you ran the above commands in.

Getting ready to build

You may want to compile features into ROOT, which depends on third party libraries. Make sure you meet all demands for additional features before trying to enable them (see below).

If you are using some Un*x, you need to have libXpm installed. On very few systems libXpm.a is not available. In that case get the pre-built version from:

   ftp://root.cern.ch/root/xpm
Then use either environment variable XPM or "configure" flags "--with-xpm=<dir>" to specify where you installed libXpm, if you didn't install it in some generally searched directory (see more below).

If you are using Windows make sure you've installed Cygwin

   http://sources.redhat.com/cygwin/
and that it is setup correctly, see:
   http://root.cern.ch/root/Cygwin.html
Before proceeding read the complete document.

Choosing the installation method

There are two main methods of installing ROOT from source.
  1. You want to install in a generic directory, depending on environment variables ROOTSYS, LD_LIBRARY_PATH, and PATH.
    1. get the sources of the latest ROOT (see above)
    2. set ROOTSYS to the `root' directory:
            sh family:
              export ROOTSYS=/root
            csh family
              setenv ROOTSYS /root
      
    3. now type the build commands:
            all shells:
              ./configure --help
              ./configure <arch>        [change arch appropriately]
              gmake                     [or, make -j2 for dual CPU machines]
              gmake install             [when run directory is not $ROOTSYS]
      
    4. add $ROOTSYS/bin to PATH and $ROOTSYS/lib to LD_LIBRARY_PATH:
            sh family:
              export PATH=$ROOTSYS/bin:$PATH
              export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
            csh family:
              setenv PATH ${ROOTSYS}/bin:${PATH}
              setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${LD_LIBRARY_PATH}
              rehash
      
    5. try running root:
            all shells:
              root
      
  2. You want to install ROOT in a fixed location, not depending on ROOTSYS. Typically you want to do this when installing in a location like `/usr/local/bin' or even `/usr/bin'. This allows you, and all others on your system, to run ROOT without having to setup ROOTSYS and special PATH and LD_LIBRARY_PATH variables.

    This scheme also makes it easier to make ROOT distributions/installations that fit with an existing system. E.g., it should be trivial to install ROOT via a RedHat (.rpm) or Debian GNU/Linux (.deb) package.

    It's strongly recommended to enable version numbers in sonames (if possible) using this method (see --enable-soversion below). Also, using the --enable-rpath option to "configure" you can set the load path to the ROOT libraries on the applications. However, this is not recommended if you have soome other way (like /etc/ld.so.conf) of making the dynamic loader aware of where you installed the ROOT libraries.

    1. get the sources of latest ROOT (see above)
    2. now type the build commands:
            all shells:
              ./configure --help
              ./configure <arch> --prefix=/usr/local [change arch appropriately]
              gmake                   [or, make -j2, for dual CPU machines]
              gmake install           [su to root if --prefix points to a system dir]
      
    3. try running root:
            sh family:
              root
            csh family:
              rehash
              root
      

Installation Location

By default, the system will be installed depending on the ROOTSYS environment variable. In that case the whole package will live under the directory ROOTSYS points to.

Using the fixed location mode (option 2 above), the default `--prefix' path is `/usr/local', which will result in the ROOT files to be installed in `/usr/local/bin', `/usr/local/lib', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. For more detailed location specifications see `configure --help'.

Here's the complete list:

Makefile targets

The Makefile system and supported make targets are explained in the BUILDSYSTEM file.

Installing optional add-on libraries

If you want to compile the ROOT optional add-on libraries to handle True Type fonts, OpenGL graphics, SRP authentication, MySQL access, RFIO access and event generator interfaces (Pythia, Pythia6 and Venus) you can either specify the options as environment variables. For example:
  # Used during build of ROOT can be overridden in ./configure
  export ROOTBUILD=debug      # see $ROOTSYS/README/BUILDSYSTEM
  export CERNLIB=~/cernlib    # must contain libpacklib.a libkernlib.a
  export RFIO=~/shift/lib     # CERN's SHIFT library, must
                              # contain libshift.a
  export TTF=~/ttf            # must contain fonts/ (and possibly
                              # include/ lib/)
  export OPENGL=~/Mesa        # must contain include/ lib/
  export SRP=~/src/srp        # must contain include/ lib/
  #export AFS=                # must contain include/ lib/
  #export XPM=                # must contain libXpm
  #export MYSQL=              # must contain include/ lib/
  #export PYTHIA=             # must contain libPythia
  #export PYTHIA6=            # must contain libPythia6
  #export VENUS=              # must contain libVenus
  #export STAR=yes            # to build the STAR contrib library
The ROOTBUILD environment variable is special and architecture dependent. To get an idea of which values it can take, take a look in the config/Makefile.<architecture> corresponding to your architecture.

Using "configure" flags

You can also specify additional features and external linking using command line options - or flags - to the configure script.

A special flag is "--build=<option list>" which correspond to the ROOTBUILD environment variable, as described above.

The flags consist of two classes:

  1. --enable-<feature>/--disable-<feature> flags:
    These flags enables/disables support for the corresponding feature <feature>. Specifying such a flag will make the configure script look for third-party libraries, headers, etc. at default locations.

    If you find that the default locations does not work with some standard path e.g., on OS <Foo>, library lib<Bar>, is in general installed in path <Baz>, but "configure" doesn't look there, please file a bug report with rootbugs@root.cern.ch.

    If, for some reason, you have installed some third-party library outside it's usual location, you can make "configure" look for it using the corresponding "--with-<feature dir>" option (see below).

    By default, all features are enabled, except for a few cases (noted below).

    Here's a list of supported features:

  2. "--with-<feature dir>=<dir>" flags:
    If "configure" isn't able to find some third-party library, header, or other file, corresponding to one of the above features, you can force it to look for these files in specific directories, using the "--with-" options.

    Using a "--with-<feature dir>=<dir>" will make "configure" look for whatever needed by <feature> in <dir>, and will also enable the corresponding feature. Hence, you do not need to specify "--enable-<feature>" if you give an "--with-<featuredir>=<dir>". The inverse - of course - isn't true.

    Here is a list of "--with-" flags:

Information on third party software

The optional add-ons are not necessary for the proper functioning of ROOT but we advice you to at least get the True Type fonts since they hugely increase the appearance of text on the screen.

Posix Thread usage

To build the library providing thread support you need to have the library libpthread.{a,so} and header files installed. This is usually the case for any Un*x OS. For architecture "linuxegcs" thread support will always be build.

True Type Font library and fonts

On how to get the True Type ttf directory see:
   http://root.cern.ch/root/TrueType.html
For prebuilt versions see:
   ftp://root.cern.ch/root/ttf/
Most Linux distributions have a freetype package with the needed library and headers, but seldomly do they provide the fonts. You can get a minimal set of fonts from:
   ftp://root.cern.ch/root/ttf/ttf_fonts.tar.gz

OpenGL library

On how to get an open source version of OpenGL see:
   http://www.mesa3d.org
For prebuilt versions see:
   ftp://root.cern.ch/root/opengl/
Most Linux distributions come with a Mesa package, providing the needed headers and libraries. Also, the OpenGL libraries are already in XFree86 version 4 or above.

SHIFT managed tape I/O

To build the library providing CERN RFIO (remote I/O) support you need to get the "libshift.a" library from CERN. You can get pre-build libraries from
  http://root.cern.ch/root/shift
or you can download the full source from
  http://wwwinfo.cern.ch/pdp/serv/shift.html
Please note the the source code isn't GNU library compliant, so you may need the following patch to compile on a GNU based system (e.g. Linux).
    http://cholm.home.cern.ch/cholm
Apply it with
    prompt% patch -p 1 -d shift < shift_1.10-1.10_cholm.patch

ZEBRA file conversion tools

To build the HBOOK and Geant3 conversion programs `h2root' and `g2root' you need the CERNLIB components "libpacklib.{a,so}" and "libkernlib.{a,so}" from CERN. You can get it from
  ftp://asisftp.cern.ch/cernlib

MySQL client

To build the MySQL interface library you need to install MySQL first. See:
   http://www.mysql.com/

Pythia Event Generators

To build the event generator interfaces for Pythia and Pythia6, you first have to get the pythia libraries. You can get pre-build libraries from:
   ftp://root.cern.ch/root/pythia/
or you can download the source from the same directory. The original sources can be found via Lunds FTP server.

More information is avaliable from:

   http://www.thep.lu.se/~torbjorn/Pythia.html

Venus Event Generators

No information at this time.

Secure Remote Password (SRP) Authentication

To build the strong authentication module used by rootd and proofd, you first have to install the SRP (Secure Remote Password) system. See:
   http://srp.stanford.edu/
Please note, that the library "libsrp-dev" as distributed by Standford is not enough.

AFS Authentication

To build rootd and proofd with support for AFS authentication, you first have to install AFS client libraries system. There are a few AFS distributions avaliable.


Rene Brun, Fons Rademakers
Last update 11/12/2000 by FR