I am compiling Fortran code with the ifx compiler (version 2025.0.4) on Windows. I have the Intel MKL library downloaded as well and I am trying to compile a program using it, like this:
ifx test.f90 -o test.exe -Qmkl
However, when I have this program:
include "mkl_blas.f90"
program main
use BLAS95
implicit none
integer, parameter :: dp = selected_real_kind(15, 307)
real(dp), dimension(2,2) :: A, B, C
A = 1.0
B = 1.0
C = 0.0
call gemm(A, B, C)
write(*,*) C
end program main
it gives me linker error LNK2019, unrecognised extern symbol DGEMM_F95.
However, if I use the old dgemm function with all the arguments instead of the generic gemm,
call dgemm("N", "N", 2, 2, 2, 1.d0, A, 2, B, 2, 0.d0, C, 2)
everything works perfectly. What is happening here? I thought that using blas95 was enough to get the generic versions.
blas95tells the compiler how the subroutine looks like, but you have to provide the actual compiled subroutine in a library at link time. That is made easy by the link line advisor alredy mentioned before. See also stackoverflow.com/questions/66855252/…