Installing ROOT 5 from Source

The https://root.cern.ch/build-root-old-method does NOT mention “ROOTSYS” at all.
A newcomer has no chance to learn that the following sequence works (the “/Where/I/Unpacked/The/Source/Code/Of/root” subdirectory must be different from the “ROOTSYS=/Where/I/Want/To/Install/root” subdirectory):

cd /Where/I/Unpacked/The/Source/Code/Of/root
export ROOTSYS=/Where/I/Want/To/Install/root
./configure [<arch>] --enable-soversion --all
(g)make
(g)make install # may need "sudo"

The “./configure --help” does NOT mention this feature either.

Note that building ROOT 6 requires the usage of the new CMake based building method.

Hi Pepe,

this is not documented on purpose as I don’t want to advocate this way of installation. The preferred way is documented and does not depend on ROOTSYS being set before running ROOT (actually, only root.exe must be in PATH and that is all). The make install step is only needed when installing with --prefix in a fixed location. Too many ways too install leads to too much confusion.

Cheers, Fons.

I think I must strongly disagree and I’m not the only one - see for example https://root-forum.cern.ch/t/include-libmathcore-so-in-cint/13646

Yes, but this is nothing else than just setting ROOTSYS to where the files have been copied or moved to before running (make install just copies the files to the ROOTSYS location in case --prefix is not used). But as you can see in the Makefile install: target, I took care that the method you describe works fine. It is just that in most cases people don’t need the extra “make install” step.

Btw, the problem with SpecFunMathCore.h still needs to be addressed as it make some wrong assumptions.

Cheers, Fons.

I believe you forgot about “--enable-rpath”.

Yes, did not explicitly mention it, but it is there. The problem with rpath on linux is that is fixes the location where you have to install the binaries. The way we use rpath on MacOS X is more elegant as the rpath is there relative to the executable (to support relocatable app bundles).

Cheers, Fons.

Sorry to resurrect a slightly old thread - I’ve been looking at providing relocatable install of ROOT - but in connection to rpath on Linux, could “$ORIGIN” be used? To quote from the ld.so man page:

I am no expert on this area, so perhaps this wouldn’t work for ROOT or has already been looked, though at first glance it appears to offer similar functionality to OSX’s @NAME constructs.

Cheers,

Ben.

Hi Ben,

that looks indeed like identical functionality as OSX provides. I don’t know if this is something recent or that I did overlook it at the time I implemented it for OSX. Anyway, I’ll put it on my todo list to also provide for Linux builds. Thanks for pointing this out.

Cheers, Fons.

Hi,
I’m new to both Linux and ROOT as well.
I unpacked the tar.
set export ROOTSYS=/Where/I/Want/To/Install/root
then I’m unable to run the below. ./configure no such file or directory
./configure []
(g)make
(g)make install
Can anyone please tell where to run this ./configure, in which location do I need to run this.

you should run it in directory created after unpacking.

The extracted directory name is root. It doesn’t have a folder configure, but it has a folder called config.
This config folder has two files Makefile.comp and Makefile.config.
The tar file I extracted is root_v5.34.09.Linux-slc5-gcc4.3.tar.gz.
My OS is OpenSUSE 12.2

“configure” is not a folder it is a file in the root directory you just created.
Go in that directory and do:

./configure
make

[quote=“Usr12345”]The extracted directory name is root. It doesn’t have a folder configure, but it has a folder called config.
This config folder has two files Makefile.comp and Makefile.config.
The tar file I extracted is root_v5.34.09.Linux-slc5-gcc4.3.tar.gz.
My OS is OpenSUSE 12.2[/quote]
From the name of the archive (root_v5.34.09.Linux-slc5-gcc4.3.tar.gz), it seems that you have downloaded a compiled version. If so, you just have to go in the bin directory et run “root”

Otherwise, if you really want to compile ROOT from the sources, please download the sources and follow the instruction given on this page.

[quote=“pamputt”][quote=“Usr12345”]The extracted directory name is root. It doesn’t have a folder configure, but it has a folder called config.
This config folder has two files Makefile.comp and Makefile.config.
The tar file I extracted is root_v5.34.09.Linux-slc5-gcc4.3.tar.gz.
My OS is OpenSUSE 12.2[/quote]
From the name of the archive (root_v5.34.09.Linux-slc5-gcc4.3.tar.gz), it seems that you have downloaded a compiled version. If so, you just have to go in the bin directory et run “root”

Otherwise, if you really want to compile ROOT from the sources, please download the sources and follow the instruction given on this page.[/quote]

Thank you I downloaded the root_v5.34.18.source.tar.gz and able to install it using the instructions.