Cross Compiling GCS
#1
Posted 22 May 2011 - 04:51 AM
This thread is to capture ideas/issues on cross compiling and not general discussion of hardware,platforms etc
Some general notes;
- Cross compile is done from the openpilotgcs.pro and not ground.pro. The reason is that uavobjectgenerator needs to be compiled on the host, ie not cross compiled, as it is used/run on the host PC to process the uavobject xml files.
notes copied from other thread on the first effort at doing a cross compile;
1/ Open GL had to be excluded from the compile. Embedded systems typically use Open GL ES so we should really make OpenGL a compile time option and not just selectable on the config page of the built software.
2/ GLC lib is excluded as it uses OpenGL and hence no Model view plugin.
3/ GCS control is excluded. Some compile error library issues with SDL gamepad, still need to be sorted out.
4/ rawHID was an issue as rawHID.pro had some code that looked for linux-g++. When cross compiling some sources and lib were missed, perhaps this needs to be changed to linux-*. I edited the code to force inclusion for cross compile.
also...
5/Notify plugin excluded at this stage...some more work needed on this to get the drivers sorted.
So if anyone has any ideas,concerns,issues specific to cross compiling please add your comments....please keep this thread for cross compiling and not general discussion of hardware,platforms etc.
Regards Phil
#2
Posted 22 May 2011 - 05:27 AM
To comment on your specific issues:
is there a cross-compatible way to write OpenGL/OpenGL ES. Will we just have to disable OpenGL on cross platform versions or can we make it work?1/ Open GL had to be excluded from the compile. Embedded systems typically use Open GL ES so we should really make OpenGL a compile time option and not just selectable on the config page of the built software.
2) Patch to make this an easy compile time option (not sure good way to do on QT)GLC lib is excluded as it uses OpenGL and hence no Model view plugin.
If you want to try this switch out or post a patch we can see how it affects linux.4/ rawHID was an issue as rawHID.pro had some code that looked for linux-g++. When cross compiling some sources and lib were missed, perhaps this needs to be changed to linux-*. I edited the code to force inclusion for cross compile.
Does phonon work on embedded systems?5/Notify plugin excluded at this stage...some more work needed on this to get the drivers sorted.
P.s. if you look like git access to work on this in a branch, PM corvuscorvax with you ssh public key.
#3
Posted 22 May 2011 - 10:38 AM
/media/Projects/GLC_lib$ GLexamine
./glc_lib/geometry/glc_line.cpp:92: glBegin(GL_LINES);
./glc_lib/geometry/glc_point.cpp:108: glBegin(GL_POINTS);
./glc_lib/geometry/glc_pointsprite.cpp:110: glPushAttrib(GL_ALL_ATTRIB_BITS);
./glc_lib/geometry/glc_pointsprite.cpp:188: glBegin(GL_POINTS);
./glc_lib/sceneGraph/glc_3dviewinstance.cpp:312: glColor3ubv(m_colorId); // D'ont use Alpha component
./glc_lib/sceneGraph/glc_3dviewinstance.cpp:383: glColor3ubv(colorId);
./glc_lib/viewport/glc_imageplane.cpp:74: glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
./glc_lib/viewport/glc_imageplane.cpp:75: glBegin(GL_QUADS);
./glc_lib/viewport/glc_repcrossmover.cpp:89: glColor4d(m_MainColor.redF(), m_MainColor.greenF(), m_MainColor.blueF(), m_MainColor.alphaF());
./glc_lib/viewport/glc_repcrossmover.cpp:93: glBegin(GL_LINES);
./glc_lib/viewport/glc_viewport.cpp:117: glClearDepth(1.0f); // Depth Buffer Setup
2) rawHID.pro ... I can test this on my system. Should not be an issue, ie using linux-* instead of linux-g++
3/Notify, phonon Yes there is phonon, I just have not spent the time yet to sort that part out.
Note that when I excluded OpenGL from the build I also commented out calls to QGLWidget used in plugins when opengl is selected. Here is a list of the edits that I did to get it to compile, (PWedit is my marker), note the first one is the addition of the cross compiled qt libraries;
/ground/openpilotgcs/openpilotgcs.pri:# PWedit INCLUDEPATH to ARM qt and GL libraries at /opt/qt-arm/include
/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h://PWedit #include <QtOpenGL/QGLWidget>
/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/mapwidget.pro:#PWedit QT += opengl
/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp://PWedit setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
/ground/openpilotgcs/src/plugins/dial/dialgadgetwidget.cpp://PWedit #include <QtOpenGL/QGLWidget>
/ground/openpilotgcs/src/plugins/dial/dialgadgetwidget.cpp://PWedit setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
/ground/openpilotgcs/src/plugins/dial/dial.pro:#PWedit QT += opengl
/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetwidget.cpp://PWedit #include <QtOpenGL/QGLWidget>
/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetwidget.cpp://PWedit m_widget->graphicsView_Spectrum->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
/ground/openpilotgcs/src/plugins/pipxtreme/pipxtreme.pro:#PWedit QT += opengl
2/ground/openpilotgcs/src/plugins/rawhid/rawhid.pro:#PWedit for linux cross compile ie non linux-g++ sources and libs
/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetwidget.cpp://PWedit #include <QtOpenGL/QGLWidget>
/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetwidget.cpp://PWedit setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
/ground/openpilotgcs/src/plugins/lineardial/lineardial.pro:#PWedit QT += opengl
/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrol.pro:#PWedit QT += opengl
/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.h://PWedit #include "sdlgamepad/sdlgamepad.h"
/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp://PWedit #include <QtOpenGL/QGLWidget>
/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp://PWedit setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
/ground/openpilotgcs/src/plugins/pfd/pfd.pro:#PWedit QT += opengl
/ground/openpilotgcs/src/plugins/pfd/pfdgadgetwidget.cpp://PWedit #include <QtOpenGL/QGLWidget>
/ground/openpilotgcs/src/plugins/pfd/pfdgadgetwidget.cpp://PWedit setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
yes I have had git access setup. Thanks Phil
Edited by phil_w, 22 May 2011 - 11:02 AM.
#4
Posted 22 May 2011 - 06:31 PM
#5
Posted 23 May 2011 - 01:17 AM
Here is the guide that I used;
http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html
I used qt everywhere 4.6.3.
For gcs cross compile i did not use qt creator because I have found it hard to keep track of what it was using/doing. QT creator has some catches, eg it sometimes switches back to default build directory without you knowing, after you change a setting, it can also be hard to keep track of which mkspec it is using. Very annoying. So I just use qmake on the command line. I still use qt creator as editor but do build on command line.
Some warning, it may just be me, but setting this up takes a lot of time and fiddling!
There are already plans to move OpenGL to be a global option. But I have no experience with using Qt for cross-compiling. I will have to look into how to do this.
Edited by phil_w, 23 May 2011 - 01:18 AM.
#6
Posted 24 May 2011 - 06:33 PM
http://doc.qt.nokia....t/qtopengl.html
http://doc.qt.nokia....nux-opengl.html
#7
Posted 25 May 2011 - 01:36 AM
http://www.khronos.org/opengles/
http://doc.qt.nokia.com/latest/opengl-hellogl-es.html
After looking at Qt docs I don't see why QtOpenGL shouldn't work with OpenGL ES.
http://doc.qt.nokia....t/qtopengl.html
http://doc.qt.nokia....nux-opengl.html



Australia
United States
Portugal