# HG changeset patch # User jwe # Date 988128476 0 # Node ID f0ab8a324da7c000ec60def07ae63ca3f6869c65 # Parent d1c740979382fa62800c43e5ce615f9a59cf38e3 [project @ 2001-04-24 16:06:59 by jwe] diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-04-23 John W. Eaton + + * configure.in: Only check for libz if checking for HDF5 libraries. + Allow user to specify HDF5 library name on command line, same as + for BLAS libraries. Include BLAS and HDF5 libs in summary output. + 2001-04-19 John W. Eaton * octMakefile.in (CONF_DISTFILES): Remove config.h.bot from the list. diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -21,7 +21,7 @@ ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. -AC_REVISION($Revision: 1.342 $) +AC_REVISION($Revision: 1.343 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -251,7 +251,7 @@ DEPEND_EXTRA_SED_PATTERN="" case "$canonical_host_type" in sparc-sun-solaris2* | i386-pc-solaris2*) - if test "$GCC" = "yes"; then + if test "$GCC" = yes; then true else DEPEND_FLAGS="-xM1" @@ -304,7 +304,7 @@ ### We do our own template instantiation for specific compilers. -if test "$cxx_auto_instantiate_templates" = "no"; then +if test "$cxx_auto_instantiate_templates" = no; then OCTAVE_CXX_FLAG(-fno-implicit-templates, [ XTRA_CXXFLAGS="$XTRA_CXXFLAGS -fno-implicit-templates" AC_MSG_RESULT([adding -fno-implicit-templates to XTRA_CXXFLAGS])]) @@ -342,17 +342,33 @@ ;; esac -# ---------------------------------------------------------------------- -# Check for HDF5 library -AC_ARG_WITH(hdf5, [ --without-hdf5 don't use HDF5 output], ok=$withval, ok=yes) -if test "$ok" = "yes"; then - AC_CHECK_LIB(z, deflate) - AC_CHECK_LIB(hdf5, H5Pcreate, [ - AC_CHECK_HEADERS(hdf5.h, [LIBS="-lhdf5 $LIBS" - AC_DEFINE(HAVE_HDF5)])]) +### Check for HDF5 library. + +### XXX FIXME XXX -- how can user specify a set of libraries here? + +WITH_HDF5=true +AC_ARG_WITH(hdf5, + [ --without-hdf5 don't use HDF5], + with_hdf5=$withval, with_hdf5=yes) + +hdf5_lib= +if test "$with_hdf5" = yes; then + hdf5_lib="hdf5" +elif test "$with_hdf5" != no; then + hdf5_lib="$with_hdf5" fi -# ---------------------------------------------------------------------- +HDF5_LIBS= +WITH_HDF5=false +if test -n "$hdf5_lib"; then + AC_CHECK_LIB($hdf5_lib, H5Pcreate, [ + AC_CHECK_LIB(z, deflate, [ + AC_CHECK_HEADERS(hdf5.h, [ + WITH_HDF5=true + HDF5_LIBS="-l$hdf5_lib -lz" + LIBS="$HDF5_LIBS $LIBS" + AC_DEFINE(HAVE_HDF5)])])]) +fi ### We need these before trying to find libf2c. @@ -531,18 +547,22 @@ AC_SUBST(F2CFLAGS) AC_SUBST_FILE(f77_rules_frag) -# Checks for BLAS and LAPACK libraries: +### Checks for BLAS and LAPACK libraries: -# subdirectories of libcruft to build if they aren't found on the system: +### XXX FIXME XXX -- how can user specify a set of libraries here? + +### Subdirectories of libcruft to build if they aren't found on the system: + BLAS_DIR="blas" LAPACK_DIR="lapack" AC_SUBST(BLAS_DIR) AC_SUBST(LAPACK_DIR) -# names of Fortran dgemm & cheev functions to check for (depends upon -# F77 compiler name-mangling scheme): -if test "$octave_cv_f77_uppercase_names" = "yes"; then - if test "$octave_cv_f77_append_underscore" = "yes"; then +### names of Fortran dgemm & cheev functions to check for (depends upon +### F77 compiler name-mangling scheme): + +if test "$octave_cv_f77_uppercase_names" = yes; then + if test "$octave_cv_f77_append_underscore" = yes; then dgemm_func=DGEMM_ cheev_func=CHEEV_ else @@ -550,7 +570,7 @@ cheev_func=CHEEV fi else - if test "$octave_cv_f77_append_underscore" = "yes" || test -n "${F2C}"; then + if test "$octave_cv_f77_append_underscore" = yes || test -n "${F2C}"; then dgemm_func=dgemm_ cheev_func=cheev_ else @@ -559,10 +579,13 @@ fi fi -AC_ARG_WITH(fastblas, [ --without-fastblas use included (generic) BLAS and LAPACK], with_fastblas=$withval, with_fastblas=yes) -if test "$with_fastblas" = "no"; then +AC_ARG_WITH(fastblas, + [ --without-fastblas use included (generic) BLAS and LAPACK], + with_fastblas=$withval, with_fastblas=yes) + +if test "$with_fastblas" = no; then BLAS_LIBS=" " -elif test "$with_fastblas" != "yes"; then +elif test "$with_fastblas" != yes; then # user specified a BLAS library to try on the command line AC_CHECK_LIB($with_fastblas, $dgemm_func, BLAS_LIBS="-l$with_fastblas", , $FLIBS) @@ -620,7 +643,7 @@ AC_CHECK_LIB(blas, $dgemm_func, BLAS_LIBS="-lblas", , $FLIBS) fi -if test "$with_fastblas" = "no"; then +if test "$with_fastblas" = no; then # Unset BLAS_LIBS so that we know below that nothing was found. BLAS_LIBS="" fi @@ -628,13 +651,13 @@ if test "x$BLAS_LIBS" != x; then BLAS_DIR="" # don't build our own BLAS -# Check for LAPACK library. Note that ATLAS has its own liblapack.a, -# which is designed to be combined with the real LAPACK. cheev is a -# function in the real LAPACK but not in ATLAS's version, so this -# (hopefully) insures that we are getting the real LAPACK. Note also -# that on some systems, LAPACK is included in the math library -# (e.g. DXML) that we already linked to above...we detect this by -# doing AC_CHECK_FUNC if -llapack isn't found: +### Check for LAPACK library. Note that ATLAS has its own liblapack.a, +### which is designed to be combined with the real LAPACK. cheev is a +### function in the real LAPACK but not in ATLAS's version, so this +### (hopefully) insures that we are getting the real LAPACK. Note also +### that on some systems, LAPACK is included in the math library +### (e.g. DXML) that we already linked to above...we detect this by +### doing AC_CHECK_FUNC if -llapack isn't found: AC_CHECK_LIB(lapack, $cheev_func, [BLAS_LIBS="-llapack $BLAS_LIBS"; LAPACK_DIR=""], @@ -794,7 +817,7 @@ fi RLD_FLAG='-R $(octlibdir)' # Template closures in archive libraries need a different mechanism. - if test "$GXX" = "yes"; then + if test "$GXX" = yes; then true else TEMPLATE_AR="$CXX" @@ -1353,6 +1376,8 @@ C++ compiler: $CXX $XTRA_CXXFLAGS $CXXFLAGS Fortran compiler: $FORT Fortran libraries: $FLIBS + BLAS libraries: $BLAS_LIBS + HDF5 libraries: $HDF5_LIBS Use GNU readline: $USE_READLINE Default pager: $DEFAULT_PAGER gnuplot: $GNUPLOT_BINARY diff --git a/test/ChangeLog b/test/ChangeLog --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2001-04-24 Christoph Spiel + + * Makefile.in (check): Allow user to specify which .exp file to run. + 2000-06-07 Ben Sapp * octave.test/quad/quad-1.m: Use absolute value of difference diff --git a/test/Makefile.in b/test/Makefile.in --- a/test/Makefile.in +++ b/test/Makefile.in @@ -45,7 +45,7 @@ $(SET_LD_LIBRARY_PATH) $(RUNTEST) \ OCTAVE="$(OCTAVE_BINARY)" \ OCTAVE_SCRIPT_PATH="$(OCTAVE_SCRIPT_PATH)" \ - --tool octave --srcdir $(srcdir) $(RUNTEST_FLAGS); \ + --tool octave --srcdir $(srcdir) $(RUNTEST_FLAGS) $(testsuite); \ else \ echo "***"; \ echo "*** Sorry, I can't run tests without DejaGnu"; \ diff --git a/test/octave.test/eval-catch/eval-catch-1.m b/test/octave.test/eval-catch/eval-catch-1.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-1.m @@ -0,0 +1,1 @@ +eval ("clear a; a;", ""); diff --git a/test/octave.test/eval-catch/eval-catch-10.m b/test/octave.test/eval-catch/eval-catch-10.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-10.m @@ -0,0 +1,2 @@ +eval ("eval (\"clear a; a;\", \"error (strcat (\\\"rethrow: \\\", __error_text__));\");", + "__error_text__"); diff --git a/test/octave.test/eval-catch/eval-catch-2.m b/test/octave.test/eval-catch/eval-catch-2.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-2.m @@ -0,0 +1,1 @@ +eval ("", "1"); diff --git a/test/octave.test/eval-catch/eval-catch-3.m b/test/octave.test/eval-catch/eval-catch-3.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-3.m @@ -0,0 +1,2 @@ +eval ("clear a; a; 1", ""); +2 diff --git a/test/octave.test/eval-catch/eval-catch-4.m b/test/octave.test/eval-catch/eval-catch-4.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-4.m @@ -0,0 +1,1 @@ +eval ("clear a; a;", "1"); diff --git a/test/octave.test/eval-catch/eval-catch-5.m b/test/octave.test/eval-catch/eval-catch-5.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-5.m @@ -0,0 +1,2 @@ +eval ("clear a; a;", "__error_text__"); +__error_text__ diff --git a/test/octave.test/eval-catch/eval-catch-6.m b/test/octave.test/eval-catch/eval-catch-6.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-6.m @@ -0,0 +1,2 @@ +eval ("error (\"user-defined error\");", "__error_text__"); +__error_text__ diff --git a/test/octave.test/eval-catch/eval-catch-7.m b/test/octave.test/eval-catch/eval-catch-7.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-7.m @@ -0,0 +1,5 @@ +function ms = mangle (s) + ## Wrap angle brackets around S. + ms = strcat ("<", s, ">"); +endfunction +eval ("clear a; a;", "mangle (__error_text__)"); diff --git a/test/octave.test/eval-catch/eval-catch-8.m b/test/octave.test/eval-catch/eval-catch-8.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-8.m @@ -0,0 +1,2 @@ +eval ("eval (\"clear a; a;\", \"__error_text__\"); clear b; b;", + "__error_text__"); diff --git a/test/octave.test/eval-catch/eval-catch-9.m b/test/octave.test/eval-catch/eval-catch-9.m new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch-9.m @@ -0,0 +1,2 @@ +eval ("clear a; a;", + "eval (\"clear b; b;\", \"__error_text__\"); __error_text__"); diff --git a/test/octave.test/eval-catch/eval-catch.exp b/test/octave.test/eval-catch/eval-catch.exp new file mode 100644 --- /dev/null +++ b/test/octave.test/eval-catch/eval-catch.exp @@ -0,0 +1,50 @@ +## parse empty try string +set test eval-catch-1 +set prog_output "^$" +do_test eval-catch-1.m + +## parse empty catch string +set test eval-catch-2 +set prog_output "^$" +do_test eval-catch-2.m + +## suppress error; do not execute code after error +set test eval-catch-3 +set prog_output "ans = 2" +do_test eval-catch-3.m + +## execute catch clause +set test eval-catch-4 +set prog_output "ans = 1" +do_test eval-catch-4.m + +## define __error_text__ *only* within catch-string +set test eval-catch-5 +set prog_output "__error_text__ = `a' undefined.*\n\n__error_text__ = $" +do_test eval-catch-5.m + +## throw a user-defined error +set test eval-catch-6 +set prog_output "__error_text__ = user-defined error\n\n__error_text__ = $" +do_test eval-catch-6.m + +## pass __error_text__ to user-defined subroutine +set test eval-catch-7 +set prog_output "ans = <`a' undefined.*\n>" +do_test eval-catch-7.m + +## handle nested eval: eval in try-string +set test eval-catch-8 +set prog_output "__error_text__ = `a' undefined.*\n\n__error_text__ = `b' undefined.*\n$" +do_test eval-catch-8.m + +## handle nested eval: eval nested in catch-string +set test eval-catch-9 +set prog_output "__error_text__ = `a' undefined.*\n\n__error_text__ = `b' undefined.*\n$" +do_test eval-catch-9.m + +## re-throw an error +set test eval-catch-10 +set prog_output "__error_text__ = rethrow: `a' undefined.*\n" +do_test eval-catch-10.m + diff --git a/test/octave.test/try/try-1.m b/test/octave.test/try/try-1.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-1.m @@ -0,0 +1,5 @@ +try +catch + 1 +end_try_catch +2 diff --git a/test/octave.test/try/try-10.m b/test/octave.test/try/try-10.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-10.m @@ -0,0 +1,10 @@ +try + try + clear a + a; + catch + error (strcat ("rethrow: ", __error_text__)); + end_try_catch +catch + __error_text__ +end_try_catch diff --git a/test/octave.test/try/try-2.m b/test/octave.test/try/try-2.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-2.m @@ -0,0 +1,6 @@ +try + clear a + a; +catch +end_try_catch +1 diff --git a/test/octave.test/try/try-3.m b/test/octave.test/try/try-3.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-3.m @@ -0,0 +1,7 @@ +try + clear a + a; + 1 +catch +end_try_catch +2 diff --git a/test/octave.test/try/try-4.m b/test/octave.test/try/try-4.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-4.m @@ -0,0 +1,6 @@ +try + clear a + a; +catch + 1 +end_try_catch diff --git a/test/octave.test/try/try-5.m b/test/octave.test/try/try-5.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-5.m @@ -0,0 +1,7 @@ +try + clear a; + a; +catch + __error_text__ +end_try_catch +__error_text__ diff --git a/test/octave.test/try/try-6.m b/test/octave.test/try/try-6.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-6.m @@ -0,0 +1,5 @@ +try + error ("user-defined error") +catch + __error_text__ +end_try_catch diff --git a/test/octave.test/try/try-7.m b/test/octave.test/try/try-7.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-7.m @@ -0,0 +1,10 @@ +function ms = mangle (s) + ## Wrap angle brackets around S. + ms = strcat ("<", s, ">"); +endfunction +try + clear a + a; +catch + mangle (__error_text__) +end_try_catch diff --git a/test/octave.test/try/try-8.m b/test/octave.test/try/try-8.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-8.m @@ -0,0 +1,12 @@ +try + try + clear a + a; + catch + __error_text__ + end_try_catch + clear b + b; +catch + __error_text__ +end_try_catch diff --git a/test/octave.test/try/try-9.m b/test/octave.test/try/try-9.m new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try-9.m @@ -0,0 +1,12 @@ +try + clear a + a; +catch + try + clear b + b; + catch + __error_text__ + end_try_catch + __error_text__ +end_try_catch diff --git a/test/octave.test/try/try.exp b/test/octave.test/try/try.exp new file mode 100644 --- /dev/null +++ b/test/octave.test/try/try.exp @@ -0,0 +1,49 @@ +## parse empty try body +set test try-1 +set prog_output "ans = 2" +do_test try-1.m + +## parse empty catch body +set test try-2 +set prog_output "ans = 1" +do_test try-2.m + +## supress error; do not execute code after error +set test try-3 +set prog_output "ans = 2" +do_test try-3.m + +## execute catch-clause +set test try-4 +set prog_output "ans = 1" +do_test try-4.m + +## define __error_text__ *only* within catch-clause +set test try-5 +set prog_output "__error_text__ = `a' undefined.*\n\n__error_text__ = $" +do_test try-5.m + +## throw user-defined error +set test try-6 +set prog_output "__error_text__ = user-defined error\n" +do_test try-6.m + +## pass __error_text__ to user-defined subroutine +set test try-7 +set prog_output "ans = <`a' undefined.*\n>" +do_test try-7.m + +## handle nested try-catch-block: try nested in try +set test try-8 +set prog_output "__error_text__ = `a' undefined.*\n\n__error_text__ = `b' undefined.*\n$" +do_test try-8.m + +## handle nested try-catch-block: try nested in catch +set test try-9 +set prog_output "__error_text__ = `a' undefined.*\n\n__error_text__ = `b' undefined.*\n$" +do_test try-9.m + +## re-throw an error +set test try-10 +set prog_output "__error_text__ = rethrow: `a' undefined.*\n" +do_test try-10.m