Compile vrep from source without GUI but with openGL

Typically: "How do I... ", "How can I... " questions
Post Reply
Fanley
Posts: 3
Joined: 02 May 2017, 06:48

Compile vrep from source without GUI but with openGL

Post by Fanley »

I am trying to set up VREP3.3.2 on HPC (computer clusters without monitor). By compiling from source using the makefile_noGui_noGl, everything works fine on HPC except the vision sensor. I can only use POV_RAY for image rendering, which is very slow. Hereby, I want to enable openGL for image rendering.

To do so, I tried to compile the VREP source using v_rep.pro (qmake with Qt5.5.0, use -qt-xcb). The compilation was successful, but when I ran the command ./vrep.sh -h -s -q myScene.ttt, I met the error:
QXcbConnection: Could not connect to display
.

Then I tried to compile with the line CONFIG += WITH_GUI commented, but met the following errors: (qmake with Qt5.5.0, use -qt-xcb)
g++ -c -pipe -O3 -Wall -Wno-unused-parameter -Wno-strict-aliasing -Wno-empty-body -Wno-write-strings -Wno-unused-but-set-variable -Wno-unused-local-typedefs -Wno-narrowing -O2 -Wall -W -D_REENTRANT -fPIC -DSIM_WITH_OPENGL -DSIM_WITH_SERIAL -DQT_VREP_64BIT -DQT55 -DLIN_VREP -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -I. -I/pkg/suse12/software/boost/1.61.0-foss-2016a -I../../lua-5.1.5/include -IsourceCode -IsourceCode/inverseKinematics/geomConstraintSolver -IsourceCode/inverseKinematics/ik -IsourceCode/shared/sharedBufferFunctions -IsourceCode/communication -IsourceCode/communication/tubes -IsourceCode/communication/wireless -IsourceCode/drawingObjects -IsourceCode/platform -IsourceCode/collections -IsourceCode/collisions -IsourceCode/distances -IsourceCode/pathPlanning_old -IsourceCode/motionPlanning_old -IsourceCode/3dObjects -IsourceCode/3dObjects/related -IsourceCode/3dObjects/graphObjectRelated -IsourceCode/3dObjects/millObjectRelated -IsourceCode/3dObjects/pathObjectRelated -IsourceCode/3dObjects/proximitySensorObjectRelated -IsourceCode/3dObjects/shapeObjectRelated -IsourceCode/3dObjects/visionSensorObjectRelated -IsourceCode/mainContainers -IsourceCode/mainContainers/sceneContainers -IsourceCode/mainContainers/applicationContainers -IsourceCode/luaScripting -IsourceCode/luaScripting/customLuaFuncAndVar -IsourceCode/pagesAndViews -IsourceCode/importExport -IsourceCode/textures -IsourceCode/serialization -IsourceCode/strings -IsourceCode/interfaces -IsourceCode/interfaces/interfaceStack -IsourceCode/menusAndSimilar -IsourceCode/variousFunctions -IsourceCode/geometricAlgorithms -IsourceCode/various -IsourceCode/libsAndPlugins -IsourceCode/visual -IsourceCode/utils -IsourceCode/sharedBufferFunctions -IsourceCode/backwardCompatibility -IsourceCode/backwardCompatibility/pathPlanning -IsourceCode/backwardCompatibility/motionPlanning -IsourceCode/customUserInterfaces -IsourceCode/undoRedo -IsourceCode/rendering -IsourceCode/communication/serialPort -I../programming/include -I../programming/v_repMath -I../../Qt5.5/include -I../../Qt5.5/include/QtPrintSupport -I../../Qt5.5/include/QtOpenGL -I../../Qt5.5/include/QtWidgets -I../../Qt5.5/include/QtGui -I../../Qt5.5/include/QtSerialPort -I../../Qt5.5/include/QtCore -I. -I../../Qt5.5/mkspecs/linux-g++ -o pageContainer.o sourceCode/pagesAndViews/pageContainer.cpp
sourceCode/pagesAndViews/pageContainer.cpp: In member function 'void CPageContainer::renderCurrentPage(bool)':
sourceCode/pagesAndViews/pageContainer.cpp:353:27: error: 'class CSPage' has no member named 'clearAllMouseJustWentDownAndUpFlags'
_allPages->clearAllMouseJustWentDownAndUpFlags();
^
sourceCode/pagesAndViews/pageContainer.cpp:360:28: error: 'mainWindow' is not a member of 'App'
if ((!hideWatermark)&&(App::mainWindow!=NULL)&&(!App::mainWindow->simulationRecorder->getIsRecording()))
^
sourceCode/pagesAndViews/pageContainer.cpp:360:54: error: 'mainWindow' is not a member of 'App'
if ((!hideWatermark)&&(App::mainWindow!=NULL)&&(!App::mainWindow->simulationRecorder->getIsRecording()))
^
Makefile:30271: recipe for target 'pageContainer.o' failed
make: *** [pageContainer.o] Error 1


I roughly went through the VREP source code, I think this failed compilation might be caused by the incomplete support for the compilation without Gui. Any suggestions? Could you please provide a makefile for no Gui but with open GL?

Thanks in advance!

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Compile vrep from source without GUI but with openGL

Post by coppelia »

Hello,

as it is right now, you cannot compile V-REP without GUI but with OpenGl unfortunately. This is because the whole graphics parts will eventually be rewritten as a plugin for more flexibility.

What can be done in the mean time is, as you mention it, use the POV-Ray plugin, which is very slow, since it is a ray-tracing rendering.

The other option, which would require a little bit of work, would be to slightly modify the externalRenderer plugin for V-REP, located in programming/v_repExtExternalRenderer: this plugin is actually very similar to the POV-Ray plugin, but it relies on OpenGl. Currently that plugin uses Qt GUI elements, but that can be removed from the code. Not sure about that, but the offscreen classes might also have to be adjusted.

Cheers

Fanley
Posts: 3
Joined: 02 May 2017, 06:48

Re: Compile vrep from source without GUI but with openGL

Post by Fanley »

Thanks! I tried to compile the v_repExtEternalRenderer, but met the following problems:
QObject::connect: Cannot connect (null)::destroyed(QObject*) to QOffscreenSurface::screenDestroyed(QObject*)
.

As analyzed from your reply, this is relevant to GUI elements and offscreen classes. Any detailed guidelines on how to modify the code to make the v_repExtEternalRenderer work on computer clusters without display device?

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Compile vrep from source without GUI but with openGL

Post by coppelia »

I don't think the error message is linked to the fact that your computer doesn't have a display device: as far as I remember, QOffscreenSurface should also be usable when there is no display device present. At least on some platforms.

Cheers

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Compile vrep from source without GUI but with openGL

Post by coppelia »

This might also be useful information.

Cheers

faneda
Posts: 2
Joined: 23 Apr 2020, 16:58

Re: Compile vrep from source without GUI but with openGL

Post by faneda »

Hi,

Is there any precise information about what has to be changed in the v_repExtEternalRenderer in order to remove the Qt-GUI dependences?

Did you manage to solve the issue Fanley?

Thanks

Post Reply