Home | News | Documentation | Download

Different INSTALL-directory structure for different installation methods

ROOT Version: V6.23/01 (v6-23-01-414-gb3ecdf6832) [Also 6.20/04]
Platform: 64 bit Fedora 32 (linuxx8664gcc)
Compiler: gcc version 10.1.1 20200507


I have observed strange behaviour when I try to install ROOT (6.23/01 and 6.20/04) using following two methods.

Method 1:
cmake ../root_b3ecdf6 -DCMAKE_INSTALL_PREFIX=/opt/root -Dgnuinstall=ON -Droofit=ON -Drpath=ON -Dsoversion=ON -Dpython2=ON -DPYTHON_EXECUTABLE=/usr/bin/python2 -Dcling=ON
followed by
cmake --build . -- -j8
results in the following directory structure in /op/root:
bin etc include lib share

Method 2
cmake ../root_b3ecdf6 -DCMAKE_INSTALL_PREFIX=/opt/root
followed by
cmake --build . -- -j8

I get the following directory structure under /opt/root

bin cmake config emacs etc fonts geom icons include js lib LICENSE macros man README tutorials

Please let me know whether this is normal or is there any issue.

Well, “gnuinstall” would only be needed if you installed it into some system directories (e.g. “/usr”).
I would stay away from it, if I were you (I prefer the “old fashioned” structure and then many additional tools, which use ROOT, may choke on it when it is “gnuinstall-ed”).

BTW. I think you should be prepared to keep several different ROOT versions under “/opt/root” so you’d better try something like “-DCMAKE_INSTALL_PREFIX=/opt/root/6.20.04” (and / or “/opt/root/6.23.01”).

1 Like

Thank you Wile!

Now I have both, development and pro, versions installed following your suggestion in the post Sourcing root for all users. I have the following lines in my .bashrc file, and switch between the versions as required.

alias root_6.23.01_b3ecdf6='source /opt/root/dev/bin/thisroot.sh'
alias root-dev="root_6.23.01_b3ecdf6"

alias root_6.20.04='source /opt/root/pro/bin/thisroot.sh'
alias root-pro="root_6.20.04"

Both working fine when compiled with:

cmake ../root-6.20.04(OR root_6.23.01_b3ecdf6) -DCMAKE_INSTALL_PREFIX=/opt/root/pro(OR dev) -Dcling=ON -Droofit=ON -Drpath=ON -Dsoversion=ON -Druntime_cxxmodules=OFF -Dpython2=ON -DPYTHON_EXECUTABLE=/usr/bin/python2

However, adding "-Dfortran=ON", the compilation fails for both the versions.

I also had to set "-Druntime_cxxmodules=OFF" as suggested by @eguiraud. Please see: Error Compiling ROOT 6.20/04.

Finally, I would like to point out that the issues of missing (or rather misplaced) libraries as mentioned in the IMPORTANT NOTE in Python3 and ROOT 6.23/01 and Different INSTALL-directory structure for different installation methods arise when -Dgnuinstall is set ON.

sudo apt-get install gfortran

It seems to me that the way you installed it, you’d better use:

alias root-dev='source /opt/root/dev/bin/thisroot.sh'
alias root_6.23.01_b3ecdf6="root-dev"

alias root-pro='source /opt/root/pro/bin/thisroot.sh'
alias root_6.20.04="root-pro"

I already have gcc-gfortran-10.1.1-1.fc32.x86_64 installed. The problem while compiling is: f771: error: unrecognized command line option "-std=legacy"

@Axel So, it’s another (new) problem related to gcc 10 (I guess you could report it somewhere).

Yes, unfortunately!

What is the difference between the alias you are suggesting and the one I have set?

In your case, “pro” / “dev” always points to “pro” / “dev” (so actually, you do not need these additional “version specific” aliases at all).
If you install some new “pro” / “dev” version (different from the current ones), it will overwrite the current one but the aliases will automatically be fully valid (i.e. they will not contain any “version specific” strings).

Note that I always install ROOT in “version specific” prefixes. Afterwards, I decide (with an alias) which one I want to consider my “pro” / “dev”.

Okay! Thanks. Will make those changes immediately.

I do not plan to keep more then two (“pro” and “dev”) versions at a time on my laptop, workstations etc.

In a long run, you may need to have more different versions of ROOT - just because something that works with a particular ROOT version is not working with another ones, or because some piece of your additional, experiment / analysis specific, software explicitly requires a particular ROOT version.

Yeah! I have already read that post.

@Axel Can you please ask the right person to update the "default value for the build options" mentioned on the Building ROOT page?

In my recent, ROOT 6.20/04 installation I had to set -Dvdt=ON and also observed that -Dbuiltin_glew is NOT ON by default.

It is frustrating to see root build failing due to such problems. Imagine, a novice root user trying to install root. Such a built behaviour will put him off from using ROOT.

@Axel @oshadura @etejedor

I am trying to install MultiPython support as outlined in Experimental PyROOT. I am able to succeed with:

cmake -DCMAKE_INSTALL_PREFIX=/opt/root/pro -Dcling=ON -Droofit=ON -Drpath=ON -Dsoversion=ON -Druntime_cxxmodules=OFF -Dexperimental_pyroot=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -Dvdt=ON ../root-6.20.04
cmake --build . -- -j8
cmake -DCMAKE_INSTALL_PREFIX=/opt/root/pro -Dcling=ON -Droofit=ON -Drpath=ON -Dsoversion=ON -Druntime_cxxmodules=OFF -Dexperimental_pyroot=ON -DPYTHON_EXECUTABLE=/usr/bin/python2 -Dvdt=ON ../root-6.20.04
cmake --build . -- -j8

make install

But, I am not bale to execute the next command:

ROOT_PYTHON_VERSION=3.8.3 source /opt/root/pro/bin/thisroot.sh
and
ROOT_PYTHON_VERSION=2.7.18 source /opt/root/pro/bin/thisroot.sh

These says - ERROR: build with Python version 3.8.3 (2.7.18) not found.

Am I doing anything wrong?

I have ROOT 6.23/01 from git. But if I want to test, from where and how can I download ROOT 6.22 using git?

Hi,

These are more updated instructions (if you are using ROOT master, it should work for you):

You don’t actually need the ROOT_PYTHON_VERSION setting, and when you build you should be able to build for both Python versions at the same time, instead of doing it in two steps. Please note that your CMake version needs to be >= 3.14.

I would try to run CMake and see what messages it prints for Python: it should tell you it found both Python2 and Python3. If that is not the case, let me know and we figure it out.

Okay. I just installed ROOT 6.22/00 (which I downloaded from https://github.com/root-project/root/tree/v6-22-00). Here is what I get on 64 bit Fedora 29 running cmake version 3.14.5; gcc version 8.3.1; Python 2.7.17; Python 3.7.5:

FIRST: With "python3 demo.py" gives the following error:

enter "q" to quit: Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'execfile' is not defined

enter "q" to quit: q

SECOND: With "python2 demo.py" , I get the following error:

enter "q" to quit: input_line_58:1:64: error: redefinition of 'is_equal'
namespace __cppyy_internal { template<class C1, class C2> bool is_equal(const C1& c1, const C2& c2) { return (bool)(c1 == c2); } }
                                                               ^
input_line_9:1:64: note: previous definition is here
namespace __cppyy_internal { template<class C1, class C2> bool is_equal(const C1& c1, const C2& c2) { return (bool)(c1 == c2); } }
                                                               ^
input_line_59:1:64: error: redefinition of 'is_not_equal'
namespace __cppyy_internal { template<class C1, class C2> bool is_not_equal(const C1& c1, const C2& c2) { return (bool)(c1 != c2); } }
                                                               ^
input_line_10:1:64: note: previous definition is here
namespace __cppyy_internal { template<class C1, class C2> bool is_not_equal(const C1& c1, const C2& c2) { return (bool)(c1 != c2); } }
                                                               ^
 *** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================

Thread 2 (Thread 0x7f51f1728700 (LWP 31810)):
#0  0x00007f520a0fe472 in waitpid () from /lib64/libc.so.6
#1  0x00007f520a07983f in do_system () from /lib64/libc.so.6
#2  0x00007f51fcc00ff3 in TUnixSystem::StackTrace() () from /home/ajay/Downloads/root_6.22/lib/libCore.so
#3  0x00007f51f00a7c5d in (anonymous namespace)::TExceptionHandlerImp::HandleException(int) () from /home/ajay/Downloads/root_6.22/lib/libcppyy_backend3_7.so
#4  0x00007f51fcc030fd in TUnixSystem::DispatchSignals(ESignals) () from /home/ajay/Downloads/root_6.22/lib/libCore.so
#5  <signal handler called>
#6  0x00007f520a49019c in PyUnicodeUCS4_Compare () from /lib64/libpython2.7.so.1.0
#7  0x00007f520a490001 in PyUnicodeUCS4_RichCompare () from /lib64/libpython2.7.so.1.0
#8  0x00007f520a46f773 in try_rich_compare () from /lib64/libpython2.7.so.1.0
#9  0x00007f520a46ebe6 in PyObject_RichCompare () from /lib64/libpython2.7.so.1.0
#10 0x00007f520a46ea43 in PyObject_RichCompareBool () from /lib64/libpython2.7.so.1.0
#11 0x00007f520a4599bd in list_contains () from /lib64/libpython2.7.so.1.0
#12 0x00007f51f01b5417 in TPyClassGenerator::GetClass(char const*, bool, bool) () from /home/ajay/Downloads/root_6.22/lib/libROOTTPython.so
#13 0x00007f51fcba3887 in TClass::LoadClassCustom(char const*, bool) () from /home/ajay/Downloads/root_6.22/lib/libCore.so
#14 0x00007f51fcbad227 in TClass::GetClass(char const*, bool, bool) () from /home/ajay/Downloads/root_6.22/lib/libCore.so
#15 0x00007f51fcbadecc in TClass::InheritsFrom(char const*) const () from /home/ajay/Downloads/root_6.22/lib/libCore.so
#16 0x00007f51eb77ab48 in TASImage::InitVisual() () from /home/ajay/Downloads/root_6.22/lib/libASImage.so
#17 0x00007f51eb78078e in TASImage::ReadImage(char const*, TImage::EImageFileTypes) () from /home/ajay/Downloads/root_6.22/lib/libASImage.so
#18 0x00007f51f0d47000 in TImage::Open(char const*, TImage::EImageFileTypes) () from /home/ajay/Downloads/root_6.22/lib/libGraf.so
#19 0x00007f51ebe31784 in TGPicturePool::GetPicture(char const*) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#20 0x00007f51ebe384d2 in TGHScrollBar::TGHScrollBar(TGWindow const*, unsigned int, unsigned int, unsigned int, unsigned long) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#21 0x00007f51ebd89ad9 in TGCanvas::TGCanvas(TGWindow const*, unsigned int, unsigned int, unsigned int, unsigned long) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#22 0x00007f51ebeac7d2 in TRootCanvas::CreateCanvas(char const*) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#23 0x00007f51ebead53c in TRootCanvas::TRootCanvas(TCanvas*, char const*, int, int, unsigned int, unsigned int) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#24 0x00007f51ebeb9d2e in TRootGuiFactory::CreateCanvasImp(TCanvas*, char const*, int, int, unsigned int, unsigned int) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#25 0x00007f51f0e5f3f7 in TCanvas::Constructor(char const*, char const*, int, int, int, int) () from /home/ajay/Downloads/root_6.22/lib/libGpad.so
#26 0x00007f51f0e6151f in TCanvas::TCanvas(char const*, char const*, int, int, int, int) () from /home/ajay/Downloads/root_6.22/lib/libGpad.so
#27 0x00007f51fc92509c in ?? ()
#28 0x00007f51000001f4 in ?? ()
#29 0x000000000000024b in ?? ()
#30 0x000000000000024b in ?? ()
#31 0x00007f51ec0890e0 in ?? ()
#32 0x00007f51f0e61430 in ?? () from /home/ajay/Downloads/root_6.22/lib/libGpad.so
#33 0x00007f51ec0890e0 in ?? ()
#34 0x00007f51ec0011a0 in ?? ()
#35 0x58e3147e98638600 in ?? ()
#36 0x00007f51f1725908 in ?? ()
#37 0x00007f51f1725880 in ?? ()
#38 0x0000000600000006 in ?? ()
#39 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f520a033580 (LWP 31780)):
#0  0x00007f520a122f94 in read () from /lib64/libc.so.6
#1  0x00007f520a0b2c98 in __GI__IO_file_underflow () from /lib64/libc.so.6
#2  0x00007f520a0b3dd6 in _IO_default_uflow () from /lib64/libc.so.6
#3  0x00007f520a0a722a in _IO_getline_info () from /lib64/libc.so.6
#4  0x00007f520a0a623f in fgets () from /lib64/libc.so.6
#5  0x00007f520a3ed4bc in my_fgets () from /lib64/libpython2.7.so.1.0
#6  0x00007f520a3ed375 in PyOS_StdioReadline () from /lib64/libpython2.7.so.1.0
#7  0x00007f520a3ed2e2 in PyOS_Readline () from /lib64/libpython2.7.so.1.0
#8  0x00007f520a41d16b in builtin_raw_input.cold () from /lib64/libpython2.7.so.1.0
#9  0x00007f520a516915 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#10 0x00007f520a517162 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#11 0x00007f520a5173fd in PyEval_EvalCode () from /lib64/libpython2.7.so.1.0
#12 0x00007f520a51d4bf in run_mod () from /lib64/libpython2.7.so.1.0
#13 0x00007f520a51d464 in PyRun_FileExFlags () from /lib64/libpython2.7.so.1.0
#14 0x00007f520a51d27c in PyRun_SimpleFileExFlags () from /lib64/libpython2.7.so.1.0
#15 0x00007f520a522f08 in Py_Main () from /lib64/libpython2.7.so.1.0
#16 0x00007f520a058413 in __libc_start_main () from /lib64/libc.so.6
#17 0x0000561fd85110ae in _start ()
===========================================================
The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6  0x00007f520a49019c in PyUnicodeUCS4_Compare () from /lib64/libpython2.7.so.1.0
#7  0x00007f520a490001 in PyUnicodeUCS4_RichCompare () from /lib64/libpython2.7.so.1.0
#8  0x00007f520a46f773 in try_rich_compare () from /lib64/libpython2.7.so.1.0
#9  0x00007f520a46ebe6 in PyObject_RichCompare () from /lib64/libpython2.7.so.1.0
#10 0x00007f520a46ea43 in PyObject_RichCompareBool () from /lib64/libpython2.7.so.1.0
#11 0x00007f520a4599bd in list_contains () from /lib64/libpython2.7.so.1.0
#12 0x00007f51f01b5417 in TPyClassGenerator::GetClass(char const*, bool, bool) () from /home/ajay/Downloads/root_6.22/lib/libROOTTPython.so
#13 0x00007f51fcba3887 in TClass::LoadClassCustom(char const*, bool) () from /home/ajay/Downloads/root_6.22/lib/libCore.so
#14 0x00007f51fcbad227 in TClass::GetClass(char const*, bool, bool) () from /home/ajay/Downloads/root_6.22/lib/libCore.so
#15 0x00007f51fcbadecc in TClass::InheritsFrom(char const*) const () from /home/ajay/Downloads/root_6.22/lib/libCore.so
#16 0x00007f51eb77ab48 in TASImage::InitVisual() () from /home/ajay/Downloads/root_6.22/lib/libASImage.so
#17 0x00007f51eb78078e in TASImage::ReadImage(char const*, TImage::EImageFileTypes) () from /home/ajay/Downloads/root_6.22/lib/libASImage.so
#18 0x00007f51f0d47000 in TImage::Open(char const*, TImage::EImageFileTypes) () from /home/ajay/Downloads/root_6.22/lib/libGraf.so
#19 0x00007f51ebe31784 in TGPicturePool::GetPicture(char const*) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#20 0x00007f51ebe384d2 in TGHScrollBar::TGHScrollBar(TGWindow const*, unsigned int, unsigned int, unsigned int, unsigned long) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#21 0x00007f51ebd89ad9 in TGCanvas::TGCanvas(TGWindow const*, unsigned int, unsigned int, unsigned int, unsigned long) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#22 0x00007f51ebeac7d2 in TRootCanvas::CreateCanvas(char const*) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#23 0x00007f51ebead53c in TRootCanvas::TRootCanvas(TCanvas*, char const*, int, int, unsigned int, unsigned int) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#24 0x00007f51ebeb9d2e in TRootGuiFactory::CreateCanvasImp(TCanvas*, char const*, int, int, unsigned int, unsigned int) () from /home/ajay/Downloads/root_6.22/lib/libGui.so
#25 0x00007f51f0e5f3f7 in TCanvas::Constructor(char const*, char const*, int, int, int, int) () from /home/ajay/Downloads/root_6.22/lib/libGpad.so
#26 0x00007f51f0e6151f in TCanvas::TCanvas(char const*, char const*, int, int, int, int) () from /home/ajay/Downloads/root_6.22/lib/libGpad.so
#27 0x00007f51fc92509c in ?? ()
#28 0x00007f51000001f4 in ?? ()
#29 0x000000000000024b in ?? ()
#30 0x000000000000024b in ?? ()
#31 0x00007f51ec0890e0 in ?? ()
#32 0x00007f51f0e61430 in ?? () from /home/ajay/Downloads/root_6.22/lib/libGpad.so
#33 0x00007f51ec0890e0 in ?? ()
#34 0x00007f51ec0011a0 in ?? ()
#35 0x58e3147e98638600 in ?? ()
#36 0x00007f51f1725908 in ?? ()
#37 0x00007f51f1725880 in ?? ()
#38 0x0000000600000006 in ?? ()
#39 0x0000000000000000 in ?? ()

===========================================================
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "demoshelp.py", line 16, in <module>
    chelp = TCanvas( 'chelp', 'Help to run demos', 200, 10, 700, 500 )
TypeError: none of the 5 overloaded methods succeeded. Full details:
  TCanvas::TCanvas(bool build = kTRUE) =>
    TypeError: takes at most 1 arguments (6 given)
  TCanvas::TCanvas(const char* name, const char* title, int ww, int wh) =>
    TypeError: takes at most 4 arguments (6 given)
  TCanvas::TCanvas(const char* name, const char* title, int wtopx, int wtopy, int ww, int wh) =>
    SegmentationViolation: segfault in C++; program state was reset
  TCanvas::TCanvas(const char* name, int ww, int wh, int winid) =>
    TypeError: takes at most 4 arguments (6 given)
  TCanvas::TCanvas(const char* name, const char* title = "", int form = 1) =>
    TypeError: takes at most 3 arguments (6 given)
https://github.com/root-project/root/tree/v6-22-00https://github.com/root-project/root/tree/v6-22-00

Is this a known bug or I am doing something wrong? Or some package incompatibility issue?

The demo.py tutorial is currently not working in the new PyROOT, as discussed in the post referenced by @Wile_E_Coyote (actually the first error you see in Python3 is because of a Python2-Python3 incompatibility).

Just to verify that the installation is working, can you try to run import ROOT from from Python2 and Python3?

Since both the versions of python were not working on simultaneous installation, I now have configured ROOT fresh with only Python2. Therefore, I won’t be able to test what you are asking.

But, my guess is that import ROOT should work. There was no problem with the installation, only running pyroot is the issue.