# Issue with building ROOT

**URL:** <https://root-forum.cern.ch/t/issue-with-building-root/33807>\
**Category:** Newbie\
**Created:** [April 29, 2019, 9:35am UTC](https://root-forum.cern.ch/t/issue-with-building-root/33807 "2019-04-29T09:35:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amiucci](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f04885/32.png) [@amiucci](https://root-forum.cern.ch/u/amiucci)\
**Post date:** [April 29, 2019, 9:35am UTC](https://root-forum.cern.ch/t/issue-with-building-root/33807/1 "2019-04-29T09:35:32Z")

</div>

Hello,

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

```auto
/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:

```auto
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:

```auto
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,  
Antonello.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [May 2, 2019, 3:37am UTC](https://root-forum.cern.ch/t/issue-with-building-root/33807/2 "2019-05-02T03:37:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![amiucci](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f04885/32.png) [@amiucci](https://root-forum.cern.ch/u/amiucci)\
**Post date:** [May 2, 2019, 4:38am UTC](https://root-forum.cern.ch/t/issue-with-building-root/33807/3 "2019-05-02T04:38:15Z")

</div>

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,  
Antonello.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [May 2, 2019, 6:43am UTC](https://root-forum.cern.ch/t/issue-with-building-root/33807/4 "2019-05-02T06:43:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![amiucci](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f04885/32.png) [@amiucci](https://root-forum.cern.ch/u/amiucci)\
**Post date:** [May 2, 2019, 6:53am UTC](https://root-forum.cern.ch/t/issue-with-building-root/33807/5 "2019-05-02T06:53:20Z")

</div>

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