事实上,我想从 fortran 中调用岩浆。所以我添加了magma.lib并创建了一个接口来使用magma的C函数:
Interface
Integer function magma_dpotrf(uplo, n, a, lda, info) BIND (C, NAME="magma_dpotrf")
use iso_c_binding
Implicit none
!character (c_char), value :: uplo????
integer (c_int), value ::n
real (c_double) ::a(*)
integer (c_int), value ::lda
integer (c_int)::info
end function
end Interface
但是参数 uplo 是 C 代码中的用户定义类型(magma_uplo_t uplo):
typedef enum {
MagmaUpper = 121,
MagmaLower = 122,
MagmaUpperLower = 123,
MagmaFull = 123, /* lascl, laset */
MagmaHessenberg = 124 /* lascl */
} magma_uplo_t;
magma_int_t
magma_dpotrf(
magma_uplo_t uplo, magma_int_t n,
double *A, magma_int_t lda,
magma_int_t *info);
magma_int_t = int,有谁知道如何为它创建接口?提前致谢