# HG changeset patch # User jwe # Date 1074132719 0 # Node ID fcab389ad2919eac230ffa0d277d07e943b4d23d # Parent f31b93ef2ca0f942c49cd68713a4f32790e05894 [project @ 2004-01-15 02:11:59 by jwe] diff -r f31b93ef2ca0 -r fcab389ad291 ChangeLog --- a/ChangeLog Wed Jan 14 02:06:23 2004 +0000 +++ b/ChangeLog Thu Jan 15 02:11:59 2004 +0000 @@ -1,3 +1,8 @@ +2004-01-14 David Bateman + + * configure.in: Test for the presence of the function + H5Gget_num_objs in HDF5 library, and define HAVE_H5GGET_NUM_OBJS. + 2004-01-06 Per Persson * aclocal.m4 (OCTAVE_CXX_PREPENDS_UNDERSCORE): Recognize diff -r f31b93ef2ca0 -r fcab389ad291 README.Windows --- a/README.Windows Wed Jan 14 02:06:23 2004 +0000 +++ b/README.Windows Thu Jan 15 02:11:59 2004 +0000 @@ -1,13 +1,13 @@ -The following is my current best set of directions for building Octave -from sources on a Windows system using the Cygwin tools. If you -already have Cygwin installed, you may need to update your -installation of tools to include those mentioned below. +The following is my current best set of directions for installing +Octave on a Windows system using either a binary package or by +installing from sources using the Cygwin tools. If you already have +Cygwin installed, you may need to update your installation of tools to +include those mentioned below. Following these steps should give you an Octave installation that includes all the necessary tools for building dynamically linked functions (.oct files). - 1. Use your favorite browser to view the page http://www.cygwin.com 2. Click on the "Install or update now" link. @@ -48,10 +48,34 @@ 9. Choose a download site. One that is "near" you on the net is probably best. -10. Select packages. The defaults are not enough to build all of - Octave from sources. In addition to the default set of packages, - you should select the following packages from the following - categories: + If you want to install a binary package of Octave, also add the + User URL + + ftp://ftp.octave.org/pub/octave/cygwin + + in the dialog (there is a textbox at the bottom with an Add + button to the right -- enter the URL in the textbox and click + the Add button). + +10. Select packages. + + Binary and Source installations: + + Select the gnuplot package from the Graphics category. The + gnuplot package from ftp.octave.org will give you the Windows + binary repackaged for Cygwin. If you select the gnuplot package + from one of the Cygwin mirrors, you will get a recent 3.8 beta + version (pre 4.0 release). + + Additional packages for binary install: + + Also select the Octave packages you want from the Math category. + + Additional packages for source compile and install: + + The defaults are not enough to build all of Octave from sources. + In addition to the default set of packages, you should select the + following packages from the following categories: Archive: unzip Devel: autoconf, binutils, bison, cvs, dejagnu, flex, gcc, @@ -70,57 +94,9 @@ run, displaying some output in a terminal window. It will take a few minutes. -12. Download and install Gnuplot: - - a. Use your favorite browser to go to http://www.gnuplot.info and - download a binary package of gnuplot for Windows. At the time - of this writing, it was available from the gnuplot ftp site in - the file gp373w32.zip. - - b. When you download the zip file, place it in your Cygwin /tmp - directory. This directory will be called something like - c:\cygwin\tmp in Windows (the precise location depends on where - you chose to install Cygwin). - - c. After downloading the zip file, start Cygwin (actually a bash - shell running in a terminal window) by clicking on the Cygwin - desktop icon or use the start menu item that you created when - you installed Cygwin. - - d. Run the command - - unzip /tmp/gp373w32.zip - - to unpack the zip archive. This command should create a - subdirectory called gp373w32 in your Cygwin home directory. + Skip to step 17 if you are installing the binary package. - e. Move the gnuplot programs and help file to the Cygwin bin - directory: - - mv gp373w32/pgnuplot.exe /usr/local/bin - mv gp373w32/wgnupl32.exe /usr/local/bin - mv gp373w32/WGNUPLOT.HLP /usr/local/bin - - Make sure that executable files have execute permissions set: - - chmod a+rx /usr/local/bin/pgnuplot.exe - chmod a+rx /usr/local/bin/wgnupl32.exe - - f. Test it by typing the command - - wgnupl32 - - This command should bring up a gnuplot command window. Try - plotting something by typing - - plot sin(x) - - at the gnuplot prompt. This command should bring up a plot - window displaying a sine wave. - - g. close gnuplot and start the Octave installation. - -13. Get the Octave sources, either from a current snapshot +12. Get the Octave sources, either from a current snapshot distribution or from CVS. You should check the web page http://www.octave.org/download.html @@ -188,10 +164,8 @@ ./autogen.sh - then continue with step 14 below. - -14. Configure Octave by running the command +13. Configure Octave by running the command ./configure --enable-shared --disable-static @@ -203,7 +177,7 @@ files) in addition to shared libraries, but the build will take about twice as long to complete. -15. Build the Octave binary by running the command +14. Build the Octave binary by running the command make @@ -211,7 +185,7 @@ that all code is position independent. You may safely ignore these warnings. -16. (OPTIONAL) Run Octave's regression test suite by running the +15. (OPTIONAL) Run Octave's regression test suite by running the command make check @@ -221,11 +195,11 @@ writing, there are 4 "expected" failures related to the try-catch and eval commands. You may safely ignore those failures. -17. Complete the installation by running the command +16. Complete the installation by running the command make install -18. Try starting Octave by running the command +17. Try starting Octave by running the command octave @@ -235,7 +209,7 @@ at the Octave prompt to see if you can create a plot. -19. Try to build a .oct file and run it: +18. Try to build a .oct file and run it: cd examples mkoctfile hello.cc @@ -244,6 +218,10 @@ octave:1> hello Hello, world! + If you are doing a binary package install, the examples should be + installed in the /usr/share/doc/octave/... XXX FIXME XXX + + John W. Eaton @@ -251,4 +229,4 @@ University of Wisconsin-Madison Department of Chemical Engineering -Sun Jan 11 12:19:47 2004 +Wed Jan 14 13:37:15 2004 diff -r f31b93ef2ca0 -r fcab389ad291 configure.in --- a/configure.in Wed Jan 14 02:06:23 2004 +0000 +++ b/configure.in Thu Jan 15 02:11:59 2004 +0000 @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.441 $) +AC_REVISION($Revision: 1.442 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -387,7 +387,9 @@ WITH_HDF5=true HDF5_LIBS="-l$hdf5_lib -lz" LIBS="$HDF5_LIBS $LIBS" - AC_DEFINE(HAVE_HDF5, 1, [Define if HDF5 is available.])])])]) + AC_DEFINE(HAVE_HDF5, 1, [Define if HDF5 is available.]) + AC_CHECK_LIB($hdf5_lib, H5Gget_num_objs, [ + AC_DEFINE(HAVE_H5GGET_NUM_OBJS, 1, [Define if HDF5 has H5Gget_num_objs.])])])])]) fi # Checks for FFTW header and library. diff -r f31b93ef2ca0 -r fcab389ad291 src/ChangeLog --- a/src/ChangeLog Wed Jan 14 02:06:23 2004 +0000 +++ b/src/ChangeLog Thu Jan 15 02:11:59 2004 +0000 @@ -1,3 +1,11 @@ +2004-01-14 David Bateman + + * ov-cell.cc (octave_cell::load_hdf5): Fix for HDF5 version 1.6 + handling of number of objects in a group. + * ov-struct.cc (octave_struct::load_hdf5): Likewise. + * ov-list.cc (octave_list::load_hdf5): Likewise. + * ls-hdf5.cc (read_hdf5_data): Likewise. + 2004-01-13 John W. Eaton * ls-hdf5.h: Surround contents with #if defined (HAVE_HDF5). diff -r f31b93ef2ca0 -r fcab389ad291 src/ls-hdf5.cc --- a/src/ls-hdf5.cc Wed Jan 14 02:06:23 2004 +0000 +++ b/src/ls-hdf5.cc Thu Jan 15 02:11:59 2004 +0000 @@ -444,8 +444,15 @@ || (vers_major == 1 && (vers_minor < 2 || (vers_minor == 2 && vers_release < 2)))); - herr_t H5Giterate_retval = H5Giterate (hs.file_id, "/", &hs.current_item, - hdf5_read_next_data, &d); + herr_t H5Giterate_retval = -1; + +#ifdef HAVE_H5GGET_NUM_OBJS + hsize_t num_obj = 0; + H5Gget_num_objs (hs.file_id, &num_obj); + if (hs.current_item < static_cast (num_obj)) +#endif + H5Giterate_retval = H5Giterate (hs.file_id, "/", &hs.current_item, + hdf5_read_next_data, &d); if (have_h5giterate_bug) { diff -r f31b93ef2ca0 -r fcab389ad291 src/ov-cell.cc --- a/src/ov-cell.cc Wed Jan 14 02:06:23 2004 +0000 +++ b/src/ov-cell.cc Thu Jan 15 02:11:59 2004 +0000 @@ -820,12 +820,24 @@ if (have_h5giterate_bug) current_item = 2; // Skip row/columns items in group +#ifdef HAVE_H5GGET_NUM_OBJS + hsize_t num_obj = 0; + H5Gget_num_objs (loc_id, &num_obj); +#endif + for (int j = 0; j < nc; j++) { for (int i = 0; i < nr; i++) { - retval2 = H5Giterate (loc_id, name, ¤t_item, - hdf5_read_next_data, &dsub); + +#ifdef HAVE_H5GGET_NUM_OBJS + if (current_item >= static_cast (num_obj)) + retval2 = -1; + else +#endif + retval2 = H5Giterate (loc_id, name, ¤t_item, + hdf5_read_next_data, &dsub); + if (retval2 <= 0) break; diff -r f31b93ef2ca0 -r fcab389ad291 src/ov-list.cc --- a/src/ov-list.cc Wed Jan 14 02:06:23 2004 +0000 +++ b/src/ov-list.cc Thu Jan 15 02:11:59 2004 +0000 @@ -677,11 +677,20 @@ hdf5_callback_data dsub; - herr_t retval2; + herr_t retval2 = -1; octave_value_list lst; int current_item = 0; +#ifdef HAVE_H5GGET_NUM_OBJS + hsize_t num_obj = 0; + H5Gget_num_objs (loc_id, &num_obj); + + while (current_item < static_cast (num_obj) + && (retval2 = H5Giterate (loc_id, name, ¤t_item, + hdf5_read_next_data, &dsub)) > 0) +#else while ((retval2 = H5Giterate (loc_id, name, ¤t_item, hdf5_read_next_data, &dsub)) > 0) +#endif { lst.append (dsub.tc); diff -r f31b93ef2ca0 -r fcab389ad291 src/ov-struct.cc --- a/src/ov-struct.cc Wed Jan 14 02:06:23 2004 +0000 +++ b/src/ov-struct.cc Thu Jan 15 02:11:59 2004 +0000 @@ -722,8 +722,17 @@ herr_t retval2; Octave_map m; int current_item = 0; +#ifdef HAVE_H5GGET_NUM_OBJS + hsize_t num_obj = 0; + H5Gget_num_objs (loc_id, &num_obj); + + while (current_item < static_cast (num_obj) + && (retval2 = H5Giterate (loc_id, name, ¤t_item, + hdf5_read_next_data, &dsub)) > 0) +#else while ((retval2 = H5Giterate (loc_id, name, ¤t_item, hdf5_read_next_data, &dsub)) > 0) +#endif { m.assign (dsub.name, dsub.tc);