Unidata / netcdf-c

Official GitHub repository for netCDF-C libraries and utilities.
BSD 3-Clause "New" or "Revised" License
511 stars 263 forks source link

`--disable-hdf5` configuration option doesn't work #2576

Open hyoklee opened 1 year ago

hyoklee commented 1 year ago

I'm building netcdf-c-4.9.0 using the tar.gz file on Ubuntu latest GitHub Action.

Here are the steps to reproduce:

          wget https://downloads.unidata.ucar.edu/netcdf-c/4.9.0/netcdf-c-4.9.0.tar.gz
          tar zxvf netcdf-c-4.9.0.tar.gz
          cd netcdf-c-4.9.0
          ./configure --enable-hdf4 --disable-hdf5 --disable-nczarr --disable-dap --disable-cdf5 --disable-netcdf-4
          make

It seems that libtool still looks for HDF5 API:

2023-01-04T21:41:44.8418182Z libtool: link: gcc -fno-strict-aliasing -o .libs/ncgen3 main.o load.o escapes.o getfill.o init.o genlib.o ncgeny.o  ../liblib/.libs/libnetcdf.so -lmfhdf -ldf -ljpeg -lm -lbz2 -lzstd -lxml2
2023-01-04T21:41:44.8817322Z /usr/bin/ld: ../liblib/.libs/libnetcdf.so: undefined reference to `NC4_inq_type_equal'
2023-01-04T21:41:44.8822284Z /usr/bin/ld: ../liblib/.libs/libnetcdf.so: undefined reference to `HDF5_inq_dim'
DennisHeimbigner commented 1 year ago

You cannot have hdf4 without also enabling hdf5.

hyoklee commented 1 year ago

Why? Is this a new feature for 4.9.0? Why doesn't configure check the conflicting options and tell the user?

DennisHeimbigner commented 1 year ago

Mea culpa. The only excuse I can offer is that the number of combinations that we have to check is very large. Sometimes things slip thru the cracks.