Error installating ROOT on Ubuntu 20.04

Dear users,

I am trying to install ROOT on my computer from the source:

I have problems in the step 3, when I run the command: make -j8
I obtain the following:

[ 0%] Performing build step for ‘XROOTD’
[ 1%] Built target move_header_roofit_roostats
[ 1%] Built target VDT
[ 2%] Built target TBB
[ 2%] Built target builtin_nlohmann_json_incl
[ 3%] Built target zstd
[ 3%] Built target PCRE
[ 3%] Built target copymodulemap
[ 3%] Built target xxhash
[ 3%] Built target OPENSSL
[ 3%] Built target move_header_core_clib
[ 3%] Built target move_header_core_clingutils
[ 3%] Built target move_header_core_foundation
[ 3%] Built target move_header_core_cont
[ 3%] Built target move_header_core_gui
[ 4%] Built target move_header_core_meta
[ 4%] Built target move_header_core_multiproc
[ 4%] Built target move_header_core_textinput
[ 4%] Built target move_header_core_rint
[ 4%] Built target move_header_core_thread
[ 4%] Built target move_header_core_zip
[ 4%] Built target move_header_core_imt
[ 4%] Built target move_header_core_zstd
[ 4%] Built target move_header_core_lz4
[ 4%] Built target move_header_core_lzma
[ 4%] Built target move_header_core_newdelete
[ 6%] Built target move_header_core_base
[ 6%] Built target move_header_core_unix
[ 6%] Built target move_header_math_matrix
[ 7%] Built target move_header_math_mathcore
[ 7%] Built target move_header_math_fumili
[ 7%] Built target move_header_math_minuit
[ 7%] Built target move_header_math_physics
[ 7%] Built target move_header_math_foam
[ 7%] Built target move_header_math_mlp
[ 8%] Built target move_header_math_quadp
[ 8%] Built target move_header_math_smatrix
[ 10%] Built target move_header_math_genvector
[ 10%] Built target move_header_math_splot
[ 10%] Built target move_header_math_genetic
[ 10%] Built target move_header_math_vecops
[ 10%] Built target move_header_hist_histpainter
[ 11%] Built target move_header_hist_histv7
[ 12%] Built target move_header_hist_hist
[ 12%] Built target move_header_hist_spectrum
[ 12%] Built target move_header_hist_histdrawv7
[ 12%] Built target move_header_hist_spectrumpainter
[ 12%] Built target move_header_tree_tree
[ 13%] Built target move_header_tree_treeplayer
[ 13%] Built target move_header_tree_treeviewer
[ 13%] Built target move_header_tree_dataframe
[ 14%] Built target move_header_tree_ntuple
[ 14%] Built target move_header_io_xml
[ 14%] Built target move_header_io_io
[ 14%] Built target move_header_io_sql
[ 15%] Built target move_header_net_net
[ 15%] Built target move_header_net_auth
[ 15%] Built target move_header_net_netx
[ 15%] Built target move_header_net_http
[ 15%] Built target move_header_net_netxng
[ 15%] Built target move_header_net_httpsniff
[ 15%] Built target move_header_graf2d_gpadv7
[ 15%] Built target move_header_graf2d_primitivesv7
[ 16%] Built target move_header_graf2d_gpad
[ 16%] Built target move_header_graf2d_graf
[ 16%] Built target move_header_graf2d_postscript
[ 16%] Built target move_header_graf2d_x11
[ 16%] Built target move_header_graf2d_x11ttf
[ 16%] Built target move_header_graf3d_g3d
[ 16%] Built target move_header_graf2d_asimage
[ 17%] Built target move_header_gui_gui
[ 18%] Built target move_header_graf3d_eve7
[ 18%] Built target move_header_graf3d_x3d
[ 19%] Built target move_header_graf3d_csg
[ 19%] Built target move_header_gui_ged
[ 19%] Built target move_header_gui_fitpanel
[ 19%] Built target move_header_gui_guihtml
[ 19%] Built target move_header_gui_recorder
CMake Error at /home/diego/build/XROOTD-prefix/src/XROOTD-stamp/XROOTD-build-Release.cmake:49 (message):
Command failed: 2

‘make’

See also

/home/diego/build/XROOTD-prefix/src/XROOTD-stamp/XROOTD-build-*.log

make[2]: *** [CMakeFiles/XROOTD.dir/build.make:131: XROOTD-prefix/src/XROOTD-stamp/XROOTD-build] Error 1
make[1]: *** [CMakeFiles/Makefile2:7408: CMakeFiles/XROOTD.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 19%] Built target move_header_gui_guibuilder
[ 19%] Built target move_header_gui_sessionviewer
[ 19%] Built target move_header_gui_browsable
[ 19%] Built target move_header_gui_webdisplay
[ 19%] Built target move_header_gui_webgui6
[ 19%] Built target move_header_gui_browserv7
make: *** [Makefile:171: all] Error 2

I do not know how to solve it, but i would really appreciate if someone can help me! Thanks so much for your considerations.

Diego Mendoza

Hello @mendoza,

I cannot see any obvious cause in the output that you have copied in your last post (besides that make failed). Could you please attach the suggested XROOTD-build-*.log files. Thanks!

Cheers,
J.

Hello,

I have solved the problem, it was only that I had not installed all the requires dependences!

However, running now root I have problems to open python macros:

(base) diego@diego-HP-Laptop-15-bs0xx:~/TutorialPyRoot$ root demo.py

| Welcome to ROOT 6.23/01 https://root.cern |
| © 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Nov 01 2020, 18:19:28 |
| From heads/master@v6-23-01-RF-binSampling-32-g550aa86734 |
| With |

Try ‘.help’, ‘.demo’, ‘.license’, ‘.credits’, ‘.quit’/’.q’

root [0]
Processing demo.py…
In file included from input_line_11:1:
/home/diego/TutorialPyRoot/demo.py:1:1: error: unknown type name ‘import’
import os, sys
^
/home/diego/TutorialPyRoot/demo.py:1:15: error: expected ‘;’ after top level declarator
import os, sys
^
;
/home/diego/TutorialPyRoot/demo.py:4:3: error: invalid preprocessing directive

To run, do “python /demo.py”

^
/home/diego/TutorialPyRoot/demo.py:6:3: error: invalid preprocessing directive

enable running from another directory than the one where demo.py resides

^
/home/diego/TutorialPyRoot/demo.py:11:3: error: invalid preprocessing directive

This macro generates a Controlbar menu.

^
/home/diego/TutorialPyRoot/demo.py:12:3: error: invalid preprocessing directive

To execute an item, click with the left mouse button.

^
/home/diego/TutorialPyRoot/demo.py:13:3: error: invalid preprocessing directive

To see the HELP of a button, click on the right mouse button.

^
/home/diego/TutorialPyRoot/demo.py:19:3: error: invalid preprocessing directive

The callbacks to python work by having CLING call the python interpret…

^
/home/diego/TutorialPyRoot/demo.py:20:3: error: invalid preprocessing directive

the “TPython” class. Note the use of “raw strings.”

^
/home/diego/TutorialPyRoot/demo.py:59:10: warning: empty character constant [-Winvalid-pp-token]
rep = ‘’
^
/home/diego/TutorialPyRoot/demo.py:61:9: error: invalid preprocessing directive
# Check if we are in Python 2 or 3
^
Thanks a lot for your message! I hope to solve it soon.

Diego Mendoza

Please note that the ROOT prompt uses Cling to interpret C++ code. Therefore, the expected input from the user should be legal C++, not Python. If you are going to use Python after installing ROOT, you probably want to launch a Python interpreter as follows:

$ python

Cheers,
J.

Hello,

When I start python and I put the command import ROOT, I obtain the following:

Hello @mendoza,

I think @etejedor can help you with this issue.

Cheers,
J.

Hello,

According to the error message, you are trying to import ROOT with a Python installation that is not the one ROOT was built with. More precisely, you are using a Python3.7 installation but ROOT says PyROOT was not built for that version.

If you are using ROOT 6.22 or above, you can do:
root-config --python2-version
and
root-config --python3-version
to check the Python versions ROOT was built with.