1

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.

3
  • 3
    Have you used the link-line advisor to see what options are required to compile and link against BLAS95 in MKL? Commented Jan 10 at 9:59
  • If it is a linker error that does not mean it didn't find an interface at compile time. Does ifx have a compile time option to warn or error if an interface is not in scope? Otherwise second the use of the link line advisor Commented Jan 10 at 15:11
  • Using blas95 tells 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/… Commented Jan 10 at 16:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.