首页 > 解决方案 > 在 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}

标签: cinstallationcompilationnetcdf

解决方案


推荐阅读