Orion Poplawski <orion@xxxxxxxxxxxxx> writes:
> How to determine if netcdf was compiled with SZIP or not? Any kind of
> define in netcdf.h?
>
> Trying to build cdo-1.4.0.1, and it uses the following (incorrect) test:
>
> #if defined (NC_NETCDF4) && defined (NC_SZIP_NN_OPTION_MASK)
>
> My netcdf 4.1.0 is not compiled with SZIP, yet:
>
> /* Szip options. */
> #define NC_SZIP_EC_OPTION_MASK 4
> #define NC_SZIP_NN_OPTION_MASK 32
> #define NC_SZIP_MAX_PIXELS_PER_BLOCK 32
>
> are all present in netcdf.h.
>
> Thank you,
>
> Orion
Howdy Orion!
I was going to say: use nc-config, the new utility that tells you about
your specific netCDF installation. Then I noticed that it did know about
szlib, so I added it.
Now the nc-config --all output looks like this:
This netCDF 4.1 has been built with the following features:
--cc -> cc
--cflags -> -I/usr/local/include
--libs -> -L/usr/local/lib -lnetcdf -lcurl
--cxx -> c++
--has-c++ -> yes
--fc -> gfortran
--fflags -> -g -O2 -I/usr/local/include
--flibs -> -L/usr/local/lib -lnetcdf -lcurl
--has-f77 -> yes
--has-f90 -> yes
--has-dap -> yes
--has-nc2 -> yes
--has-nc4 -> no
--has-hdf5 -> no
--has-hdf4 -> no
--has-szlib -> no
--prefix -> /usr/local
--includedir-> /usr/local/include
--version -> netCDF 4.1
You can also call it with the --has-szlib option to get a yes/no answer:
bash-3.2$ ./nc-config --has-szlib
no
Does this meet your needs?
There is nothing in the netcdf.h file, because we don't actually
construct the netcdf.h file at configure time, we have two versions of
it, one for netCDF-3 and one for netCDF-4, and at configure time we
decide which one to use. This is something we may change in a future
release, as it would be handier to be able to provide a pre-processor
macro, such as you request.
The three szlib constants don't need to be in netcdf.h at all, now that
we've removed the capability of writing szipped files from netCDF-4. So
I have moved them to another spot - they will no longer be in netcdf.h,
whether or not szlib is use.
All of these changes will be in tonight's snapshot release:
ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-daily.tar.gz
BTW, this is the sort of question that would be better sent to
support-netcdf@xxxxxxxxxxxxxxxx.
Thanks,
Ed
--
Ed Hartnett -- ed@xxxxxxxxxxxxxxxx