Building Gama 1.12 fails

Brandon Invergo <[email protected]> Tue, 04 Sep 2012 00:19:59 +0200
Newsgroups gmane.comp.gnu.gama.bugs
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain

Hello,
I'm the maintainer of the GNU Source Release Collection (GSRC) and I ran
into many problems getting Gama to build properly using gcc 4.7.1. The
errors seem to mainly be related to namespace issues (though my C++
skills are pretty rusty, so I may be a bit wrong). As an example error:

      ./matvec/vec.h:76:35: error: 'sub' was not declared in this scope,
      and no declarations were found by argument-dependent lookup at the
      point of instantiation [-fpermissive]
      ./matvec/vec.h:76:35: note: declarations in dependent base
      'GNU_gama::MatVecBase<double, GNU_gama::Exception::matvec>' are not
      found by unquali fied lookup
      ./matvec/vec.h:76:35: note: use 'this->sub' instead

Unfortunately, with every fix, a new bug was revealed, one at a time,
so I don't have a full log of all the errors I encountered. I've
produced a patch file (attached)  which corrects all the build errors for
me. Hopefully it can be of use to you. Please let me know if you need
any other info from me!

Cheers,
Brandon Invergo


--=-=-=
Content-Type: text/plain
Content-Disposition: inline; filename=build-fixes.diff
Content-Description: build fix patch for gama

diff -x config.log -x config.status -ru work/gama-1.12/lib/gnu_gama/local/gkf2sql.cpp work/gama-1.12/lib/gnu_gama/local/gkf2sql.cpp
--- work/gama-1.12/lib/gnu_gama/local/gkf2sql.cpp	2012-03-16 09:00:10.000000000 +0000
+++ work/gama-1.12/lib/gnu_gama/local/gkf2sql.cpp	2012-09-03 17:39:54.886744796 +0000
@@ -322,7 +322,6 @@
 		  }
 		else if (const H_Diff*     m = dynamic_cast<const H_Diff*    >(*b)) 
 		  {
-		    const H_Diff* m = dynamic_cast<const H_Diff*>(*b);
 		    ostr << "insert into gnu_gama_local_obs "
 			 << "(conf_id, ccluster, indx, tag, from_id, to_id, "
 			 << "val, dist, rejected) values (" << cnfg() << ", " << cluster << ", "
diff -x config.log -x config.status -ru work/gama-1.12/lib/gnu_gama/obsdata.h work/gama-1.12/lib/gnu_gama/obsdata.h
--- work/gama-1.12/lib/gnu_gama/obsdata.h	2010-08-14 18:18:08.000000000 +0000
+++ work/gama-1.12/lib/gnu_gama/obsdata.h	2012-09-03 17:37:18.420069460 +0000
@@ -20,6 +20,7 @@
 */
 
 #include <gnu_gama/list.h>
+#include <cmath>
 
 #ifndef GNU_gama__obsdata_h_gnugamaobsdata_observation_data__gnu_gama_obsdata
 #define GNU_gama__obsdata_h_gnugamaobsdata_observation_data__gnu_gama_obsdata
diff -x config.log -x config.status -ru work/gama-1.12/lib/gnu_gama/sparse/smatrix_graph_connected.h work/gama-1.12/lib/gnu_gama/sparse/smatrix_graph_connected.h
--- work/gama-1.12/lib/gnu_gama/sparse/smatrix_graph_connected.h	2010-08-15 08:18:31.000000000 +0000
+++ work/gama-1.12/lib/gnu_gama/sparse/smatrix_graph_connected.h	2012-09-03 17:35:34.290063691 +0000
@@ -38,7 +38,7 @@
       Index x = stack.top();           // pop a node
       stack.pop();
 
-      for (const_iterator b=begin(x), e=end(x); b!=e; ++b)
+      for (const_iterator b=this->begin(x), e=this->end(x); b!=e; ++b)
         {
           Index y = *b;                // for all neighbors y of node x
           if (tag(y) == 0)
diff -x config.log -x config.status -ru work/gama-1.12/lib/matvec/covmat.h work/gama-1.12/lib/matvec/covmat.h
--- work/gama-1.12/lib/matvec/covmat.h	2010-08-14 18:18:07.000000000 +0000
+++ work/gama-1.12/lib/matvec/covmat.h	2012-09-03 17:34:38.766727280 +0000
@@ -172,7 +172,7 @@
     Index  N = dim();
     Index  W = bandWidth();
 
-    const  Float  Tol = Abs(*B*this->cholTol());
+    const  Float  Tol = this->Abs(*B*this->cholTol());
     Float *p;
     Index  row, k, l, n;
     Float  pivot, q;
diff -x config.log -x config.status -ru work/gama-1.12/lib/matvec/mat.h work/gama-1.12/lib/matvec/mat.h
--- work/gama-1.12/lib/matvec/mat.h	2010-08-14 18:18:07.000000000 +0000
+++ work/gama-1.12/lib/matvec/mat.h	2012-09-03 17:33:15.646722673 +0000
@@ -228,7 +228,7 @@
           for (jj=step; jj<N; jj++)
             {
               e = entry(i, indc[jj]);
-              if (Abs(e) > Abs(pivot))
+              if (this->Abs(e) > this->Abs(pivot))
                 {
                   pivot = e; p_row = ii; p_col = jj;
                 }
diff -x config.log -x config.status -ru work/gama-1.12/lib/matvec/vec.h work/gama-1.12/lib/matvec/vec.h
--- work/gama-1.12/lib/matvec/vec.h	2010-08-14 18:18:07.000000000 +0000
+++ work/gama-1.12/lib/matvec/vec.h	2012-09-03 17:34:03.460058658 +0000
@@ -68,12 +68,12 @@
     Vec t(this->dim()); add(x, t); return t;
   }
   Vec operator-(const Vec &x) const {
-    Vec t(this->dim()); sub(x, t); return t;
+    Vec t(this->dim()); this->sub(x, t); return t;
   }
 
   Vec& operator*=(Float f)      { mul(f, *this); return *this; }
   Vec& operator+=(const Vec &x) { add(x, *this); return *this; }
-  Vec& operator-=(const Vec &x) { sub(x, *this); return *this; }
+  Vec& operator-=(const Vec &x) { this->sub(x, *this); return *this; }
 
   typename MatVecBase<Float, Exc>::ListInitialiser operator=(Float x)
   {

--=-=-=
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bug-gama mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-gama

--=-=-=--