Netcdf 未定义引用错误

Netcdf 未定义引用错误

我目前正在尝试在 ubuntu 上编译 wrf-hydro,在此过程中生成了多个与 netcdf 相关的错误消息。下面是其中的一个例子。我还附上了 nc-config 和 nf-config 文件。如果需要任何其他信息来确定可能的错误来源,请告诉我。感谢您的帮助!

错误信息:

module_hrldas_netcdf_io.f90:(.text+0xaa): undefined reference to 
`__netcdf_MOD_nf90_inq_dimid'
module_hrldas_netcdf_io.f90:(.text+0xec): undefined reference to 
`__netcdf_MOD_nf90_inq_dimid'
module_hrldas_netcdf_io.f90:(.text+0x12e): undefined reference to 
`__netcdf_MOD_nf90_inq_dimid'
module_hrldas_netcdf_io.f90:(.text+0x18c): undefined reference to 
`__netcdf_MOD_nf90_inq_dimid'
module_hrldas_netcdf_io.f90:(.text+0x1ef): undefined reference to 
`__netcdf_MOD_nf90_inq_dimid'
../IO_code/module_hrldas_netcdf_io.o:module_hrldas_netcdf_io.f90: 
(.text+0x24f): more undefined references to `__netcdf_MOD_nf90_inq_dimid' 
follow
../IO_code/module_hrldas_netcdf_io.o: In function 
`__module_hrldas_netcdf_io_MOD_read_additional':
module_hrldas_netcdf_io.f90:(.text+0xa3e): undefined reference to 
`__netcdf_MOD_nf90_open'
module_hrldas_netcdf_io.f90:(.text+0xb42): undefined reference to 
`__netcdf_MOD_nf90_inq_varid'
module_hrldas_netcdf_io.f90:(.text+0xe53): undefined reference to 
`__netcdf_MOD_nf90_get_var_2d_fourbytereal'
module_hrldas_netcdf_io.f90:(.text+0xee3): undefined reference to 
`__netcdf_MOD_nf90_close'
../IO_code/module_hrldas_netcdf_io.o: In function 
`__module_hrldas_netcdf_io_MOD_error_handler':
module_hrldas_netcdf_io.f90:(.text+0x1089): undefined reference to 
`__netcdf_MOD_nf90_strerror'
../IO_code/module_hrldas_netcdf_io.o: In function 
`__module_hrldas_netcdf_io_MOD_get_from_restart_3d':
module_hrldas_netcdf_io.f90:(.text+0x12b3): undefined reference to 
`__netcdf_MOD_nf90_open'
module_hrldas_netcdf_io.f90:(.text+0x169b): undefined reference to 
`__netcdf_MOD_nf90_inq_varid'
module_hrldas_netcdf_io.f90:(.text+0x18b3): undefined reference to 
`__netcdf_MOD_nf90_get_var_3d_fourbytereal'
module_hrldas_netcdf_io.f90:(.text+0x1b0f): undefined reference to 
`__netcdf_MOD_nf90_inq_varid'
module_hrldas_netcdf_io.f90:(.text+0x1d12): undefined reference to 
`__netcdf_MOD_nf90_get_var_3d_fourbytereal'
module_hrldas_netcdf_io.f90:(.text+0x1e35): undefined reference to 
`__netcdf_MOD_nf90_close'
../IO_code/module_hrldas_netcdf_io.o: In function 
`__module_hrldas_netcdf_io_MOD_get_from_restart_2d_integer':
module_hrldas_netcdf_io.f90:(.text+0x1f7c): undefined reference to 
`__netcdf_MOD_nf90_open'
module_hrldas_netcdf_io.f90:(.text+0x2225): undefined reference to 
`__netcdf_MOD_nf90_inq_varid'

nc-配置

This netCDF 4.4.1.1 has been built with the following features: 

--cc        -> gcc
--cflags    -> -I/usr/local/include -I/usr/lib/x86_64-linux-gnu hdf5/serial/include
--libs      -> -L/usr/local/lib -lnetcdf
--has-c++   -> no
--cxx       -> 
--has-c++4  -> no
--cxx4      -> 
--has-fortran-> yes
--fc        -> gfortran
--fflags    -> -I/include
--flibs     -> -L/lib -lnetcdff -L/usr/local/lib -lnetcdf -lnetcdf
--has-f90   -> no
--has-f03   -> yes
--has-dap   -> no
--has-nc2   -> yes
--has-nc4   -> yes
--has-hdf5  -> yes
--has-hdf4  -> no
--has-logging-> no
--has-pnetcdf-> no
--has-szlib -> 
--prefix    -> /usr/local
--includedir-> /usr/local/include
--libdir    -> /usr/local/lib
--version   -> netCDF 4.4.1.1

nf-配置

This netCDF-Fortran 4.4.4 has been built with the following features: 

--cc        -> gcc
--cflags    ->  -I/include -I/usr/local/include
--fc        -> gfortran
--fflags    -> -I/include
--flibs     -> -L/lib -lnetcdff -L/usr/local/lib -lnetcdf -lnetcdf 
--has-f90   -> no
--has-f03   -> yes
--has-nc2   -> yes
--has-nc4   -> yes
--prefix    -> 
--includedir-> /include
--version   -> netCDF-Fortran 4.4.4

相关内容