Note: This post is concerning the lblas library and NOT the cublas library.
I am attempting to compile the following code as a test of the dnrm2 BLAS function:
program test
implicit none
external :: dnrm2
integer :: m=3
real(8) :: s
real(8), allocatable :: x(:)
allocate(x(m),source=0.0)
x = [1.0, 2.0, 3.0]
s = dnrm2(m,x,1)
print *, s
end program
However, when I compile with:
nvfortran test.cuf -lblas
I am getting the following error:
NVFORTRAN-S-0038-Symbol, dnrm2, has not been explicitly declared (test.cuf: 1)
I have tested other vector operations function for example dasum which also doesn’t work. However, I have successfully compiled, ran, and verified the output using BLAS matrix-vector functions for example dgevm. Which leads me to believe that the vector operations are not available in the nvfortran BLAS library. I also think it rules out a possible linking problem. I have searched these forums and the internet to no avail.
I have also reviewed the nvfortran docs here:
which points to OpenBLAS here:
A cursory review of OpenBLAS shows that the dnrm2 function does exist in that library.
It seems to me that for some reason the BLAS vector operations are not included in the nvfortran lblas library or they are under different names for which the documentation is lacking.
Any insight into this error and how to fix it would be greatly appreciated.