[vtkusers] Building VTK 6.3.0 with X11 on Mac El Capitan

James Overly joverly at cfa.harvard.edu
Tue Aug 23 18:17:40 EDT 2016


Hi all -

I am trying to build on osx El Capitain (I get the same error on osx
Mavericks as well).

[ 98%] Building CXX object
Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/vtkCoreGraphicsGPUInfoList.cxx.o
Linking CXX shared library ../../lib/libvtkRenderingOpenGL-6.3.dylib
Undefined symbols for architecture x86_64:
  "_glXChooseVisual", referenced from:
      vtkXOpenGLRenderWindowTryForVisual(_XDisplay*, int, int, int, int,
int) in vtkXOpenGLRenderWindow.cxx.o
  "_glXCreateContext", referenced from:
      vtkXOpenGLRenderWindow::CreateAWindow() in
vtkXOpenGLRenderWindow.cxx.o
      vtkXOpenGLRenderWindow::CreateOffScreenWindow(int, int) in
vtkXOpenGLRenderWindow.cxx.o
  "_glXCreateGLXPixmap", referenced from:
      vtkXOpenGLRenderWindow::CreateOffScreenWindow(int, int) in
vtkXOpenGLRenderWindow.cxx.o
  "_glXDestroyContext", referenced from:
      vtkXOpenGLRenderWindow::DestroyWindow() in
vtkXOpenGLRenderWindow.cxx.o
      vtkXOpenGLRenderWindow::CreateOffScreenWindow(int, int) in
vtkXOpenGLRenderWindow.cxx.o
      vtkXOpenGLRenderWindow::DestroyOffScreenWindow() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXDestroyGLXPixmap", referenced from:
      vtkXOpenGLRenderWindow::DestroyOffScreenWindow() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXGetClientString", referenced from:
      vtkXOpenGLRenderWindow::ReportCapabilities() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXGetConfig", referenced from:
      vtkXOpenGLRenderWindow::SupportsOpenGL() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXGetCurrentContext", referenced from:
      vtkXOpenGLRenderWindow::InitializeFromCurrentContext() in
vtkXOpenGLRenderWindow.cxx.o
      vtkXOpenGLRenderWindow::MakeCurrent() in
vtkXOpenGLRenderWindow.cxx.o
      vtkXOpenGLRenderWindow::IsCurrent() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXGetCurrentDisplay", referenced from:
      vtkXOpenGLRenderWindow::InitializeFromCurrentContext() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXGetCurrentDrawable", referenced from:
      vtkXOpenGLRenderWindow::InitializeFromCurrentContext() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXIsDirect", referenced from:
      vtkXOpenGLRenderWindow::IsDirect() in vtkXOpenGLRenderWindow.cxx.o
  "_glXMakeCurrent", referenced from:
      vtkXOpenGLRenderWindow::CreateOffScreenWindow(int, int) in
vtkXOpenGLRenderWindow.cxx.o
      vtkXOpenGLRenderWindow::MakeCurrent() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXQueryExtension", referenced from:
      vtkOpenGLExtensionManager::ReadOpenGLExtensions() in
vtkOpenGLExtensionManager.cxx.o
      vtkXOpenGLRenderWindow::CreateAWindow() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXQueryExtensionsString", referenced from:
      vtkXOpenGLRenderWindow::ReportCapabilities() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXQueryServerString", referenced from:
      vtkXOpenGLRenderWindow::ReportCapabilities() in
vtkXOpenGLRenderWindow.cxx.o
  "_glXQueryVersion", referenced from:
      vtkXOpenGLRenderWindow::CreateOffScreenWindow(int, int) in
vtkXOpenGLRenderWindow.cxx.o
  "_glXSwapBuffers", referenced from:
      vtkXOpenGLRenderWindow::Frame() in vtkXOpenGLRenderWindow.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make[2]: *** [lib/libvtkRenderingOpenGL-6.3.1.dylib] Error 1
make[1]: *** [Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/all]
Error 2

Using cmake I am passing the following switches:

${BUILD_DIR}/../cmake-3.2.1/bin/cmake -DBUILD_SHARED_LIBS:BOOL=ON
   -DCMAKE_OSX_ARCHITECTURES:STRING="x86_64" \
   -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="" \
   -DCMAKE_BUILD_TYPE:STRING=RELEASE \
   -DCMAKE_INSTALL_PREFIX:STRING=${INSTALL_DIR} \
   -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ \
   -DCMAKE_C_COMPILER:STRING=/usr/bin/gcc -DVTK_USE_X:BOOL=ON \
   -DVTK_USE_RPATH:BOOL=OFF -DVTK_USE_GL2PS:BOOL=ON \
   -DBUILD_TESTING:BOOL=ON -DVTK_USE_CARBON:BOOL=OFF \
   -DVTK_USE_COCOA:BOOL=OFF \
   -DCMAKE_C_FLAGS:STRING="-DFTGL_USE_NAMESPACE" \
   -DCMAKE_CXX_FLAGS:STRING="-DFTGL_USE_NAMESPACE" \
   -DVTK_Group_Rendering:BOOL=OFF \
   -DVTK_RENDERING_BACKEND:STRING="OpenGL"

Any help or suggestions would be much appreciated. 

Thanks

Jim Overly



More information about the vtkusers mailing list