- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I understand that I can call fortran function in DLL from C# by using PInvoke. Now I want to call LAPACK function such as degmv., but I don't want to write a wrapper fortran code on top of that.
How to call LAPACK library directly from C#?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Copying a response from a private reply:
"dgemv isn't an lapack function, it's a BLAS function. If built from public source, it is a Fortran77 subroutine, if modified or closed source, it still should preserve Fortran interoperability. Intel MKL lapack and BLAS functions provided with recent ifort come with C prototypes (not all strictly correct), in case that helps. I don't see what you expect to change by putting a Fortran wrapper over a Fortran callable subroutine. If you want to patch over some legacy style interface questions, you could take the public source code and modify it to USE iso_c_binding, or you could accomplish that in a wrapper."
"dgemv isn't an lapack function, it's a BLAS function. If built from public source, it is a Fortran77 subroutine, if modified or closed source, it still should preserve Fortran interoperability. Intel MKL lapack and BLAS functions provided with recent ifort come with C prototypes (not all strictly correct), in case that helps. I don't see what you expect to change by putting a Fortran wrapper over a Fortran callable subroutine. If you want to patch over some legacy style interface questions, you could take the public source code and modify it to USE iso_c_binding, or you could accomplish that in a wrapper."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
are you saying that I would have to build the BLAS library myself, that MKL doesn't come with a binary dll of the BLAS library?
From my digging this seems to be the case for BLAS . FOR LAPACK, there is a binary version of mkl_lapack.dll, though. Why this double standard?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page