在 Ubuntu 上从源代码安装 netcdf-4.7.4 错误:未声明的标识符

问题描述

过去几天,我一直在尝试从源代码安装带有 C 支持(编译 MPAS-Atmosphere 模型所需)的 NetCDF 4.7.4 版,但我无法克服以下错误。另外,我正在使用官方网站上的说明: https://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html

“make check”时出现错误

../libtool: line 1748: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
nc4mem.c: In function 'NC4_open_image_file':
nc4mem.c:47:25: error: 'H5LT_FILE_IMAGE_DONT_copY' undeclared (first use in this function)
  h5->mem.imageflags |= (H5LT_FILE_IMAGE_DONT_copY | H5LT_FILE_IMAGE_DONT_RELEASE);
                         ^
nc4mem.c:47:25: note: each undeclared identifier is reported only once for each function it appears in
nc4mem.c:47:53: error: 'H5LT_FILE_IMAGE_DONT_RELEASE' undeclared (first use in this function)
  h5->mem.imageflags |= (H5LT_FILE_IMAGE_DONT_copY | H5LT_FILE_IMAGE_DONT_RELEASE);
                                                     ^
nc4mem.c:50:24: error: 'H5LT_FILE_IMAGE_OPEN_RW' undeclared (first use in this function)
  h5->mem.imageflags |= H5LT_FILE_IMAGE_OPEN_RW;
                        ^
nc4mem.c: In function 'NC4_create_image_file':
nc4mem.c:73:27: error: 'H5LT_FILE_IMAGE_OPEN_RW' undeclared (first use in this function)
     h5->mem.imageflags |= H5LT_FILE_IMAGE_OPEN_RW;
                           ^
Makefile:628: recipe for target 'libnchdf5_la-nc4mem.lo' Failed
make[1]: *** [libnchdf5_la-nc4mem.lo] Error 1
make[1]: Leaving directory '/p1-nemo/danilocs/mpaslibs/netcdf-c-4.7.4/libhdf5'
Makefile:707: recipe for target 'check-recursive' Failed
make: *** [check-recursive] Error 1

使用的配置选项是:

CFLAGS='-I${H5DIR}/include' CPPFLAGS='-I${H5DIR}/include -I${ZDIR}/include -I${CURLDIR}/include' LDFLAGS='-L${H5DIR}/lib -L${ZDIR}/lib -L${CURLDIR}/lib' ./configure --prefix=${NCDIR}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)