Package: qgis
Version: 2.4.0-1~exp1
Severity: important
X-debbugs-cc: rossgam...@mail.dk
Ross Gammon wrote:
Hi Peter,
I am working in the Debian GIS Team and I am hoping you can help me with
a build failure on arm*:
^
(without having any detailed knowledge of the issue)
The issue is that on arm platforms with qt4 qreal is defined as float
rather than double. You can safely assign between qreal and double
because you can safely assign between float and double but more complex
cases involving templates or pointers can give problems.
Since there is a lot of analysis in this message i'm turning this into a
bug report so it doesn't get lost.
/«PKGBUILDDIR»/src/gui/qgscomposerview.cpp: In member function 'virtual
void QgsComposerView::mouseReleaseEvent(QMouseEvent*)':
/«PKGBUILDDIR»/src/gui/qgscomposerview.cpp:872:189: error: no matching
function for call to 'qMax(qreal, double)'
newTable->setSceneRect( QRectF(
mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(),
mRubberBandItem->rect().width(), qMax( mRubberBandItem->rect().height(),
15.0 ) ) );
^
/«PKGBUILDDIR»/src/gui/qgscomposerview.cpp:872:189: note: candidate is:
In file included from /usr/include/qt4/QtCore/qnamespace.h:45:0,
from /usr/include/qt4/QtCore/qobjectdefs.h:45,
from /usr/include/qt4/QtCore/qobject.h:47,
from /usr/include/qt4/QtCore/qcoreapplication.h:45,
from /usr/include/qt4/QtGui/qapplication.h:45,
from /usr/include/qt4/QtGui/QApplication:1,
from /«PKGBUILDDIR»/src/gui/qgscomposerview.cpp:18:
/usr/include/qt4/QtCore/qglobal.h:1219:34: note: template 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 ) ) );
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 after fixing that the buidl fails later with
[ 94%] Generating analysis/sip_analysispart0.cpp,
analysis/sip_analysispart1.cpp, analysis/sip_analysispart2.cpp,
analysis/sip_analysispart3.cpp
cd /qgis-2.4.0/obj-arm-linux-gnueabihf/python && /usr/bin/cmake -E echo
cd /qgis-2.4.0/obj-arm-linux-gnueabihf/python && /usr/bin/cmake -E touch
/qgis-2.4.0/obj-arm-linux-gnueabihf/python/analysis/sip_analysispart0.cpp
/qgis-2.4.0/obj-arm-linux-gnueabihf/python/analysis/sip_analysispart1.cpp
/qgis-2.4.0/obj-arm-linux-gnueabihf/python/analysis/sip_analysispart2.cpp
/qgis-2.4.0/obj-arm-linux-gnueabihf/python/analysis/sip_analysispart3.cpp
cd /qgis-2.4.0/obj-arm-linux-gnueabihf/python && /usr/bin/sip -w -e -x
ANDROID -x HAVE_TOUCH -x MOBILITY_LOCATION -x QSETINT_CONVERSION -x
QSETTYPE_CONVERSION -x VendorID -t WS_X11 -x PyQt_NoPrintRangeBug -x
PyQt_qreal_double -t Qt_4_8_6 -x Py_v3 -g -o -a
/qgis-2.4.0/obj-arm-linux-gnueabihf/python/qgis.analysis.api -j 4 -c
/qgis-2.4.0/obj-arm-linux-gnueabihf/python/analysis -I
/usr/share/sip/PyQt4 -I /qgis-2.4.0/python
/qgis-2.4.0/python/analysis/analysis.sip
sip: /qgis-2.4.0/python/core/composer/qgsatlascomposition.sip:165:
QgsAtlasComposition::predefinedScales() unsupported function return type
- provide %MethodCode and a C++ signature
python/CMakeFiles/python_module_qgis__analysis.dir/build.make:305:
recipe for target 'python/analysis/sip_analysispart0.cpp' failed
make[4]: *** [python/analysis/sip_analysispart0.cpp] Error 1
make[4]: Leaving directory '/qgis-2.4.0/obj-arm-linux-gnueabihf'
CMakeFiles/Makefile2:3415: recipe for target
'python/CMakeFiles/python_module_qgis__analysis.dir/all' failed
make[3]: *** [python/CMakeFiles/python_module_qgis__analysis.dir/all]
Error 2
I changed double to qreal in the .sip file in a couple of places and
that made the file build but I wasn't sure if it was a correct fix or
not. In particular I wasn't sure if there is some corresponding peice
of native code that needs to be changed to match.
Then it 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::QVector(const
QVector&)'
sipRaiseUnknownE