changeset 21207:945695cafd2b

allow build to succeed with missing dependencies * gl2ps-print.cc, graphics.cc: Allow building without freetype. * sparse-chol.cc: Allow building without cholmod. * sparse-lu.cc: Allow building without umfpack. * sparse-qr.cc: Allow building without cxsparse.
author John W. Eaton <jwe@octave.org>
date Fri, 05 Feb 2016 14:50:00 -0500
parents 15517574276a
children f5e05c11c343
files libinterp/corefcn/gl2ps-print.cc libinterp/corefcn/graphics.cc liboctave/numeric/sparse-chol.cc liboctave/numeric/sparse-lu.cc liboctave/numeric/sparse-qr.cc
diffstat 5 files changed, 23 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-print.cc	Sat Feb 06 22:38:13 2016 +0100
+++ b/libinterp/corefcn/gl2ps-print.cc	Fri Feb 05 14:50:00 2016 -0500
@@ -722,8 +722,6 @@
                halign, valign, props.get_rotation ());
 }
 
-#endif
-
 static void
 safe_pclose (FILE *f)
 {
@@ -738,6 +736,8 @@
     gnulib::fclose (f);
 }
 
+#endif
+
 // If the name of the stream begins with '|', open a pipe to the command
 // named by the rest of the string.  Otherwise, write to the named file.
 
--- a/libinterp/corefcn/graphics.cc	Sat Feb 06 22:38:13 2016 +0100
+++ b/libinterp/corefcn/graphics.cc	Fri Feb 05 14:50:00 2016 -0500
@@ -6963,10 +6963,6 @@
                                          const string_vector& ticklabels,
                                          const Matrix& limits)
 {
-#ifndef HAVE_FREETYPE
-  double fontsize = get ("fontsize").double_value ();
-#endif
-
   Matrix ext (1, 2, 0.0);
   double wmax, hmax;
   wmax = hmax = 0.0;
@@ -6986,9 +6982,10 @@
           hmax = std::max (hmax, ext(1));
 #else
           // FIXME: find a better approximation
+          double fsize = get ("fontsize").double_value ();
           int len = label.length ();
-          wmax = std::max (wmax, 0.5*fontsize*len);
-          hmax = fontsize;
+          wmax = std::max (wmax, 0.5*fsize*len);
+          hmax = fsize;
 #endif
         }
     }
--- a/liboctave/numeric/sparse-chol.cc	Sat Feb 06 22:38:13 2016 +0100
+++ b/liboctave/numeric/sparse-chol.cc	Fri Feb 05 14:50:00 2016 -0500
@@ -40,16 +40,16 @@
 public:
 
   sparse_chol_rep (void)
-    : count (1), is_pd (false), minor_p (0), perms (), cond (0),
+    : count (1), is_pd (false), minor_p (0), perms (), cond (0)
 #ifdef HAVE_CHOLMOD
-      Lsparse (0), Common ()
+      , Lsparse (0), Common ()
 #endif
   { }
 
   sparse_chol_rep (const chol_type& a, bool natural, bool force)
-    : count (1), is_pd (false), minor_p (0), perms (), cond (0),
+    : count (1), is_pd (false), minor_p (0), perms (), cond (0)
 #ifdef HAVE_CHOLMOD
-      Lsparse (0), Common ()
+      , Lsparse (0), Common ()
 #endif
   {
     init (a, natural, force);
@@ -57,9 +57,9 @@
 
   sparse_chol_rep (const chol_type& a, octave_idx_type& info,
                    bool natural, bool force)
-    : count (1), is_pd (false), minor_p (0), perms (), cond (0),
+    : count (1), is_pd (false), minor_p (0), perms (), cond (0)
 #ifdef HAVE_CHOLMOD
-      Lsparse (0), Common ()
+      , Lsparse (0), Common ()
 #endif
   {
     info = init (a, natural, force);
@@ -73,14 +73,12 @@
 #endif
   }
 
+#ifdef HAVE_CHOLMOD
   cholmod_sparse *L (void) const
   {
-#ifdef HAVE_CHOLMOD
     return Lsparse;
-#else
-    return 0;
+  }
 #endif
-  }
 
   octave_idx_type P (void) const
   {
--- a/liboctave/numeric/sparse-lu.cc	Sat Feb 06 22:38:13 2016 +0100
+++ b/liboctave/numeric/sparse-lu.cc	Fri Feb 05 14:50:00 2016 -0500
@@ -114,6 +114,8 @@
 void
 umfpack_report_symbolic (void *Symbolic, const double *Control);
 
+#if defined (HAVE_UMFPACK)
+
 // SparseMatrix Specialization.
 
 template <>
@@ -369,6 +371,8 @@
   UMFPACK_ZNAME (report_symbolic) (Symbolic, Control);
 }
 
+#endif
+
 template <typename lu_type>
 sparse_lu<lu_type>::sparse_lu (const lu_type& a, const Matrix& piv_thres,
                                bool scale)
--- a/liboctave/numeric/sparse-qr.cc	Sat Feb 06 22:38:13 2016 +0100
+++ b/liboctave/numeric/sparse-qr.cc	Fri Feb 05 14:50:00 2016 -0500
@@ -34,9 +34,6 @@
 class
 cxsparse_types
 {
-public:
-  typedef void symbolic_type;
-  typedef void numeric_type;
 };
 
 template <>
@@ -47,6 +44,9 @@
 #if defined (HAVE_CXSPARSE)
   typedef CXSPARSE_DNAME (s) symbolic_type;
   typedef CXSPARSE_DNAME (n) numeric_type;
+#else
+  typedef void symbolic_type;
+  typedef void numeric_type;
 #endif
 };
 
@@ -58,6 +58,9 @@
 #if defined (HAVE_CXSPARSE)
   typedef CXSPARSE_ZNAME (s) symbolic_type;
   typedef CXSPARSE_ZNAME (n) numeric_type;
+#else
+  typedef void symbolic_type;
+  typedef void numeric_type;
 #endif
 };