- [x] Qt5 components shouldn't be required. They should be optional and build to succeed if the optional components are not found.
- [x] Disabling OpenGL should not break the build.
From: https://gitter.im/MRPT/mrpt
Alex Giokas @alexge233 Oct 05 04:47
Hi Hunter, I'm trying to build a minimal version of MRPT-1.9.9 (from github) without any GUI stuff.
I keep running into the same issue:
-- Architecture (uname -m): x86_64
-- Kernel name (uname -s): Linux
-- Could NOT find OpenGL (missing: OPENGL_INCLUDE_DIR)
-- Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
-- **Warning**: OpenGL and/or GLUT not found! OpenGL capabilities will be disabled.
-- OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so
-- OPENGL_glu_LIBRARY: OPENGL_glu_LIBRARY-NOTFOUND
-- GLUT_glut_LIBRARY: GLUT_glut_LIBRARY-NOTFOUND
-- OPENGL_INCLUDE_DIR: OPENGL_INCLUDE_DIR-NOTFOUND
-- Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS)
wxWidgets was not found automatically. Please, set wxWidgets_ROOT_DIR to the lib directory to enable it in MRPT.
CMake Warning at cmakemodules/script_qt.cmake:10 (find_package):
By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5" with any of
the following names:
Qt5Config.cmake
qt5-config.cmake
Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files. If "Qt5" provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:234 (include)
-- cotire 1.7.9 loaded.
And when I build:
[ 45%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/CGlCanvasBase.cpp.o
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp: In member function ‘void mrpt::gui::CGlCanvasBase::resizeViewport(int, int)’:
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:119:20: error: ‘GLint’ was not declared in this scope
glViewport(0, 0, (GLint)w, (GLint)h);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:119:37: error: ‘glViewport’ was not declared in this scope
glViewport(0, 0, (GLint)w, (GLint)h);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp: In member function ‘void mrpt::gui::CGlCanvasBase::clearColors()’:
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:124:65: error: ‘glClearColor’ was not declared in this scope
glClearColor(clearColorR, clearColorG, clearColorB, clearColorA);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp: In member function ‘virtual double mrpt::gui::CGlCanvasBase::renderCanvas(int, int)’:
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:260:16: error: ‘GL_ALL_ATTRIB_BITS’ was not declared in this scope
glPushAttrib(GL_ALL_ATTRIB_BITS);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:260:34: error: ‘glPushAttrib’ was not declared in this scope
glPushAttrib(GL_ALL_ATTRIB_BITS);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:263:12: error: ‘GL_DEPTH_TEST’ was not declared in this scope
glEnable(GL_DEPTH_TEST);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:263:25: error: ‘glEnable’ was not declared in this scope
glEnable(GL_DEPTH_TEST);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:264:12: error: ‘GL_ALPHA_TEST’ was not declared in this scope
glEnable(GL_ALPHA_TEST);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:265:12: error: ‘GL_TEXTURE_2D’ was not declared in this scope
glEnable(GL_TEXTURE_2D);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:269:19: error: ‘GLsizei’ was not declared in this scope
resizeViewport((GLsizei)width, (GLsizei)height);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:293:17: error: ‘GL_MODELVIEW’ was not declared in this scope
glMatrixMode(GL_MODELVIEW);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:293:29: error: ‘glMatrixMode’ was not declared in this scope
glMatrixMode(GL_MODELVIEW);
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:294:19: error: ‘glLoadIdentity’ was not declared in this scope
glLoadIdentity();
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:307:11: error: ‘glFlush’ was not declared in this scope
glFlush();
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:312:15: error: ‘glPopAttrib’ was not declared in this scope
glPopAttrib();
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:316:15: error: ‘glPopAttrib’ was not declared in this scope
glPopAttrib();
^
/root/mrpt/libs/gui/src/CGlCanvasBase.cpp:325:15: error: ‘glPopAttrib’ was not declared in this scope
glPopAttrib();
Do you have a CMAKE macro/flag to turn OpenGL/GUI off?
Hunter Laux @jolting Oct 05 10:38
Did you try USE_QT=false?
Alex Giokas @alexge233 Oct 06 02:08
I did now. This is weird, Cmake spots no presence of QT, wxWidgets but it still tries to build the GUI library. I've also run into a similar issue: I can compile the library if I install freeglut-dev, but when I build by application which links to mrpt, then I get link errors to assimp.so.4. Where do you default to using gui and opengl, maybe I can hack into it and turn them off.
Alex Giokas @alexge233 Oct 06 02:14
For example, running with -DUSE_QT=false it still tries to build velodyne (which I don't need) which then fails to link to pthread:
[ 87%] Building CXX object tests/CMakeFiles/test_mrpt_hwdrivers.dir/__/libs/hwdrivers/src/CVelodyneScanner_unittest.cpp.o
/usr/bin/ld: CMakeFiles/velodyne-view.dir/velodyne-view_main.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
apps/velodyne-view/CMakeFiles/velodyne-view.dir/build.make:162: recipe for target 'bin/velodyne-view' failed
make[2]: *** [bin/velodyne-view] Error 1
CMakeFiles/Makefile2:2549: recipe for target 'apps/velodyne-view/CMakeFiles/velodyne-view.dir/all' failed
make[1]: *** [apps/velodyne-view/CMakeFiles/velodyne-view.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Just fyi, I am willing to contribute if you point me to the right direction, it's the least I can do
Alex Giokas @alexge233 Oct 06 05:51
This is what I'm trying with right now:
cmake .. -DDISABLE_OPENGL=ON -DDISABLE_LIBUSB=ON -DDISABLE_OPENNI2=ON -DDISABLE_PCAP=ON -DDISABLE_PCL=ON -DDISABLE_PHIDGETS=ON -DDISABLE_PYTHON_BINDINGS=ON -DUSE_QT=OFF -DDISABLE_ROS=ON
Still, I get:
- List of MRPT libs/modules to be built (and dependencies):
-- -----------------------------------------------------------------
-- mrpt-hwdrivers : mrpt-base;mrpt-comms;mrpt-maps;mrpt-obs;mrpt-gui;mrpt-opengl;mrpt-maps;mrpt-vision;mrpt-graphs
-- mrpt-graphs : mrpt-opengl;mrpt-base
-- mrpt-base :
-- mrpt-vision : mrpt-obs;mrpt-opengl;mrpt-base;mrpt-opengl
-- mrpt-tfest : mrpt-base
-- mrpt-comms : mrpt-base
-- mrpt-bayes : mrpt-base (header-only)
-- mrpt-graphslam : mrpt-base;mrpt-graphs;mrpt-gui;mrpt-maps;mrpt-obs;mrpt-opengl;mrpt-slam;mrpt-vision
-- mrpt-detectors : mrpt-vision;mrpt-maps;mrpt-gui;mrpt-slam;mrpt-base;mrpt-opengl;mrpt-obs;mrpt-graphs
-- mrpt-hmtslam : mrpt-slam;mrpt-graphslam;mrpt-graphs;mrpt-vision;mrpt-maps;mrpt-base;mrpt-obs;mrpt-opengl;mrpt-gui
-- mrpt-topography : mrpt-base;mrpt-obs;mrpt-opengl;mrpt-tfest
-- mrpt-opengl : mrpt-base
-- mrpt-slam : mrpt-bayes;mrpt-graphs;mrpt-vision;mrpt-tfest;mrpt-maps;mrpt-obs;mrpt-opengl;mrpt-base
-- mrpt-obs : mrpt-opengl;mrpt-base
-- mrpt-kinematics : mrpt-opengl;mrpt-base
-- mrpt-maps : mrpt-obs;mrpt-graphs;mrpt-opengl;mrpt-base
-- mrpt-gui : mrpt-opengl;mrpt-base
-- mrpt-nav : mrpt-graphs;mrpt-maps;mrpt-kinematics;mrpt-graphs;mrpt-obs;mrpt-opengl;mrpt-base
What I really want is slam, obs, nav, maps and base.
As it builds, it runs into:
Scanning dependencies of target test_mrpt_graphs
[ 48%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/CAboutBoxBase.cpp.o
[ 48%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/CWxGLCanvasBase.cpp.o
[ 50%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/CGlCanvasBase.cpp.o
[ 50%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/CAboutBox_wx.cpp.o
[ 50%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/CDisplayWindowPlots.cpp.o
[ 50%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/WxUtils.cpp.o
[ 50%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/CDisplayWindow.cpp.o
[ 50%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/registerAllClasses.cpp.o
[ 50%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/gui-precomp.cpp.o
[ 50%] Building CXX object libs/gui/CMakeFiles/mrpt-gui.dir/src/CAboutBoxQt.cpp.o
[ 50%] Building CXX object tests/CMakeFiles/test_mrpt_graphs.dir/test_main.cpp.o
[ 50%] Building CXX object tests/CMakeFiles/test_mrpt_graphs.dir/__/libs/graphs/src/ScalarFactorGraph_unittest.cpp.o
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp: In member function ‘void mrpt::gui::CGlCanvasBase::resizeViewport(int, int)’:
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:119:20: error: ‘GLint’ was not declared in this scope
glViewport(0, 0, (GLint)w, (GLint)h);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:119:37: error: ‘glViewport’ was not declared in this scope
glViewport(0, 0, (GLint)w, (GLint)h);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp: In member function ‘void mrpt::gui::CGlCanvasBase::clearColors()’:
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:124:65: error: ‘glClearColor’ was not declared in this scope
glClearColor(clearColorR, clearColorG, clearColorB, clearColorA);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp: In member function ‘virtual double mrpt::gui::CGlCanvasBase::renderCanvas(int, int)’:
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:260:16: error: ‘GL_ALL_ATTRIB_BITS’ was not declared in this scope
glPushAttrib(GL_ALL_ATTRIB_BITS);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:260:34: error: ‘glPushAttrib’ was not declared in this scope
glPushAttrib(GL_ALL_ATTRIB_BITS);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:263:12: error: ‘GL_DEPTH_TEST’ was not declared in this scope
glEnable(GL_DEPTH_TEST);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:263:25: error: ‘glEnable’ was not declared in this scope
glEnable(GL_DEPTH_TEST);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:264:12: error: ‘GL_ALPHA_TEST’ was not declared in this scope
glEnable(GL_ALPHA_TEST);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:265:12: error: ‘GL_TEXTURE_2D’ was not declared in this scope
glEnable(GL_TEXTURE_2D);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:269:19: error: ‘GLsizei’ was not declared in this scope
resizeViewport((GLsizei)width, (GLsizei)height);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:293:17: error: ‘GL_MODELVIEW’ was not declared in this scope
glMatrixMode(GL_MODELVIEW);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:293:29: error: ‘glMatrixMode’ was not declared in this scope
glMatrixMode(GL_MODELVIEW);
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:294:19: error: ‘glLoadIdentity’ was not declared in this scope
glLoadIdentity();
^
/home/zuperath/code/mrpt/libs/gui/src/CGlCanvasBase.cpp:307:11: error: ‘glFlush’ was not declared in this scope
glFlush();
^