changeset 6133:e0065af38cf4

[project @ 2006-11-02 03:33:50 by jwe]
author jwe
date Thu, 02 Nov 2006 03:33:51 +0000
parents e49ad821587e
children 3010a2ecde0b
files ChangeLog configure.in src/ChangeLog src/data.cc src/ov.h
diffstat 5 files changed, 95 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Nov 01 18:38:32 2006 +0000
+++ b/ChangeLog	Thu Nov 02 03:33:51 2006 +0000
@@ -1,5 +1,9 @@
 2006-11-01  John W. Eaton  <jwe@octave.org>
 
+	* configure.in: Check for PCRE macros we use.  Warn if regex
+	library is not found.  Print hdf5, zlib, umfpack, colamd, ccolamd,
+	cholmod, and cxsparse warnings when we detect the problems.
+
 	* run-octave.in: Handle quoted args properly in exec call?
 
 2006-10-29  John W. Eaton  <jwe@octave.org>
--- a/configure.in	Wed Nov 01 18:38:32 2006 +0000
+++ b/configure.in	Thu Nov 02 03:33:51 2006 +0000
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.541 $)
+AC_REVISION($Revision: 1.542 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -434,6 +434,16 @@
     WITH_PCRE=yes
   fi
 fi
+AC_CACHE_CHECK([whether pcre.h has the macros we need],
+	       [ac_cv_pcre_h_macros_present],
+               [AC_EGREP_CPP([PCRE_HAS_MACROS_WE_NEED], [
+#include <pcre.h>
+#if defined (PCRE_INFO_NAMECOUNT) \
+  && defined (PCRE_INFO_NAMEENTRYSIZE) \
+  && defined (PCRE_INFO_NAMETABLE)
+PCRE_HAS_MACROS_WE_NEED
+#endif], ac_cv_pcre_h_macros_present=yes, ac_cv_pcre_h_macros_present=no)])
+WITH_PCRE="$ac_cv_pcre_h_macros_present"
 if test $WITH_PCRE = yes ; then
   AC_CHECK_LIB(pcre, pcre_compile, WITH_PCRE=yes, WITH_PCRE=no)
   if test $WITH_PCRE = yes ; then
@@ -443,11 +453,12 @@
     else
       REGEX_LIBS="-lpcre"
     fi
-  else
-    warn_pcre="PCRE library not found.  This will result in some loss of functionality for the regular expression matching functions."
-    AC_MSG_WARN($warn_pcre)
   fi
 fi
+if test $WITH_PCRE = no; then
+  warn_pcre="PCRE library not found.  This will result in some loss of functionality for the regular expression matching functions."
+  AC_MSG_WARN($warn_pcre)
+fi
 AC_CHECK_FUNCS(regexec, WITH_REGEX=yes , [
   AC_CHECK_LIB(regex, regexec, WITH_REGEX=yes, WITH_REGEX=no)])
 if test $WITH_REGEX = yes ; then
@@ -457,6 +468,10 @@
       AC_CHECK_LIB(regex, regexec, REGEX_LIBS="-lregex")])
   fi
 fi
+if test $WITH_REGEX = no; then
+  warn_regex="regular expression functions not found.  The regular expression matching functions will be disabled."
+  AC_MSG_WARN($warn_regex)
+fi
 
 ### Check for ZLIB library.
 
@@ -515,9 +530,11 @@
     true
   else
     warn_hdf5="HDF5 library not found.  Octave will not be able to save or load HDF5 data files."
+    AC_MSG_WARN($warn_hdf5)
   fi
 else
   warn_zlib="ZLIB library not found.  Octave will not be able to save or load compressed data files or HDF5 files."
+  AC_MSG_WARN($warn_zlib)
 fi
 
 
@@ -548,6 +565,9 @@
 if test "$with_fftw" = yes && test "$with_fftw3" = yes; then
   FFT_DIR=''
   AC_DEFINE(HAVE_FFTW3, 1, [Define if the FFTW3 library is used.])
+else
+  warn_fftw="FFTW library not found.  Octave will use the (slower) FFTPACK library instead."
+  AC_MSG_RESULT($warn_fftw)
 fi
 
 # Checks for GLPK header and library.
@@ -568,9 +588,13 @@
   AC_CHECK_LIB($glpk_lib, glp_lpx_simplex, [
     AC_CHECK_HEADERS(glpk.h, [
       GLPK_LIBS="-l$glpk_lib"
-      AC_DEFINE(HAVE_GLPK, 1, [Define if GLPK is available.])])])
+      AC_DEFINE(HAVE_GLPK, 1, [Define if GLPK is available.])], [
+      glpk_missing=yes])])
 fi
 AC_SUBST(GLPK_LIBS)
+if test "$glpk_missing" = yes; then
+  warn_glpk="GLPK library not found.  The glpk function for solving linear programs will be disabled."
+fi
 
 # Checks for CURL header and library.
 
@@ -590,9 +614,14 @@
   AC_CHECK_LIB($curl_lib, curl_easy_escape, [
     AC_CHECK_HEADERS(curl/curl.h, [
       CURL_LIBS="-l$curl_lib"
-      AC_DEFINE(HAVE_CURL, 1, [Define if CURL is available.])])])
+      AC_DEFINE(HAVE_CURL, 1, [Define if CURL is available.])], [
+      curl_missing=yes])])
 fi
 AC_SUBST(CURL_LIBS)
+if test "$curl_missing" = yes; then
+  warn_curl="cURL library not found.  The urlread and urlwrite functions will be disabled."
+fi
+
 
 OCTAVE_IEEE754_DATA_FORMAT
 
@@ -837,6 +866,9 @@
     fi
     break])
 fi
+if test -n "$warn_umfpack"; then
+  AC_MSG_WARN($warn_umfpack)
+fi
 
 AC_SUBST(TEXINFO_UMFPACK)
 
@@ -860,6 +892,9 @@
     fi
     break])
 fi 
+if test -n "$warn_colamd"; then
+  AC_MSG_WARN($warn_colamd)
+fi
 
 AC_SUBST(TEXINFO_COLAMD)
 
@@ -882,6 +917,9 @@
     fi
     break])
 fi 
+if test -n "$warn_ccolamd"; then
+  AC_MSG_WARN($warn_ccolamd)
+fi
 
 CHOLMOD_LIBS=
 AC_SUBST(CHOLMOD_LIBS)
@@ -924,7 +962,10 @@
       warn_cholmod=
     fi
     break])
-fi 
+fi
+if test -n "$warn_cholmod"; then
+  AC_MSG_WARN($warn_cholmod)
+fi
 
 AC_SUBST(TEXINFO_CHOLMOD)
 
@@ -947,6 +988,9 @@
     fi
     break])
 fi
+if test -n "$warn_cxsparse"; then
+  AC_MSG_WARN($warn_cxsparse)
+fi
 
 ### Handle shared library options.
 
@@ -2057,11 +2101,26 @@
   warn_msg_printed=true
 fi
 
+if test -n "$warn_fftw"; then
+  AC_MSG_WARN($warn_fftw)
+  warn_msg_printed=true
+fi
+
+if test -n "$warn_glpk"; then
+  AC_MSG_WARN($warn_glpk)
+  warn_msg_printed=true
+fi
+
 if test -n "$warn_hdf5"; then
   AC_MSG_WARN($warn_hdf5)
   warn_msg_printed=true
 fi
 
+if test -n "$warn_regex"; then
+  AC_MSG_WARN($warn_regex)
+  warn_msg_printed=true
+fi
+
 if test -n "$warn_pcre"; then
   AC_MSG_WARN($warn_pcre)
   warn_msg_printed=true
--- a/src/ChangeLog	Wed Nov 01 18:38:32 2006 +0000
+++ b/src/ChangeLog	Thu Nov 02 03:33:51 2006 +0000
@@ -1,3 +1,9 @@
+2006-11-01  John W. Eaton  <jwe@octave.org>
+
+	* ov.h (octave_value::idx_type_value): New function.
+	* data.cc (fill_matrix, Flinspace, Freshape): Use idx_type_value
+	instead of int_value to extract size args.
+
 2006-10-31  John W. Eaton  <jwe@octave.org>
 
 	* ov-range.h (octave_range::empty_clone): Return octave_matrix
--- a/src/data.cc	Wed Nov 01 18:38:32 2006 +0000
+++ b/src/data.cc	Thu Nov 02 03:33:51 2006 +0000
@@ -1465,7 +1465,7 @@
 
 	for (int i = 0; i < nargin; i++)
 	  {
-	    dims(i) = args(i).is_empty () ? 0 : args(i).int_value ();
+	    dims(i) = args(i).is_empty () ? 0 : args(i).idx_type_value ();
 
 	    if (error_state)
 	      {
@@ -1582,7 +1582,7 @@
 
 	for (int i = 0; i < nargin; i++)
 	  {
-	    dims(i) = args(i).is_empty () ? 0 : args(i).int_value ();
+	    dims(i) = args(i).is_empty () ? 0 : args(i).idx_type_value ();
 
 	    if (error_state)
 	      {
@@ -1660,7 +1660,7 @@
 
 	for (int i = 0; i < nargin; i++)
 	  {
-	    dims(i) = args(i).is_empty () ? 0 : args(i).int_value ();
+	    dims(i) = args(i).is_empty () ? 0 : args(i).idx_type_value ();
 
 	    if (error_state)
 	      {
@@ -1724,7 +1724,7 @@
 
 	for (int i = 0; i < nargin; i++)
 	  {
-	    dims(i) = args(i).is_empty () ? 0 : args(i).int_value ();
+	    dims(i) = args(i).is_empty () ? 0 : args(i).idx_type_value ();
 
 	    if (error_state)
 	      {
@@ -2266,7 +2266,7 @@
 
   int nargin = args.length ();
 
-  int npoints = 100;
+  octave_idx_type npoints = 100;
 
   if (nargin != 2 && nargin != 3)
     {
@@ -2275,7 +2275,7 @@
     }
 
   if (nargin == 3)
-    npoints = args(2).int_value ();
+    npoints = args(2).idx_type_value ();
 
   if (! error_state)
     {
@@ -2425,7 +2425,7 @@
 	      }
 	  else
 	    {
-	      new_size(i-1) = args(i).int_value ();
+	      new_size(i-1) = args(i).idx_type_value ();
 
 	      if (error_state)
 		break;
--- a/src/ov.h	Wed Nov 01 18:38:32 2006 +0000
+++ b/src/ov.h	Thu Nov 02 03:33:51 2006 +0000
@@ -572,6 +572,18 @@
   ulong_value (bool req_int = false, bool frc_str_conv = false) const
     { return rep->ulong_value (req_int, frc_str_conv); }
 
+  octave_idx_type
+  idx_type_value (bool req_int = false, bool frc_str_conv = false) const
+    {
+#if SIZEOF_OCTAVE_IDX_TYPE == SIZEOF_LONG
+      return long_value (req_int, frc_str_conv);
+#elif SIZEOF_OCTAVE_IDX_TYPE == SIZEOF_INT
+      return int_value (req_int, frc_str_conv);
+#else
+#error "no octave_value extractor for octave_idx_type"
+#endif
+    }
+
   double double_value (bool frc_str_conv = false) const
     { return rep->double_value (frc_str_conv); }