Issue with building ROOT


I am trying to compile ROOT on Centos7.
Unfortunately it fails while compiling due to the following error:

/terabig/amiucci/root-6.16.00/rootx/src/rootxx.cxx:28:10: fatal error: X11/Xlib.h: No such file or directory
 #include <X11/Xlib.h>
compilation terminated.
gmake[2]: *** [rootx/CMakeFiles/root.dir/src/rootxx.cxx.o] Errore 1
gmake[2]: *** Attesa dei processi non terminati....

I did install the required packages with anaconda. For example I installed X11 with the following command:
conda install -c conda-forge xorg-libx11

It looks like it is not pointing correctly to my lib folder, where the shared objects are. I explicitly add the anaconda lib directory to the $LD_LIBRARY_PATH:

export PATH="/terabig/amiucci/anaconda3/bin:$PATH"
export LD_LIBRARY_PATH="/terabig/amiucci/anaconda3/lib:$LD_LIBRARY_PATH"

What am I missing there?

I am using the cmake compilation, in the build directory of the root project, here the list of command I am using:

cmake .. -Dcxx14=ON
cmake --build . -- -j20

Any suggestions?

Just a final comment: I cannot use the conda version of root since I need to compile it with cxx14 due to some compatibility with other packages that we plan to use in combination with ROOT. If there is a way to install from conda with cxx14 ON, I am happy to buy it.

Thanks a lot,

If you build using anaconda packages, then you have to use -DCMAKE_PREFIX_PATH=/terabig/amiucci/anaconda3 to tell CMake where to find your packages. However, I highly discourage you to mix anaconda here. It’s much better to install ROOT’s dependencies with yum or dnf into the system. You can install the epel-release package, install ROOT with yum install root, then compile your custom ROOT using system packages. You may have to install a newer compiler into the system to be able to compile with C++14, though.

Hi amadio,

unfortunately the cmake option -DCMAKE_PREFIX_PATH=/terabig/amiucci/anaconda3 did not solve the issue. I do not have admin privileges on the machine where I need to install root, that’s the reason I was avoiding yum. The idea was to have an independent installation for users.
Luckily the machine has a gcc7 compiler and a gcc4.9 as well, this should come already with cxx14. I will contact the admin of the system to install the root packages you suggested.

I will keep you posted to see whether I solve the issue in this way.

Thank you,

Ok, in any case, anaconda packages are not guaranteed to be ABI compatible with system packages, so if you mix them, you will probably have linking errors. Maybe you can install via conda using a customized recipe to use C++14.

That would be great, but I have not found any useful guid to customize the gcc option while installing via conda.