Install root for ubuntu 20

Hello to everyone,

I upgrade my gcc compiler to the 9.3 version and root suddenly did not work anymore. It gives me this error message:

input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^~~~~
input_line_3:37:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
input_line_9:1:10: fatal error: 'iostream' file not found
#include <iostream>

I have read that this happens when a new version of the compiler is installed on the system. So, I download the newest root version for ubuntu 20. I follow the instruction but after the unpacking I do not understand what to do and root still gives me the same error message.

The last a colleague of mine installed root on my system and I do not remember how he did it.

What I have to do now? I tried to read the installation guide but there are too few instruction on it.

Best regards and thank you for your time, Alessandro Calamida.


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi,
you have to reinstall ROOT, the installation you have is coupled to your old gcc version and is now broken. Installation instructions can be found at https://root.cern/install .

The easiest way is probably to install ROOT via your system package manager, conda, snap or homebrew/macports, depending on what operating system you are on. Feel free to ask for clarifications if something is not clear.

Cheers,
Enrico

Hello,

I deleted the old root version and I unpack the new one. However, on the instruction page there is no clear instruction on how continue after that.

I have not any of the system package manager listed there and I really do not know how tu use at all.

I am using ubunto 20.04 and I have to install root 6.22.06.

Best regards, Alessandro.

Ok, if I understand correctly you downloaded a pre-compiled binary. Did you follow the 4 steps listed at Installing ROOT - ROOT ? The exact terminal commands are exemplified in the code snippet box for v6.22.00, but should be easy to adapt for the actual binary you downloaded.

Cheers,
Enrico

(I think Ubuntu comes with snap out of the box by the way, maybe check out A Snap package for ROOT on Linux - ROOT )

I follow the first three steps with no problems. But I do not understand the fourth. I tried to type it but nothing happens. For thesse reason I ask for help. I do not know how to go further.

Best regards, Alessandro.

Alright, source <file> is a command that executes the lines in <file> in the current shell. An equivalent spelling that you might see reported somewhere is . <file>.

ROOT’s pre-compiled binaries come with a file called thisroot.sh (in the bin directory inside the ROOT package you downloaded). What thisroot.sh does is setting up your environment so that it knows where to find ROOT’s executables, libraries, headers, etc. Running source path/to/your/root/bin/thisroot.sh should not print anything on screen.

Before running source thisroot.sh, trying to start a ROOT prompt (with the root command) should fail, and which root should say there is no root command available. After running source thisroot.sh, root should be available.

As the docs mention you have to either do the source every time you open a terminal, or you can put that command in your .bashrc file which is run every time you open a shell (using the snap package would be simpler).

Cheers,
Enrico

Thank you very much. I eliminated every trace of the old installation deleting the comand in the .bashrc file and then reinstalled everything back using the new version. Now everything works fine.

Thank you very much for you time and your help.

Best regards, Alessandro.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.