- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Intel Fortran Community,
I hope this message finds you well. I am currently working with Intel Fortran and Python, and I have encountered an issue that I am hoping you might be able to help me with.
After compiling a Fortran code using the command:
ifx /dll /libs:static /Qmkl sample.f90
I attempt to call resulting 'sample.dll' via 'ctypes.CDLL' in Python, but I receive the following error:
FileNotFoundError : Could not find module '{sample.dll's folder path}' (or one of its dependencies). Try using the full path with constructor syntax.
The file path to 'sample.dll' is correct, and it exists on the system. I have verified that there are no errors in the code or the compilation, but the call from Python does not work, and I have been unable to resolve the issue.
Here is a snippet of the Fortran code I am working with, which includes a call to the 'dgesv' routine for solving linear systems:
module sample
use ISO_C_binding
implicit none
contains
!*****************************************************************************************************************
subroutine solve_linear_system(imax, jmax, matA, matB, info, matX) bind(C, name = "solve_linear_system")
!DEC$ ATTRIBUTES DLLEXPORT :: solve_linear_system
integer(c_int), intent(in) :: imax
integer(c_int), intent(in) :: jmax
real(c_double), intent(in) :: matA(imax, imax)
real(c_double), intent(in) :: matB(imax, jmax)
integer(c_int), intent(out) :: info
real(c_double), intent(out) :: matX(imax, jmax)
integer(c_int) :: ipiv(imax)
external dgesv
call dgesv(imax, jmax, matA, imax, ipiv, matB, imax, info)
matX = matB
end subroutine solve_linear_system
!*****************************************************************************************************************
end module sample
To resolve this issue, I have tried adding environment variables with dependent DLL folders and experimented with different compile options such as /Qmkl-ilp64, but to no avail.
Any insights or suggestions would be greatly appreciated. Thank you very much for your time and assistance.
Best regards,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't think (my experiments were inconclusive) that /libs:static affects which MKL libraries are linked in with /Qmkl. I suggest that you take this to the MKL forum, and/or make sure that the MKL DLLs are included in PATH.

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