如何调试 Fortran 90 编译错误“There is no specific subroutine for the generic 'foo' at (1)"? [英] How to debug Fortran 90 compile error "There is no specific subroutine for the generic 'foo' at (1)"?

查看:13
本文介绍了如何调试 Fortran 90 编译错误“There is no specific subroutine for the generic 'foo' at (1)"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 iso_c_bindings 模块将 Fortran 2003 绑定编写到 CUFFT 库,但是 cufftPlanMany 子例程(类似于 FFTW 库中的 sfftw_plan_many_dft)存在问题.p>

绑定本身如下所示:

<代码>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!cufftResult cufftPlanMany(cufftHandle *plan, int rank, int *n,!int *inembed, int isstride, int idist,!int *oneembed, int ostride, int odist,!cufftType 类型,int 批次)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!接口 cufftPlanMany子程序 cufftPlanMany(plan, rank, n, &inembed、istride、idist 和oneembed, ostride, odist, &类型,批次)&& 绑定(C,名称='cufftPlanMany')使用 iso_c_binding整数(c_int)::计划integer(c_int),value:: 等级、类型、批次整数(c_int):: n(*)整数(c_int),值:: 跨度,idist,跨度,odist整数(c_int)::嵌入(*),一个嵌入(*)结束子程序 cufftPlanMany结束接口 cufftPlanMany

调用部分如下所示:

<代码>整数(c_int)::计划整数(c_int)::批处理整数(c_size_t):: 大小!...调用 cufftPlanMany(plan, 1, size,&0, 1, 大小,&0, 1, 大小,&CUFFT_C2C,批次)

不幸的是,试图编译这个结果

<块引用>

错误:在 (1) 处没有通用cufftplanmany"的特定子例程

编译错误.尝试使用变量代替常量也无济于事.你能帮忙调试一下吗?

使用的编译器是gfortran:GNU Fortran (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5

解决方案

尝试给接口和子程序起不同的名称,即重命名接口.

I am trying to write Fortran 2003 bindings to CUFFT library using iso_c_bindings module, but I have problems with cufftPlanMany subroutine (similar to sfftw_plan_many_dft in FFTW library).

The bindings itself look like this:


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! cufftResult cufftPlanMany(cufftHandle *plan, int rank, int *n,
!                           int *inembed, int istride, int idist,
!                           int *onembed, int ostride, int odist,
!                           cufftType type, int batch)
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

interface cufftPlanMany
subroutine cufftPlanMany(plan, rank, n, &
                         inembed, istride, idist, &
                         onembed, ostride, odist, &
                         type, batch) &
& bind(C,name='cufftPlanMany')
use iso_c_binding
integer(c_int):: plan
integer(c_int),value:: rank, type, batch
integer(c_int):: n(*)
integer(c_int),value:: istride, idist, ostride, odist
integer(c_int):: inembed(*), onembed(*)
end subroutine cufftPlanMany
end interface cufftPlanMany

The calling part looks like this:


  integer(c_int):: plan
  integer(c_int):: batch
  integer(c_size_t):: size

! ...

    call cufftPlanMany(plan, 1, size,&
                       0, 1, size,&
                       0, 1, size,&
                       CUFFT_C2C, batch)

Unfortunately trying to compile this results in

Error: There is no specific subroutine for the generic 'cufftplanmany' at (1)

compilation error. Trying to use variables in place of constants didn't help either. Could you help with debugging this?

The compiler used is gfortran: GNU Fortran (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5

解决方案

Try giving the interface and the subroutine different names, i.e., rename the interface.

这篇关于如何调试 Fortran 90 编译错误“There is no specific subroutine for the generic 'foo' at (1)"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆