netcdf-c icon indicating copy to clipboard operation
netcdf-c copied to clipboard

configure fails on older versions of Linux for netcdf-c-4.9.0

Open jswhit opened this issue 3 years ago • 5 comments
trafficstars

This is on NOAA's HPC system (hera), which I believe is CentOS.

In config.log I see:

configure:22699: checking size of off_t
configure:22704: gcc -o conftest  -fno-strict-aliasing -I//scratch2/BMC/gsienkf/whitaker/conda-envs/mpi4py/include -L/scratch2/BMC/gsienkf/whitaker/conda-envs/mpi4py/lib conftest.c -ldl -lbz2 -lzstd -lxml2 -lcurl  >&5
configure:22704: $? = 0
configure:22704: ./conftest
./conftest: error while loading shared libraries: libzstd.so.1: cannot open shared object file: No such file or directory
configure:22704: $? = 127
configure: program exited with status 127

and then

configure:22708: error: in `/scratch2/BMC/gsienkf/whitaker/python/netcdf-c':
configure:22710: error: cannot compute sizeof (off_t)
See `config.log' for more details

So the sizeof (off_t) test is failing because of an error loading the libzstd shared lib?

I'm also seeing this in some of the github actions runners for netcdf4-python.

jswhit avatar Jun 21 '22 14:06 jswhit

.> /conftest: error while loading shared libraries: libzstd.so.1: cannot open shared object file: No such file or directory

This would indicate to me that libzstd did not get installed correctly.

DennisHeimbigner avatar Jun 21 '22 18:06 DennisHeimbigner

could be, but the mystery then is why the test for zstd passed

configure:6676: gcc -o conftest  -fno-strict-aliasing -I//scratch2/BMC/gsienkf/whitaker/conda-envs/mpi4py/include -L/scratch2/BMC/gsienkf/whitaker/conda-envs/mpi4py/lib conftest.c -lzstd  -lxml2 -lcurl  >&5
configure:6676: $? = 0
configure:6693: result: -lzstd
configure:6705: checking whether libzstd library is available
configure:6707: result: yes

jswhit avatar Jun 21 '22 19:06 jswhit

No idea what is going on.

DennisHeimbigner avatar Jun 21 '22 19:06 DennisHeimbigner

I bumped into the same issue... - the system zstd is not installed, but the gcc got built with a separate zstd, and somehow the path to this libzstd "got lost". So adding this directory with the libzstd to LDFLAGS "fixes" this problem (at. least for me) ./configure ......... LDFLAGS="-L/lib/ -Wl,-rpath,/lib/" (this is scientific linux 7.7 here - hope it helps as an inspiration ;-))

sb22bs avatar Jul 11 '22 22:07 sb22bs

Thanks for the insight.

DennisHeimbigner avatar Jul 11 '22 22:07 DennisHeimbigner

Thanks @sb22bs for share it.

jjpaulo2 avatar Mar 07 '23 18:03 jjpaulo2