In rewriting fortran code I found it useful to call LAPACK code directly.
function dgetrf!(m::IT, n::IT, A::SubArray{FT, 1, Vector{FT}, Tuple{UnitRange{IT}}, true}, lda::IT, ipiv::SubArray{IT, 1, Vector{IT}, Tuple{UnitRange{IT}}, true}) where {IT, FT}
A = rand(7, 7)
@show A, ipiv, info = getrf!(A)
info = Ref{LinearAlgebra.BLAS.BlasInt}()
ccall((LinearAlgebra.LAPACK.@blasfunc(:dgetrf_), LinearAlgebra.LAPACK.libblastrampoline), Cvoid,
(Ref{LinearAlgebra.BLAS.BlasInt}, Ref{LinearAlgebra.BLAS.BlasInt}, Ptr{FT},
Ref{LinearAlgebra.BLAS.BlasInt}, Ptr{LinearAlgebra.BLAS.BlasInt}, Ptr{LinearAlgebra.BLAS.BlasInt}),
m, n, A, lda, ipiv, info)
chkargsok(info[])
return info[] #Error code is stored in LU factorization type
end
Unfortunately, I get this error:
LoadError: could not load symbol ":dgetrf_64_":
The specified procedure could not be found.
Stacktrace:
[1] dgetrf!(m::Int64, n::Int64, A::SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, lda::Int64, ipiv::SubArray{Int64, 1, Vector{Int64}, Tuple{UnitRange{Int64}}, true})
@ Sparspak.SpkSpdMMops C:\Users\pkonl\Documents\00WIP\Sparspak.jl\src\SparseSpdMethod\SpkSpdMMops.jl:333
This is sure curious, because I call getrf!
directly as a test just above the ccall
, and that works.
Any ideas where to look for the catch?