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.
Hello Shucai,
For what purpose are you building netCDF from the GEMPAK extlibs packages? I
see that you are manually running configure in order to set the prefix
directory, and it appears that you are building the GEMPAK netCDF package with
netcdf4 enabled (compare with the GEMPAK netCDF Makefile which config's the
package without netcdf4 support (which is not needed in GEMPAK)):
lnetcdf: INSTALLDIR
-@cd netcdf; \
pwd; \
touch macros.make; \
$(MAKE) distclean ; \
./configure --disable-dap --disable-netcdf-4 '--prefix=$(OS_ROOT)'; \
$(MAKE) all install
So first understand that because you do not include the --disable-netcdf-4
flag, the netCDF build will attempt to find hdf5 libraries.
Then understand that on your system, the hdf5 libraries that are found are from
AWIPS II:
libtool: link: gcc -I/usr1/sguan/gempak/workspace/nawips/gempak/include
...
-L/usr/X11R6/lib64 ../liblib/.libs/libnetcdf.so
/awips2/tools/lib/libhdf5_hl.so /awips2/tools/lib/libhdf5.so -ldl -lm
-lz -Wl,-rpath
-Wl,/usr1/sguan/gempak/workspace/nawips/os/linux2.6.32_x86_64/lib
-Wl,-rpath -Wl,/awips2/tools/lib
../liblib/.libs/libnetcdf.so: undefined reference to
`H5P_CLS_DATASET_ACCESS_ID_g'
Notice /awips2/tools/lib/libhdf5.so and /awips2/tools/lib/libhdf5_hl.so. It is
this AWIPS II version of libhdf5 that has undefined references.
-Michael
> Dear Sir,
>
> I have installed HDF5_v1.8.15 and zlib_v1.2.8 in
> /usr1/sguan/gempak/workspace/nawips/os/linux2.6.32_x86_64. Source codes
> are in /usr1/sguan/gempak/workspace/nawips/extlibs.
>
> However, I have trouble to install netCDF_v4.3.3.1:
> 1) cd /usr1/sguan/gempak/workspace/nawips/extlibs/netCDF/v4.3.3.1
> 2) ./configure
> --prefix=/usr1/sguan/gempak/workspace/nawips/os/linux2.6.32_x86_64
> 3) make
> I get:
>
> libtool: link: gcc -I/usr1/sguan/gempak/workspace/nawips/gempak/include
> -I/usr1/sguan/gempak/workspace/nawips/os/linux2.6.32_x86_64/include
> -DLinux -DUNDERSCORE -I/usr/X11R6/include
> -I/awips2/python/include/python2.7 -DWITHPYTHON -DG_64BIT -g -Wall -W
> -Wno-unused-parameter -Wfloat-equal -Wundef -Wpointer-arith
> -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return
> -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> -Wmissing-noreturn -Wpacked -Wredundant-decls -Wnested-externs
> -Wunreachable-code -Winline -Wlong-long -DG_64BIT -g -o .libs/ncgen3
> main.o load.o escapes.o getfill.o init.o genlib.o ncgentab.o
> -L/awips2/python/lib
> -L/usr1/sguan/gempak/workspace/nawips/os/linux2.6.32_x86_64/lib
> -L/usr/X11R6/lib64 ../liblib/.libs/libnetcdf.so
> /awips2/tools/lib/libhdf5_hl.so /awips2/tools/lib/libhdf5.so -ldl -lm
> -lz -Wl,-rpath
> -Wl,/usr1/sguan/gempak/workspace/nawips/os/linux2.6.32_x86_64/lib
> -Wl,-rpath -Wl,/awips2/tools/lib
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_DATASET_ACCESS_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_DATASET_CREATE_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_DATASET_XFER_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_GROUP_CREATE_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_FILE_ACCESS_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_FILE_CREATE_ID_g'
> collect2: ld returned 1 exit status
> make[2]: *** [ncgen3] Error 1
> make[2]: Leaving directory
> `/usr1/sguan/gempak/workspace/nawips/extlibs/netCDF/v4.3.3.1/ncgen3'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory
> `/usr1/sguan/gempak/workspace/nawips/extlibs/netCDF/v4.3.3.1'
> make: *** [all] Error 2
> sguan:v4.3.3.1/ 278 > pwd
> /usr1/sguan/gempak/workspace/nawips/extlibs/netCDF/v4.3.3.1
>
> I find H5P_CLS_DATASET_ACCESS_ID_g in
> /usr1/sguan/gempak/workspace/nawips/os/linux2.6.32_x86_64/include/H5Ppublic.h
>
> sguan:include/ 202 > grep -i H5P_CLS_DATASET_ACCESS_ID_g *
> H5Ppublic.h:#define H5P_DATASET_ACCESS (H5OPEN
> H5P_CLS_DATASET_ACCESS_ID_g)
> H5Ppublic.h:H5_DLLVAR hid_t H5P_CLS_DATASET_ACCESS_ID_g;
> sguan:include/ 203 > pwd
> /usr1/sguan/gempak/workspace/nawips/os/linux2.6.32_x86_64/include
>
> What is your suggestion to fix the errors:
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_DATASET_ACCESS_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_DATASET_CREATE_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_DATASET_XFER_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_GROUP_CREATE_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_FILE_ACCESS_ID_g'
> ../liblib/.libs/libnetcdf.so: undefined reference to
> `H5P_CLS_FILE_CREATE_ID_g'
>
> Thank you!
>
> Shucai Guan
>
>
>
Ticket Details
===================
Ticket ID: XLB-742768
Department: Support GEMPAK
Priority: Normal
Status: Open