# GL/glew.h not found when building root 6.20

**URL:** <https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489>\
**Category:** ROOT\
**Tags:** build\
**Created:** [March 19, 2020, 7:51pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489 "2020-03-19T19:51:33Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/f04885/32.png) [@Diego](https://root-forum.cern.ch/u/Diego)\
**Post date:** [March 19, 2020, 7:51pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/1 "2020-03-19T19:51:33Z")

</div>

Dear all,

After executing

cmake --build . – -j2

I am having the following fatal error when building root 6.20.02:

```auto
[62%] Building CXX object graf3d/ftgl/CMakeFiles/FTGL.dir/src/FTBitmapGlyph.cxx.o
In file included from /Users/torres/soft/root/root-6.20.02/graf3d/ftgl/src/FTBitmapGlyph.cxx:3:
In file included from /Users/torres/soft/root/root-6.20.02/graf3d/ftgl/inc/FTBitmapGlyph.h:9:
In file included from /Users/torres/soft/root/root-6.20.02/graf3d/ftgl/inc/FTGL.h:21:
**/Users/torres/soft/root/root-6.20.02-build/include/TGLIncludes.h:21:10:**  **fatal error:**  **'GL/glew.h' file not found**
#include <GL/glew.h>
**^ ~~~~~~~~~~ **
1 error generated.
make[2]: *** [graf3d/ftgl/CMakeFiles/FTGL.dir/src/FTBitmapGlyph.cxx.o] Error 1
make[1]: *** [graf3d/ftgl/CMakeFiles/FTGL.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[62%] Built target BaseTROOT
make: *** [all] Error 2

```

glew 2.1.0\_1 is already installed in my machine and it is apparently linked. I am running in mac os Catalina 10.15.3.

Thanks for helping!

Diego

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [March 20, 2020, 2:59pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/2 "2020-03-20T14:59:22Z")

</div>

@oshadura looks like the same issue as in this other post, right?

> [@Build problem on Catalina](https://root-forum.cern.ch/t/build-problem-on-catalina/38458):
>
> Hi, I’m having build problems of version 6.20 on Catalina with the latest Xcode. I’m using: cmake …/root-6.20.00/ -DCMAKE\_INSTALL\_PREFIX=/usr/local/root -Droofit=ON -Dtmva=ON -Dminuit2=ON -Dpython=ON cmake --build . – -j4 but I have a problem with missing GL/glew.h [61%] Building C object build/CMakeFiles/rmkdepend.dir/rmkdepend/include.c.o In file included from /Users/lista/Desktop/root-6.20.00/graf3d/ftgl/src/FTBitmapGlyph.cxx:3: In file included from /Users/lista/Desktop/root-6.20.00/…

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [March 23, 2020, 11:20am UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/3 "2020-03-23T11:20:58Z")

</div>

Hi! Can you please try to enable -Dbuiltin\_glew=ON?

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [March 23, 2020, 11:29am UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/4 "2020-03-23T11:29:34Z")

</div>

I opened Jira issue: [https://sft.its.cern.ch/jira/browse/ROOT-10631](https://sft.its.cern.ch/jira/browse/ROOT-10631)

---

<div class="post-metadata">

**Author:** ![Diego](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/f04885/32.png) [@Diego](https://root-forum.cern.ch/u/Diego)\
**Post date:** [March 23, 2020, 12:26pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/5 "2020-03-23T12:26:12Z")

</div>

It worked now!  
Thanks!

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [March 23, 2020, 12:38pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/6 "2020-03-23T12:38:19Z")

</div>

here is PR as well coming here: [https://github.com/root-project/root/pull/5199](https://github.com/root-project/root/pull/5199)

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [March 23, 2020, 2:06pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/7 "2020-03-23T14:06:16Z")

</div>

Could you please try if this fix help to solve situation when you have -Dbuiltin\_glew=OFF ([https://github.com/root-project/root/pull/5199](https://github.com/root-project/root/pull/5199))

Thanks a lot in advance!

---

<div class="post-metadata">

**Author:** ![Diego](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/f04885/32.png) [@Diego](https://root-forum.cern.ch/u/Diego)\
**Post date:** [March 23, 2020, 3:44pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/8 "2020-03-23T15:44:11Z")

</div>

Hi,  
Executing with -Dbuiltin\_glew=OFF , I have the following message:

[98%] **Linking CXX shared library …/…/lib/libRGL.so**  
ld: library not found for -lGLEW  
clang: **error:** linker command failed with exit code 1 (use -v to see invocation)  
make[2]: \*\*\* [lib/libRGL.so] Error 1  
make[1]: \*\*\* [graf3d/gl/CMakeFiles/RGL.dir/all] Error 2  
make: \*\*\* [all] Error 2

Cheers,

Diego

---

<div class="post-metadata">

**Author:** ![Diego](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/f04885/32.png) [@Diego](https://root-forum.cern.ch/u/Diego)\
**Post date:** [March 23, 2020, 3:41pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/9 "2020-03-23T15:41:40Z")

</div>

Hi,

Executing with -Dbuiltin\_glew=OFF , I have the following message:

[98%] **Linking CXX shared library …/…/lib/libRGL.so**

ld: library not found for -lGLEW

clang: **error:** linker command failed with exit code 1 (use -v to see invocation)

make[2]: \*\*\* [lib/libRGL.so] Error 1

make[1]: \*\*\* [graf3d/gl/CMakeFiles/RGL.dir/all] Error 2

make: \*\*\* [all] Error 2

Cheers,

Diego

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [March 26, 2020, 8:06am UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/10 "2020-03-26T08:06:13Z")

</div>

Hi! Sorry for late reply, I wanted to reproduce your failure and I wanted to ask how did you install Glew?

---

<div class="post-metadata">

**Author:** ![Diego](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/f04885/32.png) [@Diego](https://root-forum.cern.ch/u/Diego)\
**Post date:** [March 26, 2020, 12:55pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/11 "2020-03-26T12:55:06Z")

</div>

Hello,  
I did this: brew install glew

Diego

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [March 30, 2020, 8:29am UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/12 "2020-03-30T08:29:12Z")

</div>

At the end, sadly it appears to be a bug in CMake 3.15-3.17, and we disabled for Mac OS X an option with builtin\_glew=OFF. Out of curiosity, we would like to ask you why you needed install glew from brew (it it a requirement of other application)?

Thank you again so much for your report!

---

<div class="post-metadata">

**Author:** ![Diego](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/f04885/32.png) [@Diego](https://root-forum.cern.ch/u/Diego)\
**Post date:** [March 30, 2020, 12:00pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/13 "2020-03-30T12:00:33Z")

</div>

Hello,  
Thanks for fixing it! About glew, it seems that it was not installed in my machine (and I do not know if I need for any other application).

Cheers

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [April 13, 2020, 12:00pm UTC](https://root-forum.cern.ch/t/gl-glew-h-not-found-when-building-root-6-20/38489/14 "2020-04-13T12:00:34Z")

</div>

Closed on April 13, 2020, 12:00pm UTC

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