Problems installing root with --prefix=$HOME/.local

I am trying to install root 5.34/00 on ubuntu 12.04 into $HOME/.local. I have set $ROOTSYS to $HOME/.local, and $LD_LIBRARY_PATH to include $ROOTSYS/lib. I believe I have followed all instructions here relevant to installing into a ‘–prefix’ location.

This is my build sequence:

~/Documents/work/CERN/root $ echo $ROOTSYS ; echo $LD_LIBRARY_PATH 
~/Documents/work/CERN/root $ ./configure --prefix=${ROOTSYS} --etcdir=${ROOTSYS}/etc --enable-rpath --enable-soversion --enable-explicitlink --enable-python
~/Documents/work/CERN/root $ make all install

And here is what happens when I try to run root:

~/Documents/work/CERN/root $ which root
~/Documents/work/CERN/root $ root
rootx xpm error: XpmOpenFailed
root: can't start ROOT -- check that ${ROOTSYS}/bin/root.exe exists!
~/Documents/work/CERN/root $ ls ${ROOTSYS}/bin/root.exe
~/Documents/work/CERN/root $ root.exe
Error: cannot open file "iostream"  (tmpfile):2:
*** Interpreter error recovered ***
Error: cannot open file "bits/predefs.h"  /usr/include/features.h:325:
*** Interpreter error recovered ***
root [0]

I’ve created the file /etc/ with contents


and run sudo ldconfig without fixing any of the above problems, of which there are 3 or 4:
[]‘rootx xpm error: XpmOpenFailed’ when running root[/]
[][/home/justin/.local/]root can’t find /home/justin/.local/root.exe[/]
[]‘cannot open file “iostream” (tmpfile):2:’ (does it mean /usr/include/c++/4.6/iostream or /home/justin/.local/lib/root/cint/cint/include/iostream)[/]
[]‘cannot open file “bits/predefs.h” /usr/include/features.h:325:’[/]

I am uncertain about how to proceed from this point. Thank you for your help.

root-config --bindir
root-config --libdir
root-config --etcdir
root-config --help
Putting “/home/justin/.local/lib” into “/etc/” is a crime against the Operating System. :mrgreen:
See also:
[url]ROOTSYS and linux distribution installation
[url]Release 5.32.03 on Ubuntu 12.04

I don’t understand why you are referencing root-config. I am still unsure as to if or how I have done anything wrong. Since I have already set $ROOTSYS, I suppose I could rebuild and reinstall root using the ‘Pepe method’, since I am still having trouble using the ‘Fons method’ of installation.

  1. if you configure ROOT using “–prefix” you should not define ROOTSYS in advance -> try something like (there should be no need to modify “” in this case ):

unset ROOTSYS ./configure --prefix=/usr/local --etcdir=/usr/local/etc/root --enable-explicitlink --enable-rpath --enable-soversion --all make sudo make install

  1. see the output of my root-config commands and compare to what you actually set

  2. If you use “my installation method”, see also:
    [url]Updating to new Root versions
    [url]Compiling root from source overheats certain computers
    [url]Release 5.32.03 on Ubuntu 12.04

The clue to the solution was hidden in the original statement of the problem:

root: can't start ROOT -- check that ${ROOTSYS}/bin/root.exe exists!

Root’s configure script does not expand variables and expects concrete paths. I realized while looking through strings $(which root) | less that the root binary ought not need to expand shell variables either in using its own hard-coded paths, yet configure passed them blithely on. I suppose the reasons configure does not expand shell variables are related to the certainty that if you intend to install a package somewhere specific enough to explicitly name a ‘–prefix’ location, then that location is definite enough to be a definite path.