hdf5(fortran)库中缺少H5dread_f符号

时间:2018-05-11 19:02:41

标签: hdf5 hdf

我在编译WRF-DA代码时遇到了问题(代码是here

失败的编译行 -

ftn -c -ip -O3  -w -ftz -fno-alias -align all -FR -convert big_endian   -r8        -real-size `expr 8 \* 8` -i4 -I../external/crtm_2.2.3/libsrc   -I/opt/cray/pe/hdf5/1.10.0.3/INTEL/16.0/include   -L/opt/cray/pe/hdf5/1.10.0.3/INTEL/16.0/lib/  -lhdf5hl_fortran -lhdf5_fortran -lhdf5  da_radiance.f 

  da_radiance.f(5884): error #6285: There is no matching specific subroutine for this generic subroutine call.   [H5DREAD_F]
      call H5Dread_f(dhnd1, &
-----------^

我尝试在库中搜索相关符号,并且正如预期的那样,符号不存在(而是存在h5dread_f_c)。

nm /opt/cray/pe/hdf5/1.10.0.3/INTEL/16.0/lib/libhdf5*|grep -i h5dread_f
nm: /opt/cray/pe/hdf5/1.10.0.3/INTEL/16.0/lib/libhdf5.settings: File format not recognized
nm: /opt/cray/pe/hdf5/1.10.0.3/INTEL/16.0/lib/libhdf5_cpp_intel_160.la: File format not recognized
                 U h5dread_f_c
                 U h5dread_f_c
0000000000001290 T h5dread_f_c
0000000000035320 T h5dread_f_c
                 U h5dread_f_c
                 U h5dread_f_c
0000000000001290 T h5dread_f_c
0000000000035320 T h5dread_f_c
                 U h5dread_f_c
                 U h5dread_f_c
0000000000001290 T h5dread_f_c
0000000000035320 T h5dread_f_c
0000000000035320 T h5dread_f_c
0000000000035320 T h5dread_f_c

我尝试编译hdf5-1.10.2。快速查看代码,我看到该函数似乎已在fortran / src / H5Dff.F90中声明(&注释)为 -

!  M. Scot Breitenfeld
!  September 17, 2011
!
! Fortran2003 Interface:
!!  SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, &
!!                       mem_space_id, file_space_id, xfer_prp)
!!    INTEGER(HID_T), INTENT(IN)              :: dset_id
!!    INTEGER(HID_T), INTENT(IN)              :: mem_type_id
!!    TYPE(C_PTR)   , INTENT(INOUT)           :: buf
!!    INTEGER       , INTENT(OUT)             :: hdferr
!!    INTEGER(HID_T), INTENT(IN)   , OPTIONAL :: mem_space_id
!!    INTEGER(HID_T), INTENT(IN)   , OPTIONAL :: file_space_id
!!    INTEGER(HID_T), INTENT(IN)   , OPTIONAL :: xfer_prp
!*****
  SUBROUTINE h5dread_ptr(dset_id, mem_type_id, buf, hdferr, &
       mem_space_id, file_space_id, xfer_prp)

此功能是否已在最新版本的HDF5中逐步淘汰? 如果是,请分享HDF5的适当(较旧)版本的库(及相关编译标志),我可以在其中找到此符号。

如果我能提供任何进一步的信息,请告诉我。

1 个答案:

答案 0 :(得分:1)

h5dread_f是一个接口,它映射到以下

之一
INTERFACE h5dread_f
   MODULE PROCEDURE h5dread_reference_obj
   MODULE PROCEDURE h5dread_reference_dsetreg
   MODULE PROCEDURE h5dread_char_scalar
   MODULE PROCEDURE h5dread_ptr
END INTERFACE

似乎有无效的类型被传递到函数中。

(感谢来自HDF5组的Dave Allured)