Loading libRGL.so on MAC OSX

I have compiled root-v28c on MAC OSC Snow Leopard, where I have used the configuration the following option

./configure options are :
<Dario.Moricciani@Dario-Moriccianis-MacBook:~/Desktop> root-config --config
macosx64 --enable-builtin-pcre --enable-cintex --enable-explicitlink --enable-genvector --enable-krb5 --enable-mathmore --enable-mysql --enable-python --enable-qt --enable-reflex --enable-table --enable-builtin-freetype --enable-ruby --enable-minuit2 --enable-roofit --enable-unuran --enable-qtgsi --enable-gdml --enable-soversion --with-f77=/opt/local/bin/gfortran-mp-4.5 --with-fftw3-incdir=/opt/include/include --with-fftw3-libdir=/opt/local/lib --with-pythia6-libdir=/Users/dario/software/pythia6 --with-pythia8-libdir=/Users/dario/software/pythia8140/lib --with-pythia8-incdir=/Users/dario/software/pythia8140/include --with-gsl-incdir=/opt/local/include --with-gsl-libdir=/opt/local/lib --with-qt-incdir=/opt/local/include --with-qt-libdir=/opt/local/lib --with-gviz-incdir=/opt/local/include --with-gviz-libdir=/opt/local/include --with-glew-incdir=/opt/local/include --with-glew-libdir=/opt/local/include

Then when I try this with my application I get the following error:

<Dario.Moricciani@Dario-Moriccianis-MacBook:~/Desktop> root


  • W E L C O M E to R O O T *
  • Version 5.28/00c 15 April 2011 *
  • You are welcome to visit our Web site *
  • root.cern.ch *

ROOT 5.28/00c (tags/v5-28-00c@38884, May 04 2011, 21:10:56 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x centraldetectors9.c
Info in TGeoManager::TGeoManager: Geometry Assemblies, Geometry using assemblies created
Info in TGeoManager::SetTopVolume: Top volume is PIPPO. Master volume is PIPPO
Info in TGeoManager::CheckGeometry: Fixing runtime shapes…
Info in TGeoManager::CheckGeometry: …Nothing to fix
Info in TGeoManager::CloseGeometry: Counting nodes…
Info in TGeoManager::Voxelize: Voxelizing…
Info in TGeoManager::CloseGeometry: Building cache…
Info in TGeoNavigator::BuildCache: — Maximum geometry depth set to 100
Info in TGeoManager::CloseGeometry: 2402 nodes/ 3433 volume UID’s in Geometry using assemblies
Info in TGeoManager::CloseGeometry: ----------------modeler ready----------------
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
dlopen error: dlopen(/cern/root/lib/libRGL.so, 9): Symbol not found: ___GLEW_EXT_framebuffer_multisample
Referenced from: /cern/root/lib/libRGL.so
Expected in: flat namespace
in /cern/root/lib/libRGL.so
Load Error: Failed to load Dynamic link library /cern/root/lib/libRGL.so
Error in TCint::AutoLoad: failure loading library libRGL.so for class TGLSAViewer
Error in TPluginHandler::SetupCallEnv: class TGLSAViewer not found in plugin RGL
Warning in TCanvas::TPad::CreateViewer3D: Cannot create 3D viewer of type: ogl

Take in mind that I have installed the latest version (1.6) of glew using MacPorts, see for example the configuration options above.

While if I use the root binary distribution it work fine … Please any one can help me ?

Best Regards

Can you, please, try to re-configure ROOT with --enable-builtint-glew (and without --with-glew-xxx), and recompile/relink it? Will it help?

I have configure and compile with this options :

Dario-Moriccianis-MacBook:root root# more config.status
macosx64 --enable-builtin-pcre --enable-builtin-glew --enable-cintex --enable-explicitlink --enable-genvector --enable-krb5 --enable-mathmore --enable-mysql --enable-python --enable-qt --enable-reflex --enable-table --enable-builtin-freetype --enable-ruby --enable-minuit2 --enable-roofit --enable-unuran --enable-qtgsi --enable-gdml --enable-soversion --with-f77=/opt/local/bin/gfortran-mp-4.5 --with-fftw3-incdir=/opt/include/include --with-fftw3-libdir=/opt/local/lib --with-pythia6-libdir=/Users/dario/software/pythia6 --with-pythia8-libdir=/Users/dario/software/pythia8140/lib --with-pythia8-incdir=/Users/dario/software/pythia8140/include --with-gsl-incdir=/opt/local/include --with-gsl-libdir=/opt/local/lib --with-qt-incdir=/opt/local/include --with-qt-libdir=/opt/local/lib --with-gviz-incdir=/opt/local/include --with-gviz-libdir=/opt/local/include

but this is the results:

Dario-Moriccianis-MacBook:root root# grep GL config.log
Checking for GL/gl.h …
Checking for GL/gl.h in directory /opt/local/include
/opt/local/include/GL/gl.h is read-able
Checking for libGL, or libMesaGL …
libraries to check for: libGL.so libGL.sl libGL.dylib libGL.dll.a libMesaGL.so libMesaGL.sl libMesaGL.dylib libMesaGL.dll.a libGL.a libGL.lib libGL libMesaGL.a libMesaGL.lib libMesaGL
Checking in directories /opt/local/lib for libGL.so libGL.sl libGL.dylib libGL.dll.a libMesaGL.so libMesaGL.sl libMesaGL.dylib libMesaGL.dll.a libGL.a libGL.lib libGL libMesaGL.a libMesaGL.lib libMesaGL
Checking for library libGL.so in directory /opt/local/lib
Checking /opt/local/lib/libGL.so
libGL.so not found in /opt/local/lib
Checking for library libGL.sl in directory /opt/local/lib
Checking /opt/local/lib/libGL.sl
libGL.sl not found in /opt/local/lib
Checking for library libGL.dylib in directory /opt/local/lib
Checking /opt/local/lib/libGL.dylib
Found file /opt/local/lib/libGL.dylib
Checking for libGLU, or libMesaGLU …
libraries to check for: libGLU.so libGLU.sl libGLU.dylib libGLU.dll.a libMesaGLU.so libMesaGLU.sl libMesaGLU.dylib libMesaGLU.dll.a libGLU.a libGLU.lib libGLU libMesaGLU.a libMesaGLU.lib libMesaGLU
Checking in directories /opt/local/lib for libGLU.so libGLU.sl libGLU.dylib libGLU.dll.a libMesaGLU.so libMesaGLU.sl libMesaGLU.dylib libMesaGLU.dll.a libGLU.a libGLU.lib libGLU libMesaGLU.a libMesaGLU.lib libMesaGLU
Checking for library libGLU.so in directory /opt/local/lib
Checking /opt/local/lib/libGLU.so
libGLU.so not found in /opt/local/lib
Checking for library libGLU.sl in directory /opt/local/lib
Checking /opt/local/lib/libGLU.sl
libGLU.sl not found in /opt/local/lib
Checking for library libGLU.dylib in directory /opt/local/lib
Checking /opt/local/lib/libGLU.dylib
Found file /opt/local/lib/libGLU.dylib
Checking for GL/glew.h …
Checking for GL/glew.h in directory /opt/local/include
/opt/local/include/GL/glew.h is read-able
Checking for libGLEW …
libraries to check for: libGLEW.so libGLEW.sl libGLEW.dylib libGLEW.dll.a libGLEW.a libGLEW.lib libGLEW
Checking in directories /opt/local/lib for libGLEW.so libGLEW.sl libGLEW.dylib libGLEW.dll.a libGLEW.a libGLEW.lib libGLEW
Checking for library libGLEW.so in directory /opt/local/lib
Checking /opt/local/lib/libGLEW.so
libGLEW.so not found in /opt/local/lib
Checking for library libGLEW.sl in directory /opt/local/lib
Checking /opt/local/lib/libGLEW.sl
libGLEW.sl not found in /opt/local/lib
Checking for library libGLEW.dylib in directory /opt/local/lib
Checking /opt/local/lib/libGLEW.dylib
Found file /opt/local/lib/libGLEW.dylib
Checking whether to build included GLEW

And the results give the same problems …

<Dario.Moricciani@Dario-Moriccianis-MacBook:~/Desktop> root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.28/00c 15 April 2011 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      [root.cern.ch](http://root.cern.ch)            *
    
  •                                     *
    

ROOT 5.28/00c (tags/v5-28-00c@38884, Apr 15 2011, 17:34:24 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x centraldetectors10.c
Info in TGeoManager::TGeoManager: Geometry Assemblies, Geometry using assemblies created
Info in TGeoManager::SetTopVolume: Top volume is PIPPO. Master volume is PIPPO
Info in TGeoManager::CheckGeometry: Fixing runtime shapes…
Info in TGeoManager::CheckGeometry: …Nothing to fix
Info in TGeoManager::CloseGeometry: Counting nodes…
Info in TGeoManager::Voxelize: Voxelizing…
Info in TGeoManager::CloseGeometry: Building cache…
Info in TGeoNavigator::BuildCache: — Maximum geometry depth set to 100
Info in TGeoManager::CloseGeometry: 3593 nodes/ 3433 volume UID’s in Geometry using assemblies
Info in TGeoManager::CloseGeometry: ----------------modeler ready----------------
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
dlopen error: dlopen(/cern/root/lib/libRGL.so, 9): Symbol not found: ___GLXEW_ARB_multisample
Referenced from: /cern/root/lib/libRGL.so
Expected in: flat namespace
in /cern/root/lib/libRGL.so
Load Error: Failed to load Dynamic link library /cern/root/lib/libRGL.so
Error in TCint::AutoLoad: failure loading library libRGL.so for class TGLSAViewer
Error in TPluginHandler::SetupCallEnv: class TGLSAViewer not found in plugin RGL
Warning in TCanvas::TPad::CreateViewer3D: Cannot create 3D viewer of type: ogl

It looks like build system ignored --enable-builtin-glew, it still uses the version from MacPorts.
I do not have a Mac at the moment (and I never used MacPorts).

What is the output of configure script, at the end of the line “Checking whether to build included GLEW”?

I am sorry I forgot last line of configure.log :

.
.
.
Checking whether to build included GLEW
Result: yes
Checking for pkg-config …

Hi,

just try:

./configure

and have a look what configure manages to detect. On my machine I’ve:

Checking for GL/gl.h ... /usr/X11/include
Checking for libGL, or libMesaGL ... /usr/X11R6/lib
Checking for libGLU, or libMesaGLU ... /usr/X11R6/lib
Checking for GL/glew.h ... no
Checking for libGLEW ... no
Checking whether to build included GLEW ... yes
Checking for pkg-config ... /sw/bin/pkg-config
Checking for libftgl ... no
Checking whether to build included libftgl ... yes

Cheers, Fons.

ok but in order to compile root using GL and glew software installed by macport what I have to do ?

I have understand the problem ! If I load the built-in library all is OK :
<Dario.Moricciani@Dario-Moriccianis-MacBook:~> root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.28/00d 7 May 2011 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      [root.cern.ch](http://root.cern.ch)            *
    
  •                                     *
    

ROOT 5.28/00d (tags/v5-28-00d@39145, May 07 2011, 22:11:33 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .L /cern/root/lib/libGLEW.so
root [1] .L /cern/root/lib/libRGL.so

While if I load the macport libglew there is a problem …

ln -s /opt/local/lib/libGLEW.1.6.dylib /cern/root/lib/libGLEW_macport.so

<Dario.Moricciani@Dario-Moriccianis-MacBook:~> root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.28/00d 7 May 2011 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      [root.cern.ch](http://root.cern.ch)            *
    
  •                                     *
    

ROOT 5.28/00d (tags/v5-28-00d@39145, May 07 2011, 22:11:33 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .L /cern/root/lib/libGLEW_macport.so
root [1] .L /cern/root/lib/libRGL.so
dlopen error: dlopen(/cern/root/lib/libRGL.so, 9): Symbol not found: ___GLXEW_ARB_multisample
Referenced from: /cern/root/lib/libRGL.so
Expected in: flat namespace
in /cern/root/lib/libRGL.so
Load Error: Failed to load Dynamic link library /cern/root/lib/libRGL.so

[quote=“moricciani”]I have understand the problem ! If I load the built-in library all is OK :

Load Error: Failed to load Dynamic link library /cern/root/lib/libRGL.so[/quote]

Hello. I’m sorry, I did not answer you before since I hate guessing and do not have working Mac at the moment.
But still, what you have is not a solution. So, today I have to start guessing:
on Mac, do you have to specify something like DYLD_LIBRARY_PATH? What it can be (oh, guessing-shmessing started :frowning: ) is that libglew from MacPort is found before our built-in library is found and you have this problem
(I think, “mac-enabled” collegues will correct me, if I’m wrong).
Can you show what is your DYLD_LIBRARY_PATH?

Still, this does not explain the case you had at the beginning.