Building ROOT from source on RedHat Linux 6.0

Matthew D. Langston (langston@SLAC.stanford.edu)
Fri, 09 Jul 1999 10:21:36 -0700


I have had several private e-mails sent to me asking how to build ROOT
from source on RedHat Linux 6.0 Intel. As I have not had time to update
my Autoconf patch for the newer versions of ROOT, and as there are a few
minor "gotchas" which aren't documented in ROOT's AA_INSTALL file, I
thought I would list the commands I use to build ROOT on my RedHat Linux
6.0 Intel system in a "cut-and-paste" fashion.

Here are the instructions I follow whenever I want to build a new
version of ROOT on RedHat Linux 6.0 Intel:

1) Download and install Mesa for optional OpenGL support (see below).

2) Install the latest ROOT. The following example is for ROOT 2.22.08,
which is the latest version of ROOT as I write this. I tested these
commands by literally executing them in order (after having stripped
off the leading dollar sign, of course). Hopefully, they will work
for you as well.

$ cd ~
$ wget -N ftp://root.cern.ch/root/root_v2.22.Linux.2.2.3.egcs111.tar.gz
$ wget -N ftp://root.cern.ch/root/root_v2.22.source.tar.gz
$ wget -N ftp://root.cern.ch/root/ttf/ttf_1.1.tar.gz
$ export ROOTSYS=/usr/local/root
$ export CERNLIB=/usr/local/lib
$ mkdir -p $ROOTSYS
$ cd $ROOTSYS/..
$ gunzip -c ~/root_v2.22.Linux.2.2.3.egcs111.tar.gz | tar -xpvf -
$ cd root
$ gunzip -c ~/root_v2.22.source.tar.gz | tar -xpvf -
$ gunzip -c ttf_1.1.tar.gz | tar -xpvf -
$ rm -rf include
$ (cd bin && rm g2root h2root makedepend rmkdepend)
$ rm -f lib/*
$ ln -s /usr opengl
$ ln -s src include
$ cd src
$ perl -i.orig -p -e 's{/[^\s]+}{};s{^[^:]+:\s*$}{}' Make-depend
$ patch -b < README.RHL6.0
$ ln -s Makefile.linuxegcs Makefile
$ make distclean
$ make

Notes:

1) You may have to adjust the ROOTSYS and CERNLIB environment
variables appropriately for your system. It is OK to leave CERNLIB
undefined if you don't have it installed, but this means that
"h2root" and "g2root" won't be built on your system.

2) The input file for the patch command "patch -b < README.RHL6.0" is
this file (i.e. the file that you are reading). You may have
called it something else (i.e. if you've saved it to a file from an
e-mail), in which case you should substitute the real file name for
"README.RHL6".

Installing Mesa (for optional OpenGL support)
---------------------------------------------
$ cd ~
$ wget -N ftp://ftp.falsehope.com/pub/Mesa/Mesa-3.0-2.src.rpm
$ rpm --rebuild Mesa-3.0-2.src.rpm
$ rpm -Uvh /usr/src/redhat/RPMS/i386/Mesa*

If you don't have Perl
----------------------
If by some chance you don't have Perl on your system, but you have
"sed", then the Perl command can be replaced with the following two
lines:

$ mv Make-depend Make-depend.orig
$ sed -e 's/\/[^ ][^ ]*//' -e 's/^[^:][^:]*:[ ]$//' Make-depend.orig > Make-depend

--
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
langston@SLAC.Stanford.EDU

--- Makefile.linuxegcs.orig Wed Jul 7 23:20:59 1999 +++ Makefile.linuxegcs Fri Jul 9 00:19:01 1999 @@ -13,12 +13,12 @@ OPT = -O NOOPT = LD = g++ -LDFLAGS = $(OPT) +LDFLAGS = $(OPT) -Wl,-rpath,$(ROOTSYS)/lib SOFLAGS = -shared -Wl,-soname, SOEXT = so SYSLIBS = -lm -ldl -rdynamic SYSXLIBS = -L/usr/X11R6/lib -lX11 -lm -ldl -rdynamic -XLIBS = $(ROOTSYS)/lib/libXpm.a -L/usr/X11R6/lib -lX11 +XLIBS = -L/usr/X11R6/lib -lXpm -lX11 CILIBS = -lm -ltermcap -lbsd -ldl -rdynamic CRYPTLIBS = -lcrypt F77 = g77