Building NetCDF 4.0 on BlueVista

I attempted to compile NetCDF 4.0 myself on BlueVista.  I never got past the HDF5 (w/ parallel support) requirement. The configure script fails to run because it cannot interactively run tests.  Attempting a "local cross-compile" gets the process further, but it fails, again, because it can't run tests during a cross-compile (which it shouldn't attempt, but that's another argument).  By passing environmental variables to emulate "cached" tests, I successfully ran configure:

hdf5_cv_gettimeofday_tz=yes hdf5_cv_vsnprintf_works=yes hdf5_cv_system_scope_threads=yes hdf5_direct_io=yes hdf5_ldouble_to_integer_works=yes hdf5_fp_to_ullong_accurate=yes hdf5_fp_to_ullong_right_maximum=yes hdf5_ldouble_to_uint_accurate=yes hdf5_cv_ullong_to_ldouble_precision=yes hdf5_cv_fp_to_integer_overflow_works=yes hdf5_ldouble_to_llong_accurate=yes hdf5_llong_to_ldouble_correct=yes ./configure --enable-parallel --prefix=/ptmp/nbaile/usr --host=powerpc-ibm-aix5.3.0.0

This was in vain, though, as the make process failed for similar reasons.

Davide was able to compile NetCDF 4.0 (and HDF5 w/ parallel support), by hacking the respective configure scripts and Makefile.  I ran a test run, see Toy Programs, and it seems to work as advertised.

Building Vapor with NetCDF 4.0

Vapor builds cleanly with NetCDF 4.0 libraries (at least on my machine).  I wanted to create a VDC using the newer NetCDF 4.0 file format.  To do this, I had to edit the Vapor source in two places:

lib/vdf/AMRData.cpp
lib/vdf/WaveletBlock3DIO.cpp

In both places, there is a single call to nc__create().  In both places, I changed the NC_64BIT_OFFSET parameter to NC_NETCDF4.  Now raw2vdf, etc. create files in the new NetCDF-4/HDF5 format.  They open and run in Vapor on my machine (with Vapor compiled against NetCDF 4.0) as expected.  They, obviously, don't work on the storm cluster where Vapor is compiled against the older NetCDF version.

As a note, there is no equivalent "64Bit Offset" parameter for the new format.  It shouldn't matter, though.  Any data size restrictions present in the older versions of NetCDF do not show up with the new NetCDF-4/HDF5 format.

Linking NetCDF 4.0 on Blue Vista

After Davide compiled NetCDF 4.0 on the supers, I ran a test program to verify that parallel writes were working. In doing so, I found the needed compiler flags to compile a program with NetCDF 4.0 and parallel write support. Supposedly, the order does matter, but I did not test it. The flags that worked for me were:

mpCC_r -I/ptmp/ddvento/netCDF/include -L/ptmp/ddvento/netCDF/lib -lnetcdf -L/ptmp/ddvento/HDF5/lib -lhdf5_hl -lhdf5 -lz my.cpp

It's probably a good idea to create a Makefile with variables for the directories (since they obviously won't permanently reside in Davide's ptmp directory).

  • No labels