Problems with installing Root

I am trying to install Root on a machine that runs Fedora 25. I am following the INSTALL file that I found in the README folder obtained ultimately from the archive from the ROOT website.
My problem is that when I try to run the second point from Section 3.1, namely cmake ../root I get the following message:

CMake Error: The source directory "/home/tarabostes-delectus/Downloads/root/root" does not exist. Specify --help for usage, or press the help button on the CMake GUI.

Another person managed to get further in the installation progress by running the cmake .. command. However, this does not help too much, as in the next steps I get the following message.

I have tried looking up the error and on a stack exchange forum the solution given was that some library was missing (https://stackoverflow.com/questions/16024978/usr-bin-ld-cannot-find-lc-while-compiling-with-makefile). I have installed the library to no avail.

Any help is appreciated. Cheers

**Edit1:**I have tried looking up via the file explorer for the CMakeLists.txt in the / folder. I did indeed find several such files. Yet when I run cmake / I get the same error message as in the first instance.

The path after the cmake command indicates which CMakeLists.txt file that CMake should attempt to read. The idea here is that you have extracted the source files to a location, created a build directory and instructed CMake where to look for those source files. For root 6.08/06 one would do the following to unpack the source and create a build directories and compile it:

wget https://root.cern.ch/download/root_v6.08.06.source.tar.gz
tar xzf root_v6.08.06.source.tar.gz.tgz
mkdir root-build
cd root-build
cmake ../root-6.08.06

The wget commands download the source, tar unzip and extracts the source files to the root-6.08.06 directory, we then make a build directory called root-build, and finally instruct cmake to look int he source directory root-6.08.06 for the CMakeLists.txt files.

(The command cmake .. instructs cmake that the CMakeLists.txt are in the directory above, this is often seen when the build directory is placed inside the root source directory. The command cmake / would instruct mcake to look for CMakeLists.txt files in the operating system’s root directory, which is very unlikely to be true.)

Secondly, you may need to rebuild the make file that CMake generates when you change packages on your operating system. Often CMake is smart enough to detect these changes, but not always. CMake maintains a cache CMakeCache.txt of variables including libraries and their paths found when it was first run, these variables are used on subsequent runs to speed up the process, but main not reflect the correct paths when system changes have occurred.

My suggestion is that you remove the build directory and start again to ensure you environment is correct when CMake creates the Makefile (one can sometimes simply remove the cache file, but removing everything guarantees a fresh build). For the above example you would need the following to clean up and redo the build:

rm -rf root-build/*
cd root-build
cmake ../root-6.08.06

Finally, I have also recently attempted to build ROOT 6 for Fedora 25 recently and also failed, I did not give it much effort though. I will try and take a look tonight to see if my issue was the same as yours.

(Sorry for the long-winded answer.)

2 Likes

Also, it appears that you had resolved your issue in another thread:

First of all, thank you very much for your detailed explanations of the commands. They were very helpful and I now have a more complete image of what is happening.

Secondly, I did somewhat solve the issue (I managed to install it, run it and also plot a function) but when I got home and tried to redo the operation, the error (from the other post, if it would be easier I can also post it here) reappeared. I then typed the command source bin/thisroot.sh and the error did not appear anymore. So my question is if there is some way to avoid typing the command everytime I run root after a reboot.

This command can be added to your login scripts. I assume you are using bash, as such you should appended the line to ~/.bash_profile.

Due to the fact that I am a Linux noob, I unfortunately do not know where to find the file in order to add the command to it.

Also, I noticed that the command source bin/thisroot.sh only works when I first enter in the build directory. Is is possible to somehow go around this?

Is this considered as normal behaviour? Or could this be because there are several installation points in the system?

Welcome to the wonderful world of linux. I would suggest checking out some tutorials, I have suggested these in the past: http://www.ee.surrey.ac.uk/Teaching/Unix/. I strongly suggest you learn about paths as you questions are mainly focused on that aspect.

A quick run down of your questions:

~ is a shortcut to the environment variable $HOME which is your home directory. On fedora this is typically /home/username. Try the following:

printenv HOME

This means your .bash_profile file is located at /home/username/.bash_profile. It is a hidden file so it will not appear in listings (ls) unless you specify the all flag -a:

cd ~
ls -a

This behavior is because you have only specified a relative path bin/thisroot.sh. This means go from my present working directory ($PWD) and source the file thisroot.sh inside the bin directory. An absolute path would start with a forward slash as in /opt/root/root-6.08.06/bin/thisroot.sh To be able to source the ROOT script from anywhere update you path to an absolute path (replacing /path/to/root with the location of your install):

source /path/to/root/bin/thisroot.sh

The above is the line you should add to your .bash_profile.

1 Like

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