changeset 11450:5eb10763069f

substitute and use LAPACK_LIBS in mkoctfile script
author John W. Eaton <jwe@octave.org>
date Thu, 06 Jan 2011 03:10:24 -0500
parents 93b8c7ca211f
children 48cb431db87b
files ChangeLog liboctave/ChangeLog liboctave/Range.cc liboctave/lo-mappers.h liboctave/oct-md5.cc mkoctfile.cc.in mkoctfile.in src/ChangeLog src/DLD-FUNCTIONS/gcd.cc src/DLD-FUNCTIONS/rand.cc src/graphics.cc src/ov-cell.cc src/ov-scalar.cc src/pr-output.cc
diffstat 14 files changed, 87 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jan 05 21:21:37 2011 -0800
+++ b/ChangeLog	Thu Jan 06 03:10:24 2011 -0500
@@ -1,3 +1,8 @@
+2011-01-06  John W. Eaton  <jwe@octave.org>
+
+	* mkoctfile.in, mkoctfile.cc.in: Substitute and use LAPACK_LIBS.
+	Bug #32009.
+
 2010-01-04  Rik  <octave@nomad.inbox5.com>
 
 	* README.MacOS: Update CFLAGS recommendation to use -O2.
--- a/liboctave/ChangeLog	Wed Jan 05 21:21:37 2011 -0800
+++ b/liboctave/ChangeLog	Thu Jan 06 03:10:24 2011 -0500
@@ -1,3 +1,9 @@
+2011-01-06  John W. Eaton  <jwe@octave.org>
+
+	* oct-md5.cc (oct_md5_file): Tag call to fclose with gnulib::.
+	* Range.cc (tfloor): Tag calls to floor with gnulib::.
+	* lo-mappers.h (xfloor): Tag call to floor with gnulib::
+
 2010-12-20  John W. Eaton  <jwe@octave.org>
 
 	* lo-mappers.h (xrem, xmod): Declare temporary result from
--- a/liboctave/Range.cc	Wed Jan 05 21:21:37 2011 -0800
+++ b/liboctave/Range.cc	Thu Jan 06 03:10:24 2011 -0500
@@ -438,11 +438,11 @@
 
   double rmax = q / (2.0 - ct);
 
-  double t1 = 1.0 + floor (x);
+  double t1 = 1.0 + gnulib::floor (x);
   t1 = (ct / q) * (t1 < 0.0 ? -t1 : t1);
   t1 = rmax < t1 ? rmax : t1;
   t1 = ct > t1 ? ct : t1;
-  t1 = floor (x + t1);
+  t1 = gnulib::floor (x + t1);
 
   if (x <= 0.0 || (t1 - x) < rmax)
     return t1;
--- a/liboctave/lo-mappers.h	Wed Jan 05 21:21:37 2011 -0800
+++ b/liboctave/lo-mappers.h	Thu Jan 06 03:10:24 2011 -0500
@@ -34,7 +34,7 @@
 extern OCTAVE_API double xtrunc (double x);
 inline double xcopysign (double x, double y) { return copysign (x, y); }
 inline double xceil (double x) { return ceil (x); }
-inline double xfloor (double x) { return floor (x); }
+inline double xfloor (double x) { return gnulib::floor (x); }
 inline double arg (double x) { return atan2 (0.0, x); }
 inline double conj (double x) { return x; }
 inline double fix (double x) { return xtrunc (x); }
--- a/liboctave/oct-md5.cc	Wed Jan 05 21:21:37 2011 -0800
+++ b/liboctave/oct-md5.cc	Thu Jan 06 03:10:24 2011 -0500
@@ -70,7 +70,7 @@
 
       int errflag = md5_stream (ifile, buf);
 
-      fclose (ifile);
+      gnulib::fclose (ifile);
 
       if (! errflag)
         retval = oct_md5_result_to_str (buf);
--- a/mkoctfile.cc.in	Wed Jan 05 21:21:37 2011 -0800
+++ b/mkoctfile.cc.in	Thu Jan 06 03:10:24 2011 -0500
@@ -225,6 +225,7 @@
   vars["LIBOCTINTERP"] = "-loctinterp";
   vars["READLINE_LIBS"] = "-lreadline";
   vars["LIBCRUFT"] = "-lcruft";
+  vars["LAPACK_LIBS"] = get_variable ("LAPACK_LIBS", %OCTAVE_CONF_LAPACK_LIBS%);
   vars["BLAS_LIBS"] = get_variable ("BLAS_LIBS", %OCTAVE_CONF_BLAS_LIBS%);
   vars["FFTW3_LDFLAGS"] = get_variable ("FFTW3_LDFLAGS", %OCTAVE_CONF_FFTW3_LDFLAGS%);
   vars["FFTW3_LIBS"] = get_variable ("FFTW3_LIBS", %OCTAVE_CONF_FFTW3_LIBS%);
@@ -298,22 +299,22 @@
 "			    ALL_CFLAGS                FLIBS\n"
 "			    ALL_CXXFLAGS              FPICFLAG\n"
 "			    ALL_FFLAGS                INCFLAGS\n"
-"			    ALL_LDFLAGS               LDFLAGS\n"
-"			    BLAS_LIBS                 LD_CXX\n"
-"			    CC                        LD_STATIC_FLAG\n"
-"			    CFLAGS                    LFLAGS\n"
-"			    CPICFLAG                  LIBCRUFT\n"
-"			    CPPFLAGS                  LIBOCTAVE\n"
-"			    CXX                       LIBOCTINTERP\n"
-"			    CXXFLAGS                  LIBS\n"
-"			    CXXPICFLAG                OCTAVE_LIBS\n"
-"			    DEPEND_EXTRA_SED_PATTERN  RDYNAMIC_FLAG\n"
-"			    DEPEND_FLAGS              READLINE_LIBS\n"
-"			    DL_LD                     RLD_FLAG\n"
-"			    DL_LDFLAGS                SED\n"
-"			    F77                       XTRA_CFLAGS\n"
-"			    FFLAGS                    XTRA_CXXFLAGS\n"
-"			    FFTW_LIBS\n"
+"			    ALL_LDFLAGS               LAPACK_LIBS\n"
+"			    BLAS_LIBS                 LDFLAGS\n"
+"			    CC                        LD_CXX\n"
+"			    CFLAGS                    LD_STATIC_FLAG\n"
+"			    CPICFLAG                  LFLAGS\n"
+"			    CPPFLAGS                  LIBCRUFT\n"
+"			    CXX                       LIBOCTAVE\n"
+"			    CXXFLAGS                  LIBOCTINTERP\n"
+"			    CXXPICFLAG                LIBS\n"
+"			    DEPEND_EXTRA_SED_PATTERN  OCTAVE_LIBS\n"
+"			    DEPEND_FLAGS              RDYNAMIC_FLAG\n"
+"			    DL_LD                     READLINE_LIBS\n"
+"			    DL_LDFLAGS                RLD_FLAG\n"
+"			    F77                       SED\n"
+"			    FFLAGS                    XTRA_CFLAGS\n"
+"			    FFTW_LIBS                 XTRA_CXXFLAGS\n"
 "\n"
 "  --link-stand-alone      Link a stand-alone executable file.\n"
 "\n"
@@ -743,9 +744,9 @@
 		+ " " + output_option + " " + objfiles + " " + libfiles
 		+ " " + ldflags + " " + vars["LFLAGS"] + " "
 		+ vars["RLD_FLAG"] + " " + vars["OCTAVE_LIBS"] + " "
-		+ vars["BLAS_LIBS"] + " " + vars["FFTW_LIBS"] + " "
-		+ vars["READLINE_LIBS"] + " " + vars["LIBS"] + " "
-		+ vars["FLIBS"];
+		+ vars["LAPACK_LIBS"] + " " vars["BLAS_LIBS"] + " "
+                + vars["FFTW_LIBS"] + " " + vars["READLINE_LIBS"] + " "
+                + vars["LIBS"] + " " + vars["FLIBS"];
 	      result = run_command (cmd);
 	    }
 	  else
--- a/mkoctfile.in	Wed Jan 05 21:21:37 2011 -0800
+++ b/mkoctfile.in	Thu Jan 06 03:10:24 2011 -0500
@@ -92,6 +92,7 @@
 : ${LIBOCTINTERP=-loctinterp}
 : ${READLINE_LIBS=-lreadline}
 : ${LIBCRUFT=-lcruft}
+: ${LAPACK_LIBS=%OCTAVE_CONF_LAPACK_LIBS%}
 : ${BLAS_LIBS=%OCTAVE_CONF_BLAS_LIBS%}
 : ${FFTW3_LDFLAGS=%OCTAVE_CONF_FFTW3_LDFLAGS%}
 : ${FFTW3_LIBS=%OCTAVE_CONF_FFTW3_LIBS%}
@@ -225,22 +226,22 @@
 			    ALL_CFLAGS                FLIBS
 			    ALL_CXXFLAGS              FPICFLAG
 			    ALL_FFLAGS                INCFLAGS
-			    ALL_LDFLAGS               LDFLAGS
-			    BLAS_LIBS                 LD_CXX
-			    CC                        LD_STATIC_FLAG
-			    CFLAGS                    LFLAGS
-			    CPICFLAG                  LIBCRUFT
-			    CPPFLAGS                  LIBOCTAVE
-			    CXX                       LIBOCTINTERP
-			    CXXFLAGS                  LIBS
-			    CXXPICFLAG                OCTAVE_LIBS
-			    DEPEND_EXTRA_SED_PATTERN  RDYNAMIC_FLAG
-			    DEPEND_FLAGS              READLINE_LIBS
-			    DL_LD                     RLD_FLAG
-			    DL_LDFLAGS                SED
-			    F77                       XTRA_CFLAGS
-			    FFLAGS                    XTRA_CXXFLAGS
-			    FFTW_LIBS
+			    ALL_LDFLAGS               LAPACK_LIBS
+			    BLAS_LIBS                 LDFLAGS
+			    CC                        LD_CXX
+			    CFLAGS                    LD_STATIC_FLAG
+			    CPICFLAG                  LFLAGS
+			    CPPFLAGS                  LIBCRUFT
+			    CXX                       LIBOCTAVE
+			    CXXFLAGS                  LIBOCTINTERP
+			    CXXPICFLAG                LIBS
+			    DEPEND_EXTRA_SED_PATTERN  OCTAVE_LIBS
+			    DEPEND_FLAGS              RDYNAMIC_FLAG
+			    DL_LD                     READLINE_LIBS
+			    DL_LDFLAGS                RLD_FLAG
+			    F77                       SED
+			    FFLAGS                    XTRA_CFLAGS
+			    FFTW_LIBS                 XTRA_CXXFLAGS
 
   --link-stand-alone      Link a stand-alone executable file.
 
@@ -524,7 +525,7 @@
 if $link && [ -n "$objfiles" ]; then
   if $link_stand_alone; then
     if [ -n "$LD_CXX" ]; then
-      cmd="$LD_CXX $CPPFLAGS $ALL_CXXFLAGS $RDYNAMIC_FLAG $ALL_LDFLAGS $pass_on_options $output_option $objfiles $libfiles $ldflags $LFLAGS $RLD_FLAG $OCTAVE_LIBS $BLAS_LIBS $FFTW_LIBS $READLINE_LIBS $LIBS $FLIBS"
+      cmd="$LD_CXX $CPPFLAGS $ALL_CXXFLAGS $RDYNAMIC_FLAG $ALL_LDFLAGS $pass_on_options $output_option $objfiles $libfiles $ldflags $LFLAGS $RLD_FLAG $OCTAVE_LIBS $LAPACK_LIBS $BLAS_LIBS $FFTW_LIBS $READLINE_LIBS $LIBS $FLIBS"
       $dbg $cmd
       eval $cmd
     else
@@ -532,7 +533,7 @@
       exit 1
     fi
   else
-    LINK_DEPS="$LFLAGS $OCTAVE_LIBS $LDFLAGS $BLAS_LIBS $FFTW_LIBS $LIBS $FLIBS"
+    LINK_DEPS="$LFLAGS $OCTAVE_LIBS $LDFLAGS $LAPACK_LIBS $BLAS_LIBS $FFTW_LIBS $LIBS $FLIBS"
     cmd="$DL_LD $DL_LDFLAGS $pass_on_options -o $octfile $objfiles $libfiles $ldflags $LINK_DEPS"
     $dbg $cmd
     eval $cmd
--- a/src/ChangeLog	Wed Jan 05 21:21:37 2011 -0800
+++ b/src/ChangeLog	Thu Jan 06 03:10:24 2011 -0500
@@ -1,3 +1,15 @@
+2011-01-06  John W. Eaton  <jwe@octave.org>
+
+	* DLD-FUNCTIONS/rand.cc (Frandperm): Tag call to floor with gnulib::.
+	* DLD-FUNCTIONS/gcd.cc (divide): Tag calls to floor with gnulib::.
+	* ov-scalar.cc (octave_scalar::map): Tag floor with gnulib::.
+	* ov-cell.cc (octave_cell::save_hdf5): Tag call to floor with gnulib::.
+	* pr-output.cc (engineering_exponent, num_digits,
+	octave_print_internal_template): Tag call to floor with gnulib::.
+	* graphics.cc: Consistently use std::ceil.
+	(axes::properties::get_axis_limits): Tag calls to floor with gnulib::.
+	(axes::properties::calc_ticks_and_lims): Likewise.
+
 2011-01-05  John W. Eaton  <jwe@octave.org>
 
 	Bug #32060.
--- a/src/DLD-FUNCTIONS/gcd.cc	Wed Jan 05 21:21:37 2011 -0800
+++ b/src/DLD-FUNCTIONS/gcd.cc	Thu Jan 06 03:10:24 2011 -0500
@@ -61,11 +61,11 @@
 // implements template aliases from C++0x, can do a small fix here).
 template <typename FP>
 static void
-divide(const std::complex<FP>& a, const std::complex<FP>& b,
-       std::complex<FP>& q, std::complex<FP>& r)
+divide (const std::complex<FP>& a, const std::complex<FP>& b,
+        std::complex<FP>& q, std::complex<FP>& r)
 {
-  FP qr = floor ((a/b).real () + 0.5);
-  FP qi = floor ((a/b).imag () + 0.5);
+  FP qr = gnulib::floor ((a/b).real () + 0.5);
+  FP qi = gnulib::floor ((a/b).imag () + 0.5);
 
   q = std::complex<FP> (qr, qi);
 
--- a/src/DLD-FUNCTIONS/rand.cc	Wed Jan 05 21:21:37 2011 -0800
+++ b/src/DLD-FUNCTIONS/rand.cc	Thu Jan 06 03:10:24 2011 -0500
@@ -1062,7 +1062,7 @@
 
               for (octave_idx_type i = 0; i < n; i++)
                 {
-                  octave_idx_type k = i + floor (rvec[i] * (n - i));
+                  octave_idx_type k = i + gnulib::floor (rvec[i] * (n - i));
                   std::swap (ivec[i], ivec[k]);
                 }
 
--- a/src/graphics.cc	Wed Jan 05 21:21:37 2011 -0800
+++ b/src/graphics.cc	Thu Jan 06 03:10:24 2011 -0500
@@ -1843,7 +1843,7 @@
         {
           retval = graphics_handle (next_handle);
 
-          next_handle = ceil (next_handle) - 1.0 - make_handle_fraction ();
+          next_handle = std::ceil (next_handle) - 1.0 - make_handle_fraction ();
         }
     }
 
@@ -1888,7 +1888,7 @@
               handle_map.erase (p);
 
               if (h.value () < 0)
-                handle_free_list.insert (ceil (h.value ()) - make_handle_fraction ());
+                handle_free_list.insert (std::ceil (h.value ()) - make_handle_fraction ());
             }
           else
             error ("graphics_handle::free: invalid object %g", h.value ());
@@ -4334,8 +4334,8 @@
               min_val *= 0.9;
               max_val *= 1.1;
             }
-          min_val = pow (10, floor (log10 (min_val)));
-          max_val = pow (10, ceil (log10 (max_val)));
+          min_val = pow (10, gnulib::floor (log10 (min_val)));
+          max_val = pow (10, std::ceil (log10 (max_val)));
         }
       else
         {
@@ -4352,8 +4352,8 @@
             }
 
           double tick_sep = calc_tick_sep (min_val , max_val);
-          min_val = tick_sep * std::floor (min_val / tick_sep);
-          max_val = tick_sep * ceil (max_val / tick_sep);
+          min_val = tick_sep * gnulib::floor (min_val / tick_sep);
+          max_val = tick_sep * std::ceil (max_val / tick_sep);
         }
     }
 
@@ -4394,7 +4394,7 @@
 
   double tick_sep = calc_tick_sep (lo , hi);
 
-  int i1 = static_cast<int> (std::floor (lo / tick_sep));
+  int i1 = static_cast<int> (gnulib::floor (lo / tick_sep));
   int i2 = static_cast<int> (std::ceil (hi / tick_sep));
 
   if (limmode_is_auto)
@@ -4417,7 +4417,7 @@
     {
       // adjust min and max tics if they are out of limits
       i1 = static_cast<int> (std::ceil (lo / tick_sep));
-      i2 = static_cast<int> (std::floor (hi / tick_sep));
+      i2 = static_cast<int> (gnulib::floor (hi / tick_sep));
     }
       
   Matrix tmp_ticks (1, i2-i1+1);
@@ -5230,7 +5230,7 @@
                                  x(j3,i+1)-x(j2,i), y(j+1,i3)-y(j,i2), z(j+1,i+1)-z(j,i),
                                  nx, ny, nz);
 
-              double d = - std::max(std::max(fabs(nx), fabs(ny)), fabs(nz));
+              double d = -std::max (std::max (fabs (nx), fabs (ny)), fabs (nz));
 
               nx /= d;
               ny /= d;
--- a/src/ov-cell.cc	Wed Jan 05 21:21:37 2011 -0800
+++ b/src/ov-cell.cc	Thu Jan 06 03:10:24 2011 -0500
@@ -1128,7 +1128,7 @@
   for (octave_idx_type i = 0; i < nel; i++)
     {
       std::ostringstream buf;
-      int digits = static_cast<int> (::floor (::log10 (static_cast<double> (nel)) + 1.0));
+      int digits = static_cast<int> (gnulib::floor (::log10 (static_cast<double> (nel)) + 1.0));
       buf << "_" << std::setw (digits) << std::setfill ('0') << i;
       std::string s = buf.str ();
 
--- a/src/ov-scalar.cc	Wed Jan 05 21:21:37 2011 -0800
+++ b/src/ov-scalar.cc	Thu Jan 06 03:10:24 2011 -0500
@@ -313,7 +313,7 @@
       SCALAR_MAPPER (exp, ::exp);
       SCALAR_MAPPER (expm1, ::expm1);
       SCALAR_MAPPER (fix, ::fix);
-      SCALAR_MAPPER (floor, ::floor);
+      SCALAR_MAPPER (floor, gnulib::floor);
       SCALAR_MAPPER (log, rc_log);
       SCALAR_MAPPER (log2, rc_log2);
       SCALAR_MAPPER (log10, rc_log10);
--- a/src/pr-output.cc	Wed Jan 05 21:21:37 2011 -0800
+++ b/src/pr-output.cc	Thu Jan 06 03:10:24 2011 -0500
@@ -241,7 +241,7 @@
   if (x != 0)
     {
       double absval = (x < 0.0 ? -x : x);
-      int logabsval = static_cast<int> (floor (log10 (absval)));
+      int logabsval = static_cast<int> (gnulib::floor (log10 (absval)));
       /* Avoid using modulo function with negative arguments for portability.
        * See extended comment at calc_scale_exp */
       if (logabsval < 0.0)
@@ -255,8 +255,9 @@
 static int
 num_digits (const double& x)
 {
-  return 1 + (print_eng ? engineering_exponent (x)
-                        : static_cast<int> (floor (log10 (x))));
+  return 1 + (print_eng
+              ? engineering_exponent (x)
+              : static_cast<int> (gnulib::floor (log10 (x))));
 }
 
 class
@@ -3217,7 +3218,7 @@
           for (octave_idx_type i = 0; i < dims.numel (); i++)
             {
               int new_digits = static_cast<int> 
-                (floor (log10 (double (abs (nda(i).value ()))) + 1.0));
+                (gnulib::floor (log10 (double (abs (nda(i).value ()))) + 1.0));
 
               if (new_digits > digits)
                 digits = new_digits;