Bug#838733: [Debichem-devel] Bug#838733: experimental version of avogadro FTBFS on armel and armhf

2016-09-25 Thread Michael Banck
Hi Peter,

On Sun, Sep 25, 2016 at 12:30:02AM +0100, peter green wrote:
> I got it to build,  debdiff attatched, no intent to NMU.

Thanks, I've uploaded it.


Michael



Bug#838733: [Debichem-devel] Bug#838733: experimental version of avogadro FTBFS on armel and armhf

2016-09-24 Thread peter green

Tags 838733 +patch
thanks

On 24/09/16 23:19, Michael Banck wrote:

So it seems the fix is simply to replace Eigen::Vector3d with Eigen::Matrix<
qreal , 3 , 1>. I've just set off a test build with that change, will report
results in the morning.
 

Let us know how it goes.
   

I got it to build,  debdiff attatched, no intent to NMU.


diff -Nru avogadro-1.1.1/debian/changelog avogadro-1.1.1/debian/changelog
--- avogadro-1.1.1/debian/changelog 2016-08-04 17:06:58.0 +
+++ avogadro-1.1.1/debian/changelog 2016-09-24 02:16:01.0 +
@@ -1,3 +1,10 @@
+avogadro (1.1.1-1~exp3.2) UNRELEASED; urgency=medium
+
+  * Patch for BTS, no intent to NMU
+  * Fix qreal VS double issue.
+
+ -- Peter Michael Green   Sat, 24 Sep 2016 02:16:01 +
+
 avogadro (1.1.1-1~exp3.1) experimental; urgency=medium
 
   * Non-maintainer upload.
diff -Nru avogadro-1.1.1/debian/patches/fix-qreal-vs-double.patch 
avogadro-1.1.1/debian/patches/fix-qreal-vs-double.patch
--- avogadro-1.1.1/debian/patches/fix-qreal-vs-double.patch 1970-01-01 
00:00:00.0 +
+++ avogadro-1.1.1/debian/patches/fix-qreal-vs-double.patch 2016-09-24 
02:16:01.0 +
@@ -0,0 +1,95 @@
+Description: Fix qreal VS double issue.
+ Vector3d is an alias for Eigen::Matrix< double , 3 , 1> but electronDensity 
+ expects Eigen::Matrix< qreal , 3 , 1> therefore the code broke on arm
+ platforms where qreal is defined (in qt4) as float. This patch changes the
+ code to construct the correct type.
+Author: Peter Michael Green 
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: , 
+Bug: 
+Bug-Debian: https://bugs.debian.org/
+Bug-Ubuntu: https://launchpad.net/bugs/
+Forwarded: 
+Reviewed-By: 
+Last-Update: 2016-09-24
+
+Index: avogadro-1.1.1/libavogadro/src/extensions/qtaim/qtaimcubature.cpp
+===
+--- avogadro-1.1.1.orig/libavogadro/src/extensions/qtaim/qtaimcubature.cpp
 avogadro-1.1.1/libavogadro/src/extensions/qtaim/qtaimcubature.cpp
+@@ -1189,7 +1189,7 @@ QList QTAIMEvaluateProperty(QL
+ 
+   QList valueList;
+ 
+-  double initialElectronDensity=eval.electronDensity( 
Eigen::Vector3d(x0,y0,z0) );
++  double initialElectronDensity=eval.electronDensity( Eigen::Matrix< qreal , 
3 , 1>(x0,y0,z0) );
+ 
+   // if less than some small value, then return zero for all integrands.
+   if( initialElectronDensity < 1.e-5 )
+@@ -1254,7 +1254,7 @@ QList QTAIMEvaluateProperty(QL
+   {
+ if( modeList.at(m) == 0 )
+ {
+-  valueList.append(eval.electronDensity( Eigen::Vector3d(x0,y0,z0) ));
++  valueList.append(eval.electronDensity( Eigen::Matrix< qreal , 3 , 
1>(x0,y0,z0) ));
+ }
+ else
+ {
+@@ -1472,7 +1472,7 @@ QList QTAIMEvaluatePropertyRTP
+ 
+   QList valueList;
+ 
+-  double initialElectronDensity=eval.electronDensity( 
Eigen::Vector3d(x0,y0,z0) );
++  double initialElectronDensity=eval.electronDensity( Eigen::Matrix< qreal , 
3 , 1>(x0,y0,z0) );
+ 
+   // if less than some small value, then return zero for all integrands.
+   if( initialElectronDensity < 1.e-5 )
+@@ -1540,7 +1540,7 @@ QList QTAIMEvaluatePropertyRTP
+ {
+   valueList.append(
+ 
+-  r0*r0*sin(t0)*eval.electronDensity( Eigen::Vector3d(x0,y0,z0) )
++  r0*r0*sin(t0)*eval.electronDensity( Eigen::Matrix< qreal , 3 , 
1>(x0,y0,z0) )
+ 
+   );
+ }
+@@ -1738,7 +1738,7 @@ void property_r(unsigned int ndim, const
+   {
+ if( mode==0 )
+ {
+-  fval[m]=r*r*eval.electronDensity( Eigen::Vector3d(x,y,z) );
++  fval[m]=r*r*eval.electronDensity( Eigen::Matrix< qreal , 3 , 1>(x,y,z) 
);
+ }
+   }
+ 
+@@ -1846,7 +1846,7 @@ QList QTAIMEvaluatePropertyTP(
+   qreal x=xyzl(0);
+   qreal y=xyzl(1);
+   qreal z=xyzl(2);
+-  qreal leftElectronDensity=eval.electronDensity( Eigen::Vector3d(x,y,z) );
++  qreal leftElectronDensity=eval.electronDensity( Eigen::Matrix< qreal , 3 , 
1>(x,y,z) );
+ 
+   if( leftElectronDensity < 1.e-5 )
+   {
+@@ -1896,7 +1896,7 @@ QList QTAIMEvaluatePropertyTP(
+   x=xyzr(0);
+   y=xyzr(1);
+   z=xyzr(2);
+-  qreal rightElectronDensity=eval.electronDensity( Eigen::Vector3d(x,y,z) );
++  qreal rightElectronDensity=eval.electronDensity( Eigen::Matrix< qreal , 3 , 
1>(x,y,z) );
+ 
+   if( rightElectronDensity < 1.e-5 )
+   {
+@@ -1959,7 +1959,7 @@ QList QTAIMEvaluatePropertyTP(
+ x=xyzm(0);
+ y=xyzm(1);
+ z=xyzm(2);
+-qreal midpointElectronDensity=eval.electronDensity( 
Eigen::Vector3d(x,y,z) );
++qreal midpointElectronDensity=eval.electronDensity( Eigen::Matrix< qreal 
, 3 , 1>(x,y,z) );
+ 
+ if( midpointElectronDensity < 1.e-5 )
+ {

Bug#838733: [Debichem-devel] Bug#838733: experimental version of avogadro FTBFS on armel and armhf

2016-09-24 Thread Michael Banck
Hi Peter,

On Sat, Sep 24, 2016 at 03:19:53AM +0100, peter green wrote:
> package: avogadro
> version: 1.1.1-1~exp3.1
> severity: serious
> X-Debbugs-CC: po...@debian.org, gl...@debian.org, gin...@debian.org,
> mba...@debian.org
> 
> While discussing possible soloutions to bug 833770 Graham Inggs sugested
> >What about uploading version 1.1.1 from experimental to unstable?
> 
> Emilio Pozuelo Monfort pointed out.
> >Note that the experimental version fails to build on armel/armhf (at least).
> 
> I decided to take a look at this.

Thank you for working on it.

The current work-around towards 1.2.0 is disabling the QTAIM extension,
but that would be a shame.

> It appears that Eigen::Vector3d produces a Matrix but
> electronDensity expects a Matrix
> 
> On most architectures qreal is defined as double, so this works but on arm32
> architectures qreal
>  is defined as float so it breaks
> 
> The first thing I tried was changing stuff from qreal to double to make it
> match but that led down a massive rabbit hole.
> 
> So I then took a closer look at what Eigen::Vector3d was. Turns out it's a
> typedef for Eigen::Matrix< double , 3 , 1>
> 
> So it seems the fix is simply to replace Eigen::Vector3d with Eigen::Matrix<
> qreal , 3 , 1>. I've just set off a test build with that change, will report
> results in the morning.

Let us know how it goes.

Also, there'a pull request for 1.2.0 adapting the current Eigen3 patch
which discusses some related problems.  I guess this needs some GUI
testing once it comiles...

The PR is here: https://github.com/cryos/avogadro/pull/38


Michael