Feature request #11148

Supporting arm architectures in Debian - FTBFS on armel and armhf due to Qreal issue

Added by Ross Gammon about 10 years ago. Updated about 7 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Unknown
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:19475

Description

The Debian GIS team are working to support the various ARM architectures in Debian. Earlier in the year, a pull request was merged for issue: #9917.

Unfortunately, with the newer QGIS v2.4.0 a similar problem is occurring that causes QGIS to fail to build on armel & armhf machines: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760535.

Extract of build log (see Debian Bug for more):

/usr/include/qt4/QtCore/qglobal.h:1219:34: note: template<class T> const
T& qMax(const T&, const T&)
Q_DECL_CONSTEXPR inline const T &qMax(const T &a, const T &b) { return
(a < b) ? b : a; }
^
/usr/include/qt4/QtCore/qglobal.h:1219:34: note: template argument
deduction/substitution failed:
/«PKGBUILDDIR»/src/gui/qgscomposerview.cpp:872:189: note: deduced
conflicting types for parameter 'const T' ('float' and 'double')
newTable->setSceneRect( QRectF(
mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(),
mRubberBandItem->rect().width(), qMax( mRubberBandItem->rect().height(),
15.0 ) ) );

Peter Green investigated this and found (please read his detailed analysis in the Debian Bug):
In this case qMax is a template. The result is it will work with
arguments of any numeric type but the two arguments must be the same
type. The literal 12.0 is type double. So on a platform where qreal is
float qMax gets passed one float and one double and the compiler can't
decide which to use for the template parameter and errors out. Easy
enough to fix by casting the literal to qreal.

Unfortunately, the next problem Peter found was with the .sip file. After changing this file in a few places the build went further and then failed with:
/qgis-2.4.0/obj-arm-linux-gnueabihf/python/core/sip_corepart2.cpp:12735:67:
error: no matching function for call to 'QVector<float>::QVector(const
QVector<double>&)'
sipRaiseUnknownException();

To try and fix, Peter decided to try outright changing the type to qreal. It
looks like the API in question is totally new in 2.4 so this shouldn't
break too much third party stuff. But there were some knockon impacts within
the qgis source.

Peter's patch is attached, but because he is not sure if there are further matching changes required in the QGIS code, or whether there is a better way to fix it, we will not apply the patch in Debian without checking here first.

qgis.debdiff (5.94 KB) Ross Gammon, 2014-09-05 09:21 AM

History

#1 Updated by Paolo Cavallini about 10 years ago

Could you please rework this as a pull req? This will make it much more visible, and easier to merge.
Thanks a lot.

#2 Updated by Ross Gammon about 10 years ago

No problems!
https://github.com/qgis/QGIS/pull/1577

#3 Updated by Matthias Kuhn about 10 years ago

Hi Ross,

ARM fixes are highly welcome as they are required for android as well. The pull request looks fine for me, I can not think of any bad side-effects it could have (in realistic scenarios). I would not hesitate to merge it in Debian and I think it will be merged soon back to QGIS.

Thank you very much for providing this.

#4 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No

#5 Updated by Jürgen Fischer about 7 years ago

  • Category set to Unknown

Also available in: Atom PDF