This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Mi Zhou, > I'm trying to build netcdf-4.2.1.1. I got errors doing configure > "configure: error: Can't find or link to the hdf5 library. Use > --disable-netcdf-4, or see config.log for errors." > > Could you help? Attached is the config log. > > And here is what's in /hpcf/libs/hdf5/install/1.8.9/lib > > -rw-r--r-- 1 mzhou hpcfadmins 5866960 Sep 26 09:02 libhdf5.a > -rw-r--r-- 1 mzhou hpcfadmins 205578 Sep 26 09:02 libhdf5_hl.a > -rwxr-xr-x 1 mzhou hpcfadmins 1013 Sep 26 09:02 libhdf5_hl.la > lrwxrwxrwx 1 mzhou hpcfadmins 19 Sep 26 09:02 libhdf5_hl.so -> > libhdf5_hl.so.7.0.3 > lrwxrwxrwx 1 mzhou hpcfadmins 19 Sep 26 09:02 libhdf5_hl.so.7 -> > libhdf5_hl.so.7.0.3 > -rwxr-xr-x 1 mzhou hpcfadmins 136347 Sep 26 09:02 libhdf5_hl.so.7.0.3 > -rwxr-xr-x 1 mzhou hpcfadmins 947 Sep 26 09:02 libhdf5.la > -rw-r--r-- 1 mzhou hpcfadmins 2930 Sep 26 09:02 libhdf5.settings > lrwxrwxrwx 1 mzhou hpcfadmins 16 Sep 26 09:02 libhdf5.so -> > libhdf5.so.7.0.3 > lrwxrwxrwx 1 mzhou hpcfadmins 16 Sep 26 09:02 libhdf5.so.7 -> > libhdf5.so.7.0.3 > -rwxr-xr-x 1 mzhou hpcfadmins 3185995 Sep 26 09:02 libhdf5.so.7.0.3 The config.log error was: configure:16132: gcc -o conftest -g -O2 -I/hpcf/libs/hdf5/install/1.8.9/include -I/hpcf/libs/hdf5/install/1.8.9/lib conftest.c -lhdf5 -lm -lcurl >&5 /usr/bin/ld: cannot find -lhdf5 The compiler line should have been: gcc -o conftest -g -O2 -I/hpcf/libs/hdf5/install/1.8.9/include -L/hpcf/libs/hdf5/install/1.8.9/lib conftest.c -lhdf5 -lm -lcurl >&5 which makes me wonder if you set LDFLAGS=-I/hpcf/libs/hdf5/install/1.8.9/lib instead of LDFLAGS=-L/hpcf/libs/hdf5/install/1.8.9/lib If so, try using "-L" instead of "-I" and see if that makes the configure work. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: DPO-719222 Department: Support netCDF Priority: Normal Status: Closed