help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octcdf package installation with NetCDF4


From: E. Joshua Rigler
Subject: Octcdf package installation with NetCDF4
Date: Tue, 6 May 2008 15:58:56 -0600

Hopefully Alexander Barth is paying attention, so he might incorporate
a small fix into his Octcdf package that anticipates certain changes
in the upcoming NetCDF 4 release, but here's what I did to get Octcdf
working with a development snapshot of NetCDF 4:

For starters, while I leave most of the compilation and installation
of NetCDF4 as an exercise for the reader, note that this is a
substantial deviation from the current 'mature' version, namely NetCDF
v3.6.  As I understand it, NetCDF 4 relies heavily on the recently
released HDF5 v1.8 for its low-level data model.  HDF5 v1.8, in turn,
now seems to have two important libraries instead of one, these being
libhdf5.so and libhdf5_hl.so.

Why is this relevant for Octave?  The Octcdf package Autoconf
configure script currently tests for the function nc_open to see if
the libnetcdf.so library is suitable for compiling the netcdf.oct
file.  nc_open in turn relies on functions that originally all resided
in libhdf5.so, but some of which now apparently reside inside
libhdf5_hl.so.  So, if one simply tries to type 'pkg install
octcdf-1.0.9.tar.gz', it will fail when the configure script fails to
ascertain that suitable NetCDF libraries exist, since its attempt to
compile a test function that calls nc_open will fail due to 'undefined
reference' errors.

My Solution:  start Octave and run the pkg install script in the
following manner:

  $> LDFLAGS=-L/path/to/libs CPPFLAGS=-I/path/to/headers LIBS='-lhdf5
-lhdf5_hl' octave -q
  octave:1> pkg install -verbose octcdf-1.0.9.tar.gz

I'm not sure if a more 'permanent' solution lies with the NetCDF
maintainers (can they fix libnetcdf.so to automatically link to both
HDF5 libraries?), or is it up to A. Barth to modify his Octcdf
package's Autoconf script to check for, and link to, both required
HDF5 libraries in a manner similar to my somewhat ad hoc solution?
BTW, I have not tested Octcdf extensively with the new NetCDF 4
libraries, but the Octcdf package's built-in test suite passed.

-EJR


reply via email to

[Prev in Thread] Current Thread [Next in Thread]