# CMAKE error when installing root

**URL:** <https://root-forum.cern.ch/t/cmake-error-when-installing-root/53918>\
**Category:** Newbie\
**Created:** [March 7, 2023, 5:12pm UTC](https://root-forum.cern.ch/t/cmake-error-when-installing-root/53918 "2023-03-07T17:12:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SKY](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@SKY](https://root-forum.cern.ch/u/SKY)\
**Post date:** [March 7, 2023, 5:12pm UTC](https://root-forum.cern.ch/t/cmake-error-when-installing-root/53918/1 "2023-03-07T17:12:59Z")

</div>

\_ROOT Version: v6-28-00  
_Platform:_ MacOS  
_Compiler:_ Not Provided

* * *

I am trying to install root following instructions:

and when I try to build using the following commands:

`cd ../root-build`  
`cmake -DCMAKE_INSTALL_PREFIX=$HOME/ROOT/root-install -DPYTHIA8_DIR=$PYTHIA8 -DPYTHIA8_INCLUDE_DIR=$PYTHIA8/include -DPYTHIA8_LIBRARY=$PYTHIA8/lib/libpythia8.so -DGSL_DIR=/usr/local -Dbuiltin_xrootd=ON -Droofit=ON -Dpythia8=ON ../root-sources`

I get the following error:

CMake Error at cmake/modules/SearchInstalledSoftware.cmake:614 (message):  
Please enable builtin Glew due bug in latest CMake (use cmake option  
-Dbuiltin\_glew=ON).  
Call Stack (most recent call first):  
CMakeLists.txt:254 (include)

Is there something I am not doing right?

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 7, 2023, 5:43pm UTC](https://root-forum.cern.ch/t/cmake-error-when-installing-root/53918/2 "2023-03-07T17:43:49Z")

</div>

May be @bellenot knows

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [March 8, 2023, 7:21am UTC](https://root-forum.cern.ch/t/cmake-error-when-installing-root/53918/3 "2023-03-08T07:21:32Z")

</div>

I would say the solution is in the error message:

> [@SKY](#):
>
> Please enable builtin Glew due bug in latest CMake (use cmake option -Dbuiltin\_glew=ON).

---

<div class="post-metadata">

**Author:** ![SKY](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@SKY](https://root-forum.cern.ch/u/SKY)\
**Post date:** [March 8, 2023, 11:40am UTC](https://root-forum.cern.ch/t/cmake-error-when-installing-root/53918/4 "2023-03-08T11:40:45Z")

</div>

But where do I find this script? I could not find it anywhere

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [March 8, 2023, 12:14pm UTC](https://root-forum.cern.ch/t/cmake-error-when-installing-root/53918/5 "2023-03-08T12:14:26Z")

</div>

Which script? Just try:

```auto
cmake -DCMAKE_INSTALL_PREFIX=$HOME/ROOT/root-install -DPYTHIA8_DIR=$PYTHIA8 -DPYTHIA8_INCLUDE_DIR=$PYTHIA8/include -DPYTHIA8_LIBRARY=$PYTHIA8/lib/libpythia8.so -DGSL_DIR=/usr/local -Dbuiltin_xrootd=ON -Droofit=ON -Dpythia8=ON -Dbuiltin_glew=ON ../root-sources

```

I.e. add `-Dbuiltin_glew=ON` in the list of CMake options
