[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#602424: elmerfem: More armel qreal trouble

Package: src:elmerfem
Version: 5.5.0.svn.4716.dfsg-3
Severity: important
X-Debbugs-CC: debian-arm@lists.debian.org


Elmer (source elmerfem) is FTBFS on armel because qreal is defined as
float, and the upstream authors have been a bit sloppy about using
doubles when Qt wants a qreal.  Unfortunately, the use of #define
instead of typedef for qreal has enabled this bad behavior.

I'm trying to switch the code base over to qreal, but am running into a
fundamental problem.  Consider in ElmerGUI/Application/src/glwidget.cpp:

void GLWidget::getMatrix()
  glGetDoublev(GL_MODELVIEW_MATRIX, matrix);
  helpers->invertMatrix(matrix, invmatrix);

On the other hand, in helpers.cpp (same directory):

void Helpers::invertMatrix(const qreal *a, qreal *inva)
  QMatrix4x4 matrix(a);

  bool ok(true);

  QMatrix4x4 inverse(matrix.transposed().inverted(&ok));

  if(!ok) fprintf(stderr, "Error: Singular 4x4 matrix\n");

  for(int i = 0; i < 16; ++i)
    inva[i] = double(inverse.data()[i]);

Originally the arguments to invertMatrix were doubles, and I changed
them to qreals for compatibility with QMatrix4x4.  But when I do that,
then it becomes incompatible with glGetDoublev() which, as its name
implies, "returns" (or rather, fills) a 4x4 matrix of doubles.  This is
one of several similar issues.

I assume that because Qt and OpenGL are commonly used together, that
this is a common frustration of ARM porters.  As a community of such
people, do you have any tips or recommendations for someone trying like
myself to make such a package build on your platform?


[Please CC me in replies]
GPG fingerprint: D54D 1AEE B11C CE9B A02B  C5DD 526F 01E8 564E E4B6

Engineering consulting with open source tools

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: