From 566047b508dbf32cf2594dc17e44b8ae0209f52b Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sat, 26 Feb 2022 12:50:14 -0500 Subject: [PATCH 1/6] Report libblastrampoline as Base.libblas_name and Base.liblapack_name --- base/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/Makefile b/base/Makefile index f3ed73791085e..1924499f43951 100644 --- a/base/Makefile +++ b/base/Makefile @@ -47,8 +47,8 @@ else @echo "const MACHINE = \"$(XC_HOST)\"" >> $@ endif @echo "const libm_name = \"$(LIBMNAME)\"" >> $@ - @echo "const libblas_name = \"$(LIBBLASNAME)\"" >> $@ - @echo "const liblapack_name = \"$(LIBLAPACKNAME)\"" >> $@ + @echo "const libblas_name = \"libblastrampoline\"" >> $@ + @echo "const liblapack_name = \"libblastrampoline\"" >> $@ ifeq ($(USE_BLAS64), 1) @echo "const USE_BLAS64 = true" >> $@ else From 08121b5b93e2c60bf0c47c4f27a7b033328a438a Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sat, 26 Feb 2022 18:58:55 +0000 Subject: [PATCH 2/6] Cleanup a lot of the LBT stuff --- stdlib/LinearAlgebra/Project.toml | 1 + stdlib/LinearAlgebra/src/LinearAlgebra.jl | 14 +- stdlib/LinearAlgebra/src/blas.jl | 104 ++++---- stdlib/LinearAlgebra/src/lapack.jl | 284 +++++++++++----------- stdlib/libblastrampoline_jll/Project.toml | 1 - 5 files changed, 192 insertions(+), 212 deletions(-) diff --git a/stdlib/LinearAlgebra/Project.toml b/stdlib/LinearAlgebra/Project.toml index d7121d2e3868e..46653aa795209 100644 --- a/stdlib/LinearAlgebra/Project.toml +++ b/stdlib/LinearAlgebra/Project.toml @@ -4,6 +4,7 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" libblastrampoline_jll = "8e850b90-86db-534c-a0d3-1478176c7d93" +OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index 44deb7556e037..442264cd7dc78 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -19,6 +19,8 @@ using Base: IndexLinear, promote_eltype, promote_op, promote_typeof, @propagate_inbounds, @pure, reduce, typed_hvcat, typed_vcat, require_one_based_indexing, splat using Base.Broadcast: Broadcasted, broadcasted +using OpenBLAS_jll +using libblastrampoline_jll import Libdl export @@ -588,17 +590,7 @@ end function __init__() try - libblas_path = find_library_path(Base.libblas_name) - liblapack_path = find_library_path(Base.liblapack_name) - # We manually `dlopen()` these libraries here, so that we search with `libjulia-internal`'s - # `RPATH` and not `libblastrampoline's`. Once it's been opened, when LBT tries to open it, - # it will find the library already loaded. - libblas_path = Libdl.dlpath(Libdl.dlopen(libblas_path)) - BLAS.lbt_forward(libblas_path; clear=true) - if liblapack_path != libblas_path - liblapack_path = Libdl.dlpath(Libdl.dlopen(liblapack_path)) - BLAS.lbt_forward(liblapack_path) - end + BLAS.lbt_forward(OpenBLAS_jll.libopenblas_path; clear=true) BLAS.check() catch ex Base.showerror_nostdio(ex, "WARNING: Error during initialization of module LinearAlgebra") diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index 22789f0a01866..0c79f07dde502 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -63,20 +63,12 @@ export trsm!, trsm -# Eventually this will be replaced with `libblastrampoline_jll.libblastrampoline` -const libblastrampoline = "libblastrampoline" -libblastrampoline_handle = C_NULL - -# Legacy bindings that some packages (such as NNlib.jl) use. -# We maintain these for backwards-compatibility but new packages -# should not look at these, instead preferring to parse the output -# of BLAS.get_config() -const libblas = libblastrampoline -const liblapack = libblastrampoline - import LinearAlgebra using LinearAlgebra: BlasReal, BlasComplex, BlasFloat, BlasInt, DimensionMismatch, checksquare, stride1, chkstride1 +using libblastrampoline_jll +const lbt = libblastrampoline_jll.libblastrampoline + include("lbt.jl") """ @@ -197,7 +189,7 @@ for (fname, elty) in ((:dcopy_,:Float64), @eval begin # SUBROUTINE DCOPY(N,DX,INCX,DY,INCY) function blascopy!(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, DX, incx, DY, incy) DY @@ -219,12 +211,12 @@ first `n` elements of array `Y` with stride `incy`. Returns `X` and `Y`. """ function rot! end -for (fname, elty, cty, sty, lib) in ((:drot_, :Float64, :Float64, :Float64, libblastrampoline), - (:srot_, :Float32, :Float32, :Float32, libblastrampoline), - (:zdrot_, :ComplexF64, :Float64, :Float64, libblastrampoline), - (:csrot_, :ComplexF32, :Float32, :Float32, libblastrampoline), - (:zrot_, :ComplexF64, :Float64, :ComplexF64, libblastrampoline), - (:crot_, :ComplexF32, :Float32, :ComplexF32, libblastrampoline)) +for (fname, elty, cty, sty, lib) in ((:drot_, :Float64, :Float64, :Float64, lbt), + (:srot_, :Float32, :Float32, :Float32, lbt), + (:zdrot_, :ComplexF64, :Float64, :Float64, lbt), + (:csrot_, :ComplexF32, :Float32, :Float32, lbt), + (:zrot_, :ComplexF64, :Float64, :ComplexF64, lbt), + (:crot_, :ComplexF32, :Float32, :ComplexF32, lbt)) @eval begin # SUBROUTINE DROT(N,DX,INCX,DY,INCY,C,S) function rot!(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer, C::$cty, S::$sty) @@ -265,7 +257,7 @@ for (fname, elty) in ((:dscal_,:Float64), @eval begin # SUBROUTINE DSCAL(N,DA,DX,INCX) function scal!(n::Integer, DA::$elty, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), n, DA, DX, incx) DX @@ -336,7 +328,7 @@ for (fname, elty) in ((:cblas_ddot,:Float64), # * .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function dot(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblastrampoline), $elty, + ccall((@blasfunc($fname), lbt), $elty, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt), n, DX, incx, DY, incy) end @@ -353,7 +345,7 @@ for (fname, elty) in ((:cblas_zdotc_sub,:ComplexF64), # DOUBLE PRECISION DX(*),DY(*) function dotc(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) result = Ref{$elty}() - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[] @@ -371,7 +363,7 @@ for (fname, elty) in ((:cblas_zdotu_sub,:ComplexF64), # DOUBLE PRECISION DX(*),DY(*) function dotu(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) result = Ref{$elty}() - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[] @@ -416,7 +408,7 @@ for (fname, elty, ret_type) in ((:dnrm2_,:Float64,:Float64), @eval begin # SUBROUTINE DNRM2(N,X,INCX) function nrm2(n::Integer, X::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), libblastrampoline), $ret_type, + ccall((@blasfunc($fname), lbt), $ret_type, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, X, incx) end @@ -457,7 +449,7 @@ for (fname, elty, ret_type) in ((:dasum_,:Float64,:Float64), @eval begin # SUBROUTINE ASUM(N, X, INCX) function asum(n::Integer, X::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), libblastrampoline), $ret_type, + ccall((@blasfunc($fname), lbt), $ret_type, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, X, incx) end @@ -503,7 +495,7 @@ for (fname, elty) in ((:daxpy_,:Float64), #* .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function axpy!(n::Integer, alpha::($elty), dx::Union{Ptr{$elty}, AbstractArray{$elty}}, incx::Integer, dy::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, alpha, dx, incx, dy, incy) dy @@ -574,7 +566,7 @@ for (fname, elty) in ((:daxpby_,:Float64), (:saxpby_,:Float32), function axpby!(n::Integer, alpha::($elty), dx::Union{Ptr{$elty}, AbstractArray{$elty}}, incx::Integer, beta::($elty), dy::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), n, alpha, dx, incx, beta, dy, incy) dy @@ -599,7 +591,7 @@ for (fname, elty) in ((:idamax_,:Float64), (:icamax_,:ComplexF32)) @eval begin function iamax(n::Integer, dx::Union{Ptr{$elty}, AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), libblastrampoline),BlasInt, + ccall((@blasfunc($fname), lbt),BlasInt, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, dx, incx) end @@ -659,7 +651,7 @@ for (fname, elty) in ((:dgemv_,:Float64), end lda >= size(A,1) || size(A,2) <= 1 || error("when `size(A,2) > 1`, `abs(stride(A,2))` must be at least `size(A,1)`") lda = max(1, size(A,1), lda) - GC.@preserve A X Y ccall((@blasfunc($fname), libblastrampoline), Cvoid, + GC.@preserve A X Y ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -741,7 +733,7 @@ for (fname, elty) in ((:dgbmv_,:Float64), chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, @@ -773,10 +765,10 @@ Only the [`ul`](@ref stdlib-blas-uplo) triangle of `A` is used. """ function symv! end -for (fname, elty, lib) in ((:dsymv_,:Float64,libblastrampoline), - (:ssymv_,:Float32,libblastrampoline), - (:zsymv_,:ComplexF64,libblastrampoline), - (:csymv_,:ComplexF32,libblastrampoline)) +for (fname, elty, lib) in ((:dsymv_,:Float64,lbt), + (:ssymv_,:Float32,lbt), + (:zsymv_,:ComplexF64,lbt), + (:csymv_,:ComplexF32,lbt)) # Note that the complex symv are not BLAS but auiliary functions in LAPACK @eval begin # SUBROUTINE DSYMV(UPLO,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) @@ -869,7 +861,7 @@ for (fname, elty) in ((:zhemv_,:ComplexF64), lda = max(1, stride(A, 2)) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -926,7 +918,7 @@ for (fname, elty) in ((:zhpmv_, :ComplexF64), y::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, # uplo, Ref{BlasInt}, # n, Ref{$elty}, # α, @@ -1011,7 +1003,7 @@ for (fname, elty) in ((:dsbmv_,:Float64), chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -1083,7 +1075,7 @@ for (fname, elty) in ((:dspmv_, :Float64), y::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, # uplo, Ref{BlasInt}, # n, Ref{$elty}, # α, @@ -1162,7 +1154,7 @@ for (fname, elty) in ((:dspr_, :Float64), incx::Integer, AP::Union{Ptr{$elty}, AbstractArray{$elty}}) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, # uplo, Ref{BlasInt}, # n, Ref{$elty}, # α, @@ -1236,7 +1228,7 @@ for (fname, elty) in ((:zhbmv_,:ComplexF64), chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -1298,7 +1290,7 @@ for (fname, elty) in ((:dtrmv_,:Float64), end chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) - GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid, + GC.@preserve x ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong), @@ -1355,7 +1347,7 @@ for (fname, elty) in ((:dtrsv_,:Float64), end chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) - GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid, + GC.@preserve x ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong), @@ -1391,7 +1383,7 @@ for (fname, elty) in ((:dger_,:Float64), end px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("input vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), @@ -1411,10 +1403,10 @@ Rank-1 update of the symmetric matrix `A` with vector `x` as `alpha*x*transpose( """ function syr! end -for (fname, elty, lib) in ((:dsyr_,:Float64,libblastrampoline), - (:ssyr_,:Float32,libblastrampoline), - (:zsyr_,:ComplexF64,libblastrampoline), - (:csyr_,:ComplexF32,libblastrampoline)) +for (fname, elty, lib) in ((:dsyr_,:Float64,lbt), + (:ssyr_,:Float32,lbt), + (:zsyr_,:ComplexF64,lbt), + (:csyr_,:ComplexF32,lbt)) @eval begin function syr!(uplo::AbstractChar, α::$elty, x::AbstractVector{$elty}, A::AbstractMatrix{$elty}) chkuplo(uplo) @@ -1455,7 +1447,7 @@ for (fname, elty, relty) in ((:zher_,:ComplexF64, :Float64), throw(DimensionMismatch(lazy"A has size ($n,$n), x has length $(length(x))")) end px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) - GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid, + GC.@preserve x ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong), uplo, n, α, px, stx, A, max(1,stride(A,2)), 1) @@ -1507,7 +1499,7 @@ for (gemm, elty) in chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($gemm), libblastrampoline), Cvoid, + ccall((@blasfunc($gemm), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, @@ -1571,7 +1563,7 @@ for (mfname, elty) in ((:dsymm_,:Float64), chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($mfname), libblastrampoline), Cvoid, + ccall((@blasfunc($mfname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1645,7 +1637,7 @@ for (mfname, elty) in ((:zhemm_,:ComplexF64), chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($mfname), libblastrampoline), Cvoid, + ccall((@blasfunc($mfname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1735,7 +1727,7 @@ for (fname, elty) in ((:dsyrk_,:Float64), k = size(A, trans == 'N' ? 2 : 1) chkstride1(A) chkstride1(C) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong), @@ -1794,7 +1786,7 @@ for (fname, elty, relty) in ((:zherk_, :ComplexF64, :Float64), chkstride1(A) chkstride1(C) k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong), @@ -1838,7 +1830,7 @@ for (fname, elty) in ((:dsyr2k_,:Float64), chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong), @@ -1906,7 +1898,7 @@ for (fname, elty1, elty2) in ((:zher2k_,:ComplexF64,:Float64), (:cher2k_,:Comple chkstride1(B) chkstride1(C) k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + ccall((@blasfunc($fname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty1}, Ptr{$elty1}, Ref{BlasInt}, Ptr{$elty1}, Ref{BlasInt}, Ref{$elty2}, Ptr{$elty1}, Ref{BlasInt}, Clong, Clong), @@ -2022,7 +2014,7 @@ for (mmname, smname, elty) in end chkstride1(A) chkstride1(B) - ccall((@blasfunc($mmname), libblastrampoline), Cvoid, + ccall((@blasfunc($mmname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong, Clong), @@ -2053,7 +2045,7 @@ for (mmname, smname, elty) in end chkstride1(A) chkstride1(B) - ccall((@blasfunc($smname), libblastrampoline), Cvoid, + ccall((@blasfunc($smname), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, diff --git a/stdlib/LinearAlgebra/src/lapack.jl b/stdlib/LinearAlgebra/src/lapack.jl index 0aa8f1689f23c..1aa21b5263d70 100644 --- a/stdlib/LinearAlgebra/src/lapack.jl +++ b/stdlib/LinearAlgebra/src/lapack.jl @@ -5,13 +5,6 @@ module LAPACK Interfaces to LAPACK subroutines. """ LAPACK -const libblastrampoline = "libblastrampoline" - -# Legacy binding maintained for backwards-compatibility but new packages -# should not look at this, instead preferring to parse the output -# of BLAS.get_config() -const liblapack = libblastrampoline - using ..LinearAlgebra.BLAS: @blasfunc, chkuplo using ..LinearAlgebra: BlasFloat, BlasInt, LAPACKException, DimensionMismatch, @@ -19,6 +12,9 @@ using ..LinearAlgebra: BlasFloat, BlasInt, LAPACKException, DimensionMismatch, using Base: iszero, require_one_based_indexing +using libblastrampoline_jll +const lbt = libblastrampoline_jll.libblastrampoline + #Generic LAPACK error handlers """ Handle only negative LAPACK error codes @@ -113,7 +109,7 @@ function version() major = Ref{BlasInt}(0) minor = Ref{BlasInt}(0) patch = Ref{BlasInt}(0) - ccall((@blasfunc(ilaver_), libblastrampoline), Cvoid, + ccall((@blasfunc(ilaver_), lbt), Cvoid, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), major, minor, patch) return VersionNumber(major[], minor[], patch[]) @@ -139,7 +135,7 @@ for (gbtrf, gbtrs, elty) in mnmn = min(m, n) ipiv = similar(AB, BlasInt, mnmn) info = Ref{BlasInt}() - ccall((@blasfunc($gbtrf), libblastrampoline), Cvoid, + ccall((@blasfunc($gbtrf), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), m, n, kl, ku, AB, max(1,stride(AB,2)), ipiv, info) @@ -165,7 +161,7 @@ for (gbtrf, gbtrs, elty) in if m != n || m != size(B,1) throw(DimensionMismatch("matrix AB has dimensions $(size(AB)), but right hand side matrix B has dimensions $(size(B))")) end - ccall((@blasfunc($gbtrs), libblastrampoline), Cvoid, + ccall((@blasfunc($gbtrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -219,7 +215,7 @@ for (gebal, gebak, elty, relty) in ilo = Ref{BlasInt}() scale = similar(A, $relty, n) info = Ref{BlasInt}() - ccall((@blasfunc($gebal), libblastrampoline), Cvoid, + ccall((@blasfunc($gebal), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}, Clong), job, n, A, max(1,stride(A,2)), ilo, ihi, scale, info, 1) @@ -242,7 +238,7 @@ for (gebal, gebak, elty, relty) in chkfinite(V) # balancing routines don't support NaNs and Infs n = checksquare(V) info = Ref{BlasInt}() - ccall((@blasfunc($gebak), libblastrampoline), Cvoid, + ccall((@blasfunc($gebak), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -309,7 +305,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gebrd), libblastrampoline), Cvoid, + ccall((@blasfunc($gebrd), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -343,7 +339,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelqf), libblastrampoline), Cvoid, + ccall((@blasfunc($gelqf), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, tau, work, lwork, info) @@ -374,7 +370,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geqlf), libblastrampoline), Cvoid, + ccall((@blasfunc($geqlf), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, tau, work, lwork, info) @@ -416,7 +412,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($geqp3), libblastrampoline), Cvoid, + ccall((@blasfunc($geqp3), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), @@ -424,7 +420,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty jpvt, tau, work, lwork, rwork, info) else - ccall((@blasfunc($geqp3), libblastrampoline), Cvoid, + ccall((@blasfunc($geqp3), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -454,7 +450,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, nb*n) if n > 0 info = Ref{BlasInt}() - ccall((@blasfunc($geqrt), libblastrampoline), Cvoid, + ccall((@blasfunc($geqrt), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), @@ -480,7 +476,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty end if n > 0 info = Ref{BlasInt}() - ccall((@blasfunc($geqrt3), libblastrampoline), Cvoid, + ccall((@blasfunc($geqrt3), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1, stride(A, 2)), @@ -507,7 +503,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geqrf), libblastrampoline), Cvoid, + ccall((@blasfunc($geqrf), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -536,7 +532,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gerqf), libblastrampoline), Cvoid, + ccall((@blasfunc($gerqf), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -562,7 +558,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lda = max(1,stride(A, 2)) ipiv = similar(A, BlasInt, min(m,n)) info = Ref{BlasInt}() - ccall((@blasfunc($getrf), libblastrampoline), Cvoid, + ccall((@blasfunc($getrf), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), m, n, A, lda, ipiv, info) @@ -769,7 +765,7 @@ for (larfg, elty) in α = Ref{$elty}(x[1]) incx = BlasInt(1) τ = Ref{$elty}(0) - ccall((@blasfunc($larfg), libblastrampoline), Cvoid, + ccall((@blasfunc($larfg), lbt), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}), N, α, pointer(x, 2), incx, τ) @inbounds x[1] = one($elty) @@ -798,7 +794,7 @@ for (larf, elty) in ldc = max(1, stride(C, 2)) l = side == 'L' ? n : m incv = BlasInt(1) - ccall((@blasfunc($larf), libblastrampoline), Cvoid, + ccall((@blasfunc($larf), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Clong), side, m, n, v, incv, @@ -843,7 +839,7 @@ for (tzrzf, ormrz, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($tzrzf), libblastrampoline), Cvoid, + ccall((@blasfunc($tzrzf), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, @@ -881,7 +877,7 @@ for (tzrzf, ormrz, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormrz), libblastrampoline), Cvoid, + ccall((@blasfunc($ormrz), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -946,7 +942,7 @@ for (gels, gesv, getrs, getri, elty) in work = Vector{$elty}(undef, 1) lwork = BlasInt(-1) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gels), libblastrampoline), Cvoid, + ccall((@blasfunc($gels), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -987,7 +983,7 @@ for (gels, gesv, getrs, getri, elty) in end ipiv = similar(A, BlasInt, n) info = Ref{BlasInt}() - ccall((@blasfunc($gesv), libblastrampoline), Cvoid, + ccall((@blasfunc($gesv), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -1012,7 +1008,7 @@ for (gels, gesv, getrs, getri, elty) in end nrhs = size(B, 2) info = Ref{BlasInt}() - ccall((@blasfunc($getrs), libblastrampoline), Cvoid, + ccall((@blasfunc($getrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), trans, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -1038,7 +1034,7 @@ for (gels, gesv, getrs, getri, elty) in work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($getri), libblastrampoline), Cvoid, + ccall((@blasfunc($getri), lbt), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, A, lda, ipiv, work, lwork, info) @@ -1134,7 +1130,7 @@ for (gesvx, elty) in iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() X = similar(A, $elty, n, nrhs) - ccall((@blasfunc($gesvx), libblastrampoline), Cvoid, + ccall((@blasfunc($gesvx), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{UInt8}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1204,7 +1200,7 @@ for (gesvx, elty, relty) in rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() X = similar(A, $elty, n, nrhs) - ccall((@blasfunc($gesvx), libblastrampoline), Cvoid, + ccall((@blasfunc($gesvx), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{UInt8}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, @@ -1300,7 +1296,7 @@ for (gelsd, gelsy, elty) in lwork = BlasInt(-1) iwork = Vector{BlasInt}(undef, 1) for i = 1:2 # first call returns lwork as work[1] and iwork length as iwork[1] - ccall((@blasfunc($gelsd), libblastrampoline), Cvoid, + ccall((@blasfunc($gelsd), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1346,7 +1342,7 @@ for (gelsd, gelsy, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelsy), libblastrampoline), Cvoid, + ccall((@blasfunc($gelsy), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1396,7 +1392,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Vector{$relty}(undef, 1) iwork = Vector{BlasInt}(undef, 1) for i = 1:2 # first call returns lwork as work[1], rwork length as rwork[1] and iwork length as iwork[1] - ccall((@blasfunc($gelsd), libblastrampoline), Cvoid, + ccall((@blasfunc($gelsd), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ref{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1444,7 +1440,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelsy), libblastrampoline), Cvoid, + ccall((@blasfunc($gelsy), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1519,7 +1515,7 @@ for (gglse, elty) in ((:dgglse_, :Float64), work = Vector{$elty}(undef, 1) lwork = BlasInt(-1) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gglse), libblastrampoline), Cvoid, + ccall((@blasfunc($gglse), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1582,7 +1578,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($geev), libblastrampoline), Cvoid, + ccall((@blasfunc($geev), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1590,7 +1586,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in jobvl, jobvr, n, A, max(1,stride(A,2)), W, VL, n, VR, n, work, lwork, rwork, info, 1, 1) else - ccall((@blasfunc($geev), libblastrampoline), Cvoid, + ccall((@blasfunc($geev), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1646,7 +1642,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($gesdd), libblastrampoline), Cvoid, + ccall((@blasfunc($gesdd), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1654,7 +1650,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in job, m, n, A, max(1,stride(A,2)), S, U, max(1,stride(U,2)), VT, max(1,stride(VT,2)), work, lwork, rwork, iwork, info, 1) else - ccall((@blasfunc($gesdd), libblastrampoline), Cvoid, + ccall((@blasfunc($gesdd), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1715,7 +1711,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($gesvd), libblastrampoline), Cvoid, + ccall((@blasfunc($gesvd), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1723,7 +1719,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in jobu, jobvt, m, n, A, max(1,stride(A,2)), S, U, max(1,stride(U,2)), VT, max(1,stride(VT,2)), work, lwork, rwork, info, 1, 1) else - ccall((@blasfunc($gesvd), libblastrampoline), Cvoid, + ccall((@blasfunc($gesvd), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1795,7 +1791,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() if cmplx - ccall((@blasfunc($ggsvd), libblastrampoline), Cvoid, + ccall((@blasfunc($ggsvd), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1811,7 +1807,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in work, rwork, iwork, info, 1, 1, 1) else - ccall((@blasfunc($ggsvd), libblastrampoline), Cvoid, + ccall((@blasfunc($ggsvd), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1919,7 +1915,7 @@ for (f, elty) in ((:dggsvd3_, :Float64), iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($f), libblastrampoline), Cvoid, + ccall((@blasfunc($f), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1979,7 +1975,7 @@ for (f, elty, relty) in ((:zggsvd3_, :ComplexF64, :Float64), iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($f), libblastrampoline), Cvoid, + ccall((@blasfunc($f), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2087,7 +2083,7 @@ for (geevx, ggev, elty) in iwork = Vector{BlasInt}(undef, iworksize) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geevx), libblastrampoline), Cvoid, + ccall((@blasfunc($geevx), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -2155,7 +2151,7 @@ for (geevx, ggev, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ggev), libblastrampoline), Cvoid, + ccall((@blasfunc($ggev), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -2235,7 +2231,7 @@ for (geevx, ggev, elty, relty) in rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geevx), libblastrampoline), Cvoid, + ccall((@blasfunc($geevx), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2302,7 +2298,7 @@ for (geevx, ggev, elty, relty) in rwork = Vector{$relty}(undef, 8n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ggev), libblastrampoline), Cvoid, + ccall((@blasfunc($ggev), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -2376,7 +2372,7 @@ for (laic1, elty) in sestpr = Vector{$elty}(undef, 1) s = Vector{$elty}(undef, 1) c = Vector{$elty}(undef, 1) - ccall((@blasfunc($laic1), libblastrampoline), Cvoid, + ccall((@blasfunc($laic1), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{$elty}, Ptr{$elty}, Ref{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}), @@ -2410,7 +2406,7 @@ for (laic1, elty, relty) in sestpr = Vector{$relty}(undef, 1) s = Vector{$elty}(undef, 1) c = Vector{$elty}(undef, 1) - ccall((@blasfunc($laic1), libblastrampoline), Cvoid, + ccall((@blasfunc($laic1), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{$relty}, Ptr{$elty}, Ref{$elty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}), @@ -2452,7 +2448,7 @@ for (gtsv, gttrf, gttrs, elty) in return B # Early exit if possible end info = Ref{BlasInt}() - ccall((@blasfunc($gtsv), libblastrampoline), Cvoid, + ccall((@blasfunc($gtsv), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), dl, d, du, B, max(1,stride(B,2)), info) @@ -2479,7 +2475,7 @@ for (gtsv, gttrf, gttrs, elty) in du2 = similar(d, $elty, n-2) ipiv = similar(d, BlasInt, n) info = Ref{BlasInt}() - ccall((@blasfunc($gttrf), libblastrampoline), Cvoid, + ccall((@blasfunc($gttrf), lbt), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), n, dl, d, du, du2, ipiv, info) @@ -2511,7 +2507,7 @@ for (gtsv, gttrf, gttrs, elty) in throw(DimensionMismatch("B has leading dimension $(size(B,1)), but should have $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($gttrs), libblastrampoline), Cvoid, + ccall((@blasfunc($gttrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -2578,7 +2574,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orglq), libblastrampoline), Cvoid, + ccall((@blasfunc($orglq), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -2612,7 +2608,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgqr), libblastrampoline), Cvoid, + ccall((@blasfunc($orgqr), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2648,7 +2644,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgql), libblastrampoline), Cvoid, + ccall((@blasfunc($orgql), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2686,7 +2682,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgrq), libblastrampoline), Cvoid, + ccall((@blasfunc($orgrq), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2733,7 +2729,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormlq), libblastrampoline), Cvoid, + ccall((@blasfunc($ormlq), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -2780,7 +2776,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormqr), libblastrampoline), Cvoid, + ccall((@blasfunc($ormqr), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2830,7 +2826,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormql), libblastrampoline), Cvoid, + ccall((@blasfunc($ormql), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2880,7 +2876,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormrq), libblastrampoline), Cvoid, + ccall((@blasfunc($ormrq), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -2936,7 +2932,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in ldc = stride(C, 2) work = Vector{$elty}(undef, wss) info = Ref{BlasInt}() - ccall((@blasfunc($gemqrt), libblastrampoline), Cvoid, + ccall((@blasfunc($gemqrt), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -3055,7 +3051,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in throw(DimensionMismatch("first dimension of B, $(size(B,1)), and size of A, ($n,$n), must match!")) end info = Ref{BlasInt}() - ccall((@blasfunc($posv), libblastrampoline), Cvoid, + ccall((@blasfunc($posv), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), B, max(1,stride(B,2)), info, 1) @@ -3080,7 +3076,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in return A, 0 end info = Ref{BlasInt}() - ccall((@blasfunc($potrf), libblastrampoline), Cvoid, + ccall((@blasfunc($potrf), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, size(A,1), A, lda, info, 1) chkargsok(info[]) @@ -3101,7 +3097,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in chkstride1(A) chkuplo(uplo) info = Ref{BlasInt}() - ccall((@blasfunc($potri), libblastrampoline), Cvoid, + ccall((@blasfunc($potri), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, size(A,1), A, max(1,stride(A,2)), info, 1) chkargsok(info[]) @@ -3130,7 +3126,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in end ldb = max(1,stride(B,2)) info = Ref{BlasInt}() - ccall((@blasfunc($potrs), libblastrampoline), Cvoid, + ccall((@blasfunc($potrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, nrhs, A, @@ -3155,7 +3151,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in rank = Vector{BlasInt}(undef, 1) work = Vector{$rtyp}(undef, 2n) info = Ref{BlasInt}() - ccall((@blasfunc($pstrf), libblastrampoline), Cvoid, + ccall((@blasfunc($pstrf), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ref{$rtyp}, Ptr{$rtyp}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), piv, rank, tol, work, info, 1) @@ -3244,7 +3240,7 @@ for (ptsv, pttrf, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($ptsv), libblastrampoline), Cvoid, + ccall((@blasfunc($ptsv), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), D, E, B, max(1,stride(B,2)), info) @@ -3265,7 +3261,7 @@ for (ptsv, pttrf, elty, relty) in throw(DimensionMismatch("E has length $(length(E)), but needs $(n - 1)")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrf), libblastrampoline), Cvoid, + ccall((@blasfunc($pttrf), lbt), Cvoid, (Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}), n, D, E, info) chklapackerror(info[]) @@ -3312,7 +3308,7 @@ for (pttrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrs), libblastrampoline), Cvoid, + ccall((@blasfunc($pttrs), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), D, E, B, max(1,stride(B,2)), info) @@ -3346,7 +3342,7 @@ for (pttrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrs), libblastrampoline), Cvoid, + ccall((@blasfunc($pttrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), D, E, B, max(1,stride(B,2)), info, 1) @@ -3385,7 +3381,7 @@ for (trtri, trtrs, elty) in chkdiag(diag) lda = max(1,stride(A, 2)) info = Ref{BlasInt}() - ccall((@blasfunc($trtri), libblastrampoline), Cvoid, + ccall((@blasfunc($trtri), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), uplo, diag, n, A, lda, info, 1, 1) @@ -3411,7 +3407,7 @@ for (trtri, trtrs, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($trtrs), libblastrampoline), Cvoid, + ccall((@blasfunc($trtrs), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3468,7 +3464,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(undef, 3n) iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trcon), libblastrampoline), Cvoid, + ccall((@blasfunc($trcon), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3509,7 +3505,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(undef, 3n) info = Ref{BlasInt}() - ccall((@blasfunc($trevc), libblastrampoline), Cvoid, + ccall((@blasfunc($trevc), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, @@ -3566,7 +3562,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(undef, 3n) iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trrfs), libblastrampoline), Cvoid, + ccall((@blasfunc($trrfs), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3601,7 +3597,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trcon), libblastrampoline), Cvoid, + ccall((@blasfunc($trcon), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3643,7 +3639,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trevc), libblastrampoline), Cvoid, + ccall((@blasfunc($trevc), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, @@ -3700,7 +3696,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trrfs), libblastrampoline), Cvoid, + ccall((@blasfunc($trrfs), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3771,7 +3767,7 @@ for (stev, stebz, stegr, stein, elty) in Zmat = similar(dv, $elty, (n, job != 'N' ? n : 0)) work = Vector{$elty}(undef, max(1, 2n-2)) info = Ref{BlasInt}() - ccall((@blasfunc($stev), libblastrampoline), Cvoid, + ccall((@blasfunc($stev), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), job, n, dv, ev, Zmat, n, work, info, 1) @@ -3799,7 +3795,7 @@ for (stev, stebz, stegr, stein, elty) in work = Vector{$elty}(undef, 4*n) iwork = Vector{BlasInt}(undef, 3*n) info = Ref{BlasInt}() - ccall((@blasfunc($stebz), libblastrampoline), Cvoid, + ccall((@blasfunc($stebz), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -3840,7 +3836,7 @@ for (stev, stebz, stegr, stein, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($stegr), libblastrampoline), Cvoid, + ccall((@blasfunc($stegr), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -3905,7 +3901,7 @@ for (stev, stebz, stegr, stein, elty) in iwork = Vector{BlasInt}(undef, n) ifail = Vector{BlasInt}(undef, m) info = Ref{BlasInt}() - ccall((@blasfunc($stein), libblastrampoline), Cvoid, + ccall((@blasfunc($stein), lbt), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -3993,7 +3989,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($syconv), libblastrampoline), Cvoid, + ccall((@blasfunc($syconv), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong, Clong), uplo, 'C', n, A, max(1,stride(A,2)), ipiv, work, info, 1, 1) @@ -4022,7 +4018,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), libblastrampoline), Cvoid, + ccall((@blasfunc($sysv), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4056,7 +4052,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, + ccall((@blasfunc($sytrf), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, stride(A,2), ipiv, work, lwork, info, 1) @@ -4084,7 +4080,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($sytri), libblastrampoline), Cvoid, +# ccall((@blasfunc($sytri), lbt), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info, 1) @@ -4111,7 +4107,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), libblastrampoline), Cvoid, + ccall((@blasfunc($sytri), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4138,7 +4134,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, + ccall((@blasfunc($sytrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4174,7 +4170,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), libblastrampoline), Cvoid, + ccall((@blasfunc($sysv), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4208,7 +4204,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, + ccall((@blasfunc($sytrf), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, stride(A,2), ipiv, work, lwork, info, 1) @@ -4234,7 +4230,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), libblastrampoline), Cvoid, + ccall((@blasfunc($sytri), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4261,7 +4257,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, + ccall((@blasfunc($sytrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4301,7 +4297,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in # allocate info = Ref{BlasInt}() - ccall((@blasfunc($syconvf), libblastrampoline), Cvoid, + ccall((@blasfunc($syconvf), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -4336,7 +4332,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($syconv), libblastrampoline), Cvoid, + ccall((@blasfunc($syconv), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong, Clong), uplo, 'C', n, A, max(1,stride(A,2)), ipiv, work, info, 1, 1) @@ -4365,7 +4361,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hesv), libblastrampoline), Cvoid, + ccall((@blasfunc($hesv), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4396,7 +4392,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrf), libblastrampoline), Cvoid, + ccall((@blasfunc($hetrf), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4425,7 +4421,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($hetri), libblastrampoline), Cvoid, +# ccall((@blasfunc($hetri), lbt), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info, 1) @@ -4453,7 +4449,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($hetri), libblastrampoline), Cvoid, + ccall((@blasfunc($hetri), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4478,7 +4474,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($hetrs), libblastrampoline), Cvoid, + ccall((@blasfunc($hetrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4513,7 +4509,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hesv), libblastrampoline), Cvoid, + ccall((@blasfunc($hesv), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4544,7 +4540,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrf), libblastrampoline), Cvoid, + ccall((@blasfunc($hetrf), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4571,7 +4567,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($hetri), libblastrampoline), Cvoid, + ccall((@blasfunc($hetri), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4596,7 +4592,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($hetrs), libblastrampoline), Cvoid, + ccall((@blasfunc($hetrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4632,7 +4628,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), libblastrampoline), Cvoid, + ccall((@blasfunc($sysv), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4667,7 +4663,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, + ccall((@blasfunc($sytrf), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4696,7 +4692,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($sytri), libblastrampoline), Cvoid, +# ccall((@blasfunc($sytri), lbt), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info, 1) @@ -4723,7 +4719,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), libblastrampoline), Cvoid, + ccall((@blasfunc($sytri), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4749,7 +4745,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, + ccall((@blasfunc($sytrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4785,7 +4781,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), libblastrampoline), Cvoid, + ccall((@blasfunc($sysv), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4820,7 +4816,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, + ccall((@blasfunc($sytrf), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4847,7 +4843,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), libblastrampoline), Cvoid, + ccall((@blasfunc($sytri), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4873,7 +4869,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, + ccall((@blasfunc($sytrs), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4915,7 +4911,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in # allocate info = Ref{BlasInt}() - ccall((@blasfunc($syconvf), libblastrampoline), Cvoid, + ccall((@blasfunc($syconvf), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -5048,7 +5044,7 @@ for (syev, syevr, sygvd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($syev), libblastrampoline), Cvoid, + ccall((@blasfunc($syev), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), jobz, uplo, n, A, max(1,stride(A,2)), W, work, lwork, info, 1, 1) @@ -5099,7 +5095,7 @@ for (syev, syevr, sygvd, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($syevr), libblastrampoline), Cvoid, + ccall((@blasfunc($syevr), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{BlasInt}, @@ -5150,7 +5146,7 @@ for (syev, syevr, sygvd, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($sygvd), libblastrampoline), Cvoid, + ccall((@blasfunc($sygvd), lbt), Cvoid, (Ref{BlasInt}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, @@ -5194,7 +5190,7 @@ for (syev, syevr, sygvd, elty, relty) in rwork = Vector{$relty}(undef, max(1, 3n-2)) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($syev), libblastrampoline), Cvoid, + ccall((@blasfunc($syev), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong), @@ -5251,7 +5247,7 @@ for (syev, syevr, sygvd, elty, relty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1], lrwork as rwork[1] and liwork as iwork[1] - ccall((@blasfunc($syevr), libblastrampoline), Cvoid, + ccall((@blasfunc($syevr), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{BlasInt}, @@ -5308,7 +5304,7 @@ for (syev, syevr, sygvd, elty, relty) in lrwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1], lrwork as rwork[1] and liwork as iwork[1] - ccall((@blasfunc($sygvd), libblastrampoline), Cvoid, + ccall((@blasfunc($sygvd), lbt), Cvoid, (Ref{BlasInt}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, @@ -5409,7 +5405,7 @@ for (bdsqr, relty, elty) in # Allocate work = Vector{$relty}(undef, 4n) info = Ref{BlasInt}() - ccall((@blasfunc($bdsqr), libblastrampoline), Cvoid, + ccall((@blasfunc($bdsqr), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5480,7 +5476,7 @@ for (bdsdc, elty) in work = Vector{$elty}(undef, lwork) iwork = Vector{BlasInt}(undef, 8n) info = Ref{BlasInt}() - ccall((@blasfunc($bdsdc), libblastrampoline), Cvoid, + ccall((@blasfunc($bdsdc), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -5532,7 +5528,7 @@ for (gecon, elty) in work = Vector{$elty}(undef, 4n) iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($gecon), libblastrampoline), Cvoid, + ccall((@blasfunc($gecon), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), @@ -5566,7 +5562,7 @@ for (gecon, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() - ccall((@blasfunc($gecon), libblastrampoline), Cvoid, + ccall((@blasfunc($gecon), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ref{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}, Clong), @@ -5609,7 +5605,7 @@ for (gehrd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gehrd), libblastrampoline), Cvoid, + ccall((@blasfunc($gehrd), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -5660,7 +5656,7 @@ for (orghr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orghr), libblastrampoline), Cvoid, + ccall((@blasfunc($orghr), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -5717,7 +5713,7 @@ for (ormhr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormhr), libblastrampoline), Cvoid, + ccall((@blasfunc($ormhr), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5763,7 +5759,7 @@ for (hetrd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrd), libblastrampoline), Cvoid, + ccall((@blasfunc($hetrd), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -5813,7 +5809,7 @@ for (orgtr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgtr), libblastrampoline), Cvoid, + ccall((@blasfunc($orgtr), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -5871,7 +5867,7 @@ for (ormtr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormtr), libblastrampoline), Cvoid, + ccall((@blasfunc($ormtr), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5916,7 +5912,7 @@ for (gees, gges, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gees), libblastrampoline), Cvoid, + ccall((@blasfunc($gees), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5961,7 +5957,7 @@ for (gees, gges, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gges), libblastrampoline), Cvoid, + ccall((@blasfunc($gges), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -6011,7 +6007,7 @@ for (gees, gges, elty, relty) in rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gees), libblastrampoline), Cvoid, + ccall((@blasfunc($gees), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -6057,7 +6053,7 @@ for (gees, gges, elty, relty) in rwork = Vector{$relty}(undef, 8n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gges), libblastrampoline), Cvoid, + ccall((@blasfunc($gges), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -6122,7 +6118,7 @@ for (trexc, trsen, tgsen, elty) in ldq = max(1, stride(Q, 2)) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trexc), libblastrampoline), Cvoid, + ccall((@blasfunc($trexc), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, @@ -6164,7 +6160,7 @@ for (trexc, trsen, tgsen, elty) in s = Ref{$elty}(zero($elty)) sep = Ref{$elty}(zero($elty)) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($trsen), libblastrampoline), Cvoid, + ccall((@blasfunc($trsen), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, @@ -6229,7 +6225,7 @@ for (trexc, trsen, tgsen, elty) in info = Ref{BlasInt}() select = convert(Array{BlasInt}, select) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($tgsen), libblastrampoline), Cvoid, + ccall((@blasfunc($tgsen), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, @@ -6273,7 +6269,7 @@ for (trexc, trsen, tgsen, elty, relty) in ldt = max(1, stride(T, 2)) ldq = max(1, stride(Q, 2)) info = Ref{BlasInt}() - ccall((@blasfunc($trexc), libblastrampoline), Cvoid, + ccall((@blasfunc($trexc), lbt), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, @@ -6311,7 +6307,7 @@ for (trexc, trsen, tgsen, elty, relty) in s = Ref{$relty}(zero($relty)) sep = Ref{$relty}(zero($relty)) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($trsen), libblastrampoline), Cvoid, + ccall((@blasfunc($trsen), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ref{$relty}, @@ -6373,7 +6369,7 @@ for (trexc, trsen, tgsen, elty, relty) in info = Ref{BlasInt}() select = convert(Array{BlasInt}, select) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($tgsen), libblastrampoline), Cvoid, + ccall((@blasfunc($tgsen), lbt), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -6459,7 +6455,7 @@ for (fn, elty, relty) in ((:dtrsyl_, :Float64, :Float64), ldc = max(1, stride(C, 2)) scale = Ref{$relty}() info = Ref{BlasInt}() - ccall((@blasfunc($fn), libblastrampoline), Cvoid, + ccall((@blasfunc($fn), lbt), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong), diff --git a/stdlib/libblastrampoline_jll/Project.toml b/stdlib/libblastrampoline_jll/Project.toml index 26c67dae8dffd..63cad3d67acf8 100644 --- a/stdlib/libblastrampoline_jll/Project.toml +++ b/stdlib/libblastrampoline_jll/Project.toml @@ -5,7 +5,6 @@ version = "5.0.1+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" -OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363" [compat] julia = "1.8" From 322f38c59ce2cd80c8677c5a47146d56060c9c92 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sat, 26 Feb 2022 19:22:38 +0000 Subject: [PATCH 3/6] Fix --- stdlib/LinearAlgebra/src/LinearAlgebra.jl | 23 -- stdlib/LinearAlgebra/src/blas.jl | 96 ++++---- stdlib/LinearAlgebra/src/lapack.jl | 279 +++++++++++----------- 3 files changed, 184 insertions(+), 214 deletions(-) diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index 442264cd7dc78..06561c188a5df 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -565,29 +565,6 @@ function versioninfo(io::IO=stdout) return nothing end -function find_library_path(name) - shlib_ext = string(".", Libdl.dlext) - if !endswith(name, shlib_ext) - name_ext = string(name, shlib_ext) - end - - # On windows, we look in `bin` and never in `lib` - @static if Sys.iswindows() - path = joinpath(Sys.BINDIR, name_ext) - isfile(path) && return path - else - # On other platforms, we check `lib/julia` first, and if that doesn't exist, `lib`. - path = joinpath(Sys.BINDIR, Base.LIBDIR, "julia", name_ext) - isfile(path) && return path - - path = joinpath(Sys.BINDIR, Base.LIBDIR, name_ext) - isfile(path) && return path - end - - # If we can't find it by absolute path, we'll try just passing this straight through to `dlopen()` - return name -end - function __init__() try BLAS.lbt_forward(OpenBLAS_jll.libopenblas_path; clear=true) diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index 0c79f07dde502..1a2464d482050 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -63,11 +63,7 @@ export trsm!, trsm -import LinearAlgebra -using LinearAlgebra: BlasReal, BlasComplex, BlasFloat, BlasInt, DimensionMismatch, checksquare, stride1, chkstride1 - -using libblastrampoline_jll -const lbt = libblastrampoline_jll.libblastrampoline +using ..LinearAlgebra: libblastrampoline, BlasReal, BlasComplex, BlasFloat, BlasInt, DimensionMismatch, checksquare, stride1, chkstride1 include("lbt.jl") @@ -189,7 +185,7 @@ for (fname, elty) in ((:dcopy_,:Float64), @eval begin # SUBROUTINE DCOPY(N,DX,INCX,DY,INCY) function blascopy!(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, DX, incx, DY, incy) DY @@ -211,12 +207,12 @@ first `n` elements of array `Y` with stride `incy`. Returns `X` and `Y`. """ function rot! end -for (fname, elty, cty, sty, lib) in ((:drot_, :Float64, :Float64, :Float64, lbt), - (:srot_, :Float32, :Float32, :Float32, lbt), - (:zdrot_, :ComplexF64, :Float64, :Float64, lbt), - (:csrot_, :ComplexF32, :Float32, :Float32, lbt), - (:zrot_, :ComplexF64, :Float64, :ComplexF64, lbt), - (:crot_, :ComplexF32, :Float32, :ComplexF32, lbt)) +for (fname, elty, cty, sty, lib) in ((:drot_, :Float64, :Float64, :Float64, libblastrampoline), + (:srot_, :Float32, :Float32, :Float32, libblastrampoline), + (:zdrot_, :ComplexF64, :Float64, :Float64, libblastrampoline), + (:csrot_, :ComplexF32, :Float32, :Float32, libblastrampoline), + (:zrot_, :ComplexF64, :Float64, :ComplexF64, libblastrampoline), + (:crot_, :ComplexF32, :Float32, :ComplexF32, libblastrampoline)) @eval begin # SUBROUTINE DROT(N,DX,INCX,DY,INCY,C,S) function rot!(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer, C::$cty, S::$sty) @@ -257,7 +253,7 @@ for (fname, elty) in ((:dscal_,:Float64), @eval begin # SUBROUTINE DSCAL(N,DA,DX,INCX) function scal!(n::Integer, DA::$elty, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), n, DA, DX, incx) DX @@ -328,7 +324,7 @@ for (fname, elty) in ((:cblas_ddot,:Float64), # * .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function dot(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), lbt), $elty, + ccall((@blasfunc($fname), libblastrampoline), $elty, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt), n, DX, incx, DY, incy) end @@ -345,7 +341,7 @@ for (fname, elty) in ((:cblas_zdotc_sub,:ComplexF64), # DOUBLE PRECISION DX(*),DY(*) function dotc(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) result = Ref{$elty}() - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[] @@ -363,7 +359,7 @@ for (fname, elty) in ((:cblas_zdotu_sub,:ComplexF64), # DOUBLE PRECISION DX(*),DY(*) function dotu(n::Integer, DX::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},AbstractArray{$elty}}, incy::Integer) result = Ref{$elty}() - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[] @@ -408,7 +404,7 @@ for (fname, elty, ret_type) in ((:dnrm2_,:Float64,:Float64), @eval begin # SUBROUTINE DNRM2(N,X,INCX) function nrm2(n::Integer, X::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), lbt), $ret_type, + ccall((@blasfunc($fname), libblastrampoline), $ret_type, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, X, incx) end @@ -449,7 +445,7 @@ for (fname, elty, ret_type) in ((:dasum_,:Float64,:Float64), @eval begin # SUBROUTINE ASUM(N, X, INCX) function asum(n::Integer, X::Union{Ptr{$elty},AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), lbt), $ret_type, + ccall((@blasfunc($fname), libblastrampoline), $ret_type, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, X, incx) end @@ -495,7 +491,7 @@ for (fname, elty) in ((:daxpy_,:Float64), #* .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function axpy!(n::Integer, alpha::($elty), dx::Union{Ptr{$elty}, AbstractArray{$elty}}, incx::Integer, dy::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, alpha, dx, incx, dy, incy) dy @@ -566,7 +562,7 @@ for (fname, elty) in ((:daxpby_,:Float64), (:saxpby_,:Float32), function axpby!(n::Integer, alpha::($elty), dx::Union{Ptr{$elty}, AbstractArray{$elty}}, incx::Integer, beta::($elty), dy::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), lbt), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}), n, alpha, dx, incx, beta, dy, incy) dy @@ -591,7 +587,7 @@ for (fname, elty) in ((:idamax_,:Float64), (:icamax_,:ComplexF32)) @eval begin function iamax(n::Integer, dx::Union{Ptr{$elty}, AbstractArray{$elty}}, incx::Integer) - ccall((@blasfunc($fname), lbt),BlasInt, + ccall((@blasfunc($fname), libblastrampoline),BlasInt, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), n, dx, incx) end @@ -651,7 +647,7 @@ for (fname, elty) in ((:dgemv_,:Float64), end lda >= size(A,1) || size(A,2) <= 1 || error("when `size(A,2) > 1`, `abs(stride(A,2))` must be at least `size(A,1)`") lda = max(1, size(A,1), lda) - GC.@preserve A X Y ccall((@blasfunc($fname), lbt), Cvoid, + GC.@preserve A X Y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -733,7 +729,7 @@ for (fname, elty) in ((:dgbmv_,:Float64), chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, @@ -765,10 +761,10 @@ Only the [`ul`](@ref stdlib-blas-uplo) triangle of `A` is used. """ function symv! end -for (fname, elty, lib) in ((:dsymv_,:Float64,lbt), - (:ssymv_,:Float32,lbt), - (:zsymv_,:ComplexF64,lbt), - (:csymv_,:ComplexF32,lbt)) +for (fname, elty, lib) in ((:dsymv_,:Float64,libblastrampoline), + (:ssymv_,:Float32,libblastrampoline), + (:zsymv_,:ComplexF64,libblastrampoline), + (:csymv_,:ComplexF32,libblastrampoline)) # Note that the complex symv are not BLAS but auiliary functions in LAPACK @eval begin # SUBROUTINE DSYMV(UPLO,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) @@ -861,7 +857,7 @@ for (fname, elty) in ((:zhemv_,:ComplexF64), lda = max(1, stride(A, 2)) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -918,7 +914,7 @@ for (fname, elty) in ((:zhpmv_, :ComplexF64), y::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, # uplo, Ref{BlasInt}, # n, Ref{$elty}, # α, @@ -1003,7 +999,7 @@ for (fname, elty) in ((:dsbmv_,:Float64), chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -1075,7 +1071,7 @@ for (fname, elty) in ((:dspmv_, :Float64), y::Union{Ptr{$elty}, AbstractArray{$elty}}, incy::Integer) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, # uplo, Ref{BlasInt}, # n, Ref{$elty}, # α, @@ -1154,7 +1150,7 @@ for (fname, elty) in ((:dspr_, :Float64), incx::Integer, AP::Union{Ptr{$elty}, AbstractArray{$elty}}) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, # uplo, Ref{BlasInt}, # n, Ref{$elty}, # α, @@ -1228,7 +1224,7 @@ for (fname, elty) in ((:zhbmv_,:ComplexF64), chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), @@ -1290,7 +1286,7 @@ for (fname, elty) in ((:dtrmv_,:Float64), end chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) - GC.@preserve x ccall((@blasfunc($fname), lbt), Cvoid, + GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong), @@ -1347,7 +1343,7 @@ for (fname, elty) in ((:dtrsv_,:Float64), end chkstride1(A) px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) - GC.@preserve x ccall((@blasfunc($fname), lbt), Cvoid, + GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong), @@ -1383,7 +1379,7 @@ for (fname, elty) in ((:dger_,:Float64), end px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) py, sty = vec_pointer_stride(y, ArgumentError("input vector with 0 stride is not allowed")) - GC.@preserve x y ccall((@blasfunc($fname), lbt), Cvoid, + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), @@ -1403,10 +1399,10 @@ Rank-1 update of the symmetric matrix `A` with vector `x` as `alpha*x*transpose( """ function syr! end -for (fname, elty, lib) in ((:dsyr_,:Float64,lbt), - (:ssyr_,:Float32,lbt), - (:zsyr_,:ComplexF64,lbt), - (:csyr_,:ComplexF32,lbt)) +for (fname, elty, lib) in ((:dsyr_,:Float64,libblastrampoline), + (:ssyr_,:Float32,libblastrampoline), + (:zsyr_,:ComplexF64,libblastrampoline), + (:csyr_,:ComplexF32,libblastrampoline)) @eval begin function syr!(uplo::AbstractChar, α::$elty, x::AbstractVector{$elty}, A::AbstractMatrix{$elty}) chkuplo(uplo) @@ -1447,7 +1443,7 @@ for (fname, elty, relty) in ((:zher_,:ComplexF64, :Float64), throw(DimensionMismatch(lazy"A has size ($n,$n), x has length $(length(x))")) end px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) - GC.@preserve x ccall((@blasfunc($fname), lbt), Cvoid, + GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong), uplo, n, α, px, stx, A, max(1,stride(A,2)), 1) @@ -1499,7 +1495,7 @@ for (gemm, elty) in chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($gemm), lbt), Cvoid, + ccall((@blasfunc($gemm), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, @@ -1563,7 +1559,7 @@ for (mfname, elty) in ((:dsymm_,:Float64), chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($mfname), lbt), Cvoid, + ccall((@blasfunc($mfname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1637,7 +1633,7 @@ for (mfname, elty) in ((:zhemm_,:ComplexF64), chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($mfname), lbt), Cvoid, + ccall((@blasfunc($mfname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1727,7 +1723,7 @@ for (fname, elty) in ((:dsyrk_,:Float64), k = size(A, trans == 'N' ? 2 : 1) chkstride1(A) chkstride1(C) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong), @@ -1786,7 +1782,7 @@ for (fname, elty, relty) in ((:zherk_, :ComplexF64, :Float64), chkstride1(A) chkstride1(C) k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong), @@ -1830,7 +1826,7 @@ for (fname, elty) in ((:dsyr2k_,:Float64), chkstride1(A) chkstride1(B) chkstride1(C) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong), @@ -1898,7 +1894,7 @@ for (fname, elty1, elty2) in ((:zher2k_,:ComplexF64,:Float64), (:cher2k_,:Comple chkstride1(B) chkstride1(C) k = size(A, trans == 'N' ? 2 : 1) - ccall((@blasfunc($fname), lbt), Cvoid, + ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty1}, Ptr{$elty1}, Ref{BlasInt}, Ptr{$elty1}, Ref{BlasInt}, Ref{$elty2}, Ptr{$elty1}, Ref{BlasInt}, Clong, Clong), @@ -2014,7 +2010,7 @@ for (mmname, smname, elty) in end chkstride1(A) chkstride1(B) - ccall((@blasfunc($mmname), lbt), Cvoid, + ccall((@blasfunc($mmname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong, Clong), @@ -2045,7 +2041,7 @@ for (mmname, smname, elty) in end chkstride1(A) chkstride1(B) - ccall((@blasfunc($smname), lbt), Cvoid, + ccall((@blasfunc($smname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, diff --git a/stdlib/LinearAlgebra/src/lapack.jl b/stdlib/LinearAlgebra/src/lapack.jl index 1aa21b5263d70..cd438f142a793 100644 --- a/stdlib/LinearAlgebra/src/lapack.jl +++ b/stdlib/LinearAlgebra/src/lapack.jl @@ -7,14 +7,11 @@ Interfaces to LAPACK subroutines. using ..LinearAlgebra.BLAS: @blasfunc, chkuplo -using ..LinearAlgebra: BlasFloat, BlasInt, LAPACKException, DimensionMismatch, +using ..LinearAlgebra: libblastrampoline, BlasFloat, BlasInt, LAPACKException, DimensionMismatch, SingularException, PosDefException, chkstride1, checksquare,triu, tril, dot using Base: iszero, require_one_based_indexing -using libblastrampoline_jll -const lbt = libblastrampoline_jll.libblastrampoline - #Generic LAPACK error handlers """ Handle only negative LAPACK error codes @@ -109,7 +106,7 @@ function version() major = Ref{BlasInt}(0) minor = Ref{BlasInt}(0) patch = Ref{BlasInt}(0) - ccall((@blasfunc(ilaver_), lbt), Cvoid, + ccall((@blasfunc(ilaver_), libblastrampoline), Cvoid, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), major, minor, patch) return VersionNumber(major[], minor[], patch[]) @@ -135,7 +132,7 @@ for (gbtrf, gbtrs, elty) in mnmn = min(m, n) ipiv = similar(AB, BlasInt, mnmn) info = Ref{BlasInt}() - ccall((@blasfunc($gbtrf), lbt), Cvoid, + ccall((@blasfunc($gbtrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), m, n, kl, ku, AB, max(1,stride(AB,2)), ipiv, info) @@ -161,7 +158,7 @@ for (gbtrf, gbtrs, elty) in if m != n || m != size(B,1) throw(DimensionMismatch("matrix AB has dimensions $(size(AB)), but right hand side matrix B has dimensions $(size(B))")) end - ccall((@blasfunc($gbtrs), lbt), Cvoid, + ccall((@blasfunc($gbtrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -215,7 +212,7 @@ for (gebal, gebak, elty, relty) in ilo = Ref{BlasInt}() scale = similar(A, $relty, n) info = Ref{BlasInt}() - ccall((@blasfunc($gebal), lbt), Cvoid, + ccall((@blasfunc($gebal), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}, Clong), job, n, A, max(1,stride(A,2)), ilo, ihi, scale, info, 1) @@ -238,7 +235,7 @@ for (gebal, gebak, elty, relty) in chkfinite(V) # balancing routines don't support NaNs and Infs n = checksquare(V) info = Ref{BlasInt}() - ccall((@blasfunc($gebak), lbt), Cvoid, + ccall((@blasfunc($gebak), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -305,7 +302,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gebrd), lbt), Cvoid, + ccall((@blasfunc($gebrd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -339,7 +336,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelqf), lbt), Cvoid, + ccall((@blasfunc($gelqf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, tau, work, lwork, info) @@ -370,7 +367,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geqlf), lbt), Cvoid, + ccall((@blasfunc($geqlf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, tau, work, lwork, info) @@ -412,7 +409,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($geqp3), lbt), Cvoid, + ccall((@blasfunc($geqp3), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), @@ -420,7 +417,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty jpvt, tau, work, lwork, rwork, info) else - ccall((@blasfunc($geqp3), lbt), Cvoid, + ccall((@blasfunc($geqp3), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -450,7 +447,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, nb*n) if n > 0 info = Ref{BlasInt}() - ccall((@blasfunc($geqrt), lbt), Cvoid, + ccall((@blasfunc($geqrt), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), @@ -476,7 +473,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty end if n > 0 info = Ref{BlasInt}() - ccall((@blasfunc($geqrt3), lbt), Cvoid, + ccall((@blasfunc($geqrt3), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1, stride(A, 2)), @@ -503,7 +500,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geqrf), lbt), Cvoid, + ccall((@blasfunc($geqrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -532,7 +529,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gerqf), lbt), Cvoid, + ccall((@blasfunc($gerqf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -558,7 +555,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lda = max(1,stride(A, 2)) ipiv = similar(A, BlasInt, min(m,n)) info = Ref{BlasInt}() - ccall((@blasfunc($getrf), lbt), Cvoid, + ccall((@blasfunc($getrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), m, n, A, lda, ipiv, info) @@ -765,7 +762,7 @@ for (larfg, elty) in α = Ref{$elty}(x[1]) incx = BlasInt(1) τ = Ref{$elty}(0) - ccall((@blasfunc($larfg), lbt), Cvoid, + ccall((@blasfunc($larfg), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}), N, α, pointer(x, 2), incx, τ) @inbounds x[1] = one($elty) @@ -794,7 +791,7 @@ for (larf, elty) in ldc = max(1, stride(C, 2)) l = side == 'L' ? n : m incv = BlasInt(1) - ccall((@blasfunc($larf), lbt), Cvoid, + ccall((@blasfunc($larf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Clong), side, m, n, v, incv, @@ -839,7 +836,7 @@ for (tzrzf, ormrz, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($tzrzf), lbt), Cvoid, + ccall((@blasfunc($tzrzf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, A, lda, @@ -877,7 +874,7 @@ for (tzrzf, ormrz, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormrz), lbt), Cvoid, + ccall((@blasfunc($ormrz), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -942,7 +939,7 @@ for (gels, gesv, getrs, getri, elty) in work = Vector{$elty}(undef, 1) lwork = BlasInt(-1) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gels), lbt), Cvoid, + ccall((@blasfunc($gels), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -983,7 +980,7 @@ for (gels, gesv, getrs, getri, elty) in end ipiv = similar(A, BlasInt, n) info = Ref{BlasInt}() - ccall((@blasfunc($gesv), lbt), Cvoid, + ccall((@blasfunc($gesv), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info) @@ -1008,7 +1005,7 @@ for (gels, gesv, getrs, getri, elty) in end nrhs = size(B, 2) info = Ref{BlasInt}() - ccall((@blasfunc($getrs), lbt), Cvoid, + ccall((@blasfunc($getrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), trans, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -1034,7 +1031,7 @@ for (gels, gesv, getrs, getri, elty) in work = Vector{$elty}(undef, 1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($getri), lbt), Cvoid, + ccall((@blasfunc($getri), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, A, lda, ipiv, work, lwork, info) @@ -1130,7 +1127,7 @@ for (gesvx, elty) in iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() X = similar(A, $elty, n, nrhs) - ccall((@blasfunc($gesvx), lbt), Cvoid, + ccall((@blasfunc($gesvx), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{UInt8}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1200,7 +1197,7 @@ for (gesvx, elty, relty) in rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() X = similar(A, $elty, n, nrhs) - ccall((@blasfunc($gesvx), lbt), Cvoid, + ccall((@blasfunc($gesvx), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{UInt8}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, @@ -1296,7 +1293,7 @@ for (gelsd, gelsy, elty) in lwork = BlasInt(-1) iwork = Vector{BlasInt}(undef, 1) for i = 1:2 # first call returns lwork as work[1] and iwork length as iwork[1] - ccall((@blasfunc($gelsd), lbt), Cvoid, + ccall((@blasfunc($gelsd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1342,7 +1339,7 @@ for (gelsd, gelsy, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelsy), lbt), Cvoid, + ccall((@blasfunc($gelsy), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1392,7 +1389,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Vector{$relty}(undef, 1) iwork = Vector{BlasInt}(undef, 1) for i = 1:2 # first call returns lwork as work[1], rwork length as rwork[1] and iwork length as iwork[1] - ccall((@blasfunc($gelsd), lbt), Cvoid, + ccall((@blasfunc($gelsd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ref{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1440,7 +1437,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gelsy), lbt), Cvoid, + ccall((@blasfunc($gelsy), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{$relty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1515,7 +1512,7 @@ for (gglse, elty) in ((:dgglse_, :Float64), work = Vector{$elty}(undef, 1) lwork = BlasInt(-1) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gglse), lbt), Cvoid, + ccall((@blasfunc($gglse), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -1578,7 +1575,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($geev), lbt), Cvoid, + ccall((@blasfunc($geev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1586,7 +1583,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in jobvl, jobvr, n, A, max(1,stride(A,2)), W, VL, n, VR, n, work, lwork, rwork, info, 1, 1) else - ccall((@blasfunc($geev), lbt), Cvoid, + ccall((@blasfunc($geev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1642,7 +1639,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($gesdd), lbt), Cvoid, + ccall((@blasfunc($gesdd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1650,7 +1647,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in job, m, n, A, max(1,stride(A,2)), S, U, max(1,stride(U,2)), VT, max(1,stride(VT,2)), work, lwork, rwork, iwork, info, 1) else - ccall((@blasfunc($gesdd), lbt), Cvoid, + ccall((@blasfunc($gesdd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1711,7 +1708,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] if cmplx - ccall((@blasfunc($gesvd), lbt), Cvoid, + ccall((@blasfunc($gesvd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1719,7 +1716,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in jobu, jobvt, m, n, A, max(1,stride(A,2)), S, U, max(1,stride(U,2)), VT, max(1,stride(VT,2)), work, lwork, rwork, info, 1, 1) else - ccall((@blasfunc($gesvd), lbt), Cvoid, + ccall((@blasfunc($gesvd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -1791,7 +1788,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() if cmplx - ccall((@blasfunc($ggsvd), lbt), Cvoid, + ccall((@blasfunc($ggsvd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1807,7 +1804,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in work, rwork, iwork, info, 1, 1, 1) else - ccall((@blasfunc($ggsvd), lbt), Cvoid, + ccall((@blasfunc($ggsvd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1915,7 +1912,7 @@ for (f, elty) in ((:dggsvd3_, :Float64), iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($f), lbt), Cvoid, + ccall((@blasfunc($f), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -1975,7 +1972,7 @@ for (f, elty, relty) in ((:zggsvd3_, :ComplexF64, :Float64), iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($f), lbt), Cvoid, + ccall((@blasfunc($f), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2083,7 +2080,7 @@ for (geevx, ggev, elty) in iwork = Vector{BlasInt}(undef, iworksize) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geevx), lbt), Cvoid, + ccall((@blasfunc($geevx), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -2151,7 +2148,7 @@ for (geevx, ggev, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ggev), lbt), Cvoid, + ccall((@blasfunc($ggev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, @@ -2231,7 +2228,7 @@ for (geevx, ggev, elty, relty) in rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($geevx), lbt), Cvoid, + ccall((@blasfunc($geevx), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2298,7 +2295,7 @@ for (geevx, ggev, elty, relty) in rwork = Vector{$relty}(undef, 8n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ggev), lbt), Cvoid, + ccall((@blasfunc($ggev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -2372,7 +2369,7 @@ for (laic1, elty) in sestpr = Vector{$elty}(undef, 1) s = Vector{$elty}(undef, 1) c = Vector{$elty}(undef, 1) - ccall((@blasfunc($laic1), lbt), Cvoid, + ccall((@blasfunc($laic1), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{$elty}, Ptr{$elty}, Ref{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}), @@ -2406,7 +2403,7 @@ for (laic1, elty, relty) in sestpr = Vector{$relty}(undef, 1) s = Vector{$elty}(undef, 1) c = Vector{$elty}(undef, 1) - ccall((@blasfunc($laic1), lbt), Cvoid, + ccall((@blasfunc($laic1), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{$relty}, Ptr{$elty}, Ref{$elty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}), @@ -2448,7 +2445,7 @@ for (gtsv, gttrf, gttrs, elty) in return B # Early exit if possible end info = Ref{BlasInt}() - ccall((@blasfunc($gtsv), lbt), Cvoid, + ccall((@blasfunc($gtsv), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), dl, d, du, B, max(1,stride(B,2)), info) @@ -2475,7 +2472,7 @@ for (gtsv, gttrf, gttrs, elty) in du2 = similar(d, $elty, n-2) ipiv = similar(d, BlasInt, n) info = Ref{BlasInt}() - ccall((@blasfunc($gttrf), lbt), Cvoid, + ccall((@blasfunc($gttrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), n, dl, d, du, du2, ipiv, info) @@ -2507,7 +2504,7 @@ for (gtsv, gttrf, gttrs, elty) in throw(DimensionMismatch("B has leading dimension $(size(B,1)), but should have $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($gttrs), lbt), Cvoid, + ccall((@blasfunc($gttrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -2574,7 +2571,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orglq), lbt), Cvoid, + ccall((@blasfunc($orglq), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, max(1,stride(A,2)), tau, work, lwork, info) @@ -2608,7 +2605,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgqr), lbt), Cvoid, + ccall((@blasfunc($orgqr), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2644,7 +2641,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgql), lbt), Cvoid, + ccall((@blasfunc($orgql), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2682,7 +2679,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgrq), lbt), Cvoid, + ccall((@blasfunc($orgrq), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), m, n, k, A, @@ -2729,7 +2726,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormlq), lbt), Cvoid, + ccall((@blasfunc($ormlq), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -2776,7 +2773,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormqr), lbt), Cvoid, + ccall((@blasfunc($ormqr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2826,7 +2823,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormql), lbt), Cvoid, + ccall((@blasfunc($ormql), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -2876,7 +2873,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormrq), lbt), Cvoid, + ccall((@blasfunc($ormrq), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -2932,7 +2929,7 @@ for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in ldc = stride(C, 2) work = Vector{$elty}(undef, wss) info = Ref{BlasInt}() - ccall((@blasfunc($gemqrt), lbt), Cvoid, + ccall((@blasfunc($gemqrt), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -3051,7 +3048,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in throw(DimensionMismatch("first dimension of B, $(size(B,1)), and size of A, ($n,$n), must match!")) end info = Ref{BlasInt}() - ccall((@blasfunc($posv), lbt), Cvoid, + ccall((@blasfunc($posv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), B, max(1,stride(B,2)), info, 1) @@ -3076,7 +3073,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in return A, 0 end info = Ref{BlasInt}() - ccall((@blasfunc($potrf), lbt), Cvoid, + ccall((@blasfunc($potrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, size(A,1), A, lda, info, 1) chkargsok(info[]) @@ -3097,7 +3094,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in chkstride1(A) chkuplo(uplo) info = Ref{BlasInt}() - ccall((@blasfunc($potri), lbt), Cvoid, + ccall((@blasfunc($potri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, size(A,1), A, max(1,stride(A,2)), info, 1) chkargsok(info[]) @@ -3126,7 +3123,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in end ldb = max(1,stride(B,2)) info = Ref{BlasInt}() - ccall((@blasfunc($potrs), lbt), Cvoid, + ccall((@blasfunc($potrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, nrhs, A, @@ -3151,7 +3148,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in rank = Vector{BlasInt}(undef, 1) work = Vector{$rtyp}(undef, 2n) info = Ref{BlasInt}() - ccall((@blasfunc($pstrf), lbt), Cvoid, + ccall((@blasfunc($pstrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ref{$rtyp}, Ptr{$rtyp}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), piv, rank, tol, work, info, 1) @@ -3240,7 +3237,7 @@ for (ptsv, pttrf, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($ptsv), lbt), Cvoid, + ccall((@blasfunc($ptsv), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), D, E, B, max(1,stride(B,2)), info) @@ -3261,7 +3258,7 @@ for (ptsv, pttrf, elty, relty) in throw(DimensionMismatch("E has length $(length(E)), but needs $(n - 1)")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrf), lbt), Cvoid, + ccall((@blasfunc($pttrf), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}), n, D, E, info) chklapackerror(info[]) @@ -3308,7 +3305,7 @@ for (pttrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrs), lbt), Cvoid, + ccall((@blasfunc($pttrs), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), n, size(B,2), D, E, B, max(1,stride(B,2)), info) @@ -3342,7 +3339,7 @@ for (pttrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($pttrs), lbt), Cvoid, + ccall((@blasfunc($pttrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), D, E, B, max(1,stride(B,2)), info, 1) @@ -3381,7 +3378,7 @@ for (trtri, trtrs, elty) in chkdiag(diag) lda = max(1,stride(A, 2)) info = Ref{BlasInt}() - ccall((@blasfunc($trtri), lbt), Cvoid, + ccall((@blasfunc($trtri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), uplo, diag, n, A, lda, info, 1, 1) @@ -3407,7 +3404,7 @@ for (trtri, trtrs, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)) but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($trtrs), lbt), Cvoid, + ccall((@blasfunc($trtrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3464,7 +3461,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(undef, 3n) iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trcon), lbt), Cvoid, + ccall((@blasfunc($trcon), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3505,7 +3502,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(undef, 3n) info = Ref{BlasInt}() - ccall((@blasfunc($trevc), lbt), Cvoid, + ccall((@blasfunc($trevc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, @@ -3562,7 +3559,7 @@ for (trcon, trevc, trrfs, elty) in work = Vector{$elty}(undef, 3n) iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trrfs), lbt), Cvoid, + ccall((@blasfunc($trrfs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3597,7 +3594,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trcon), lbt), Cvoid, + ccall((@blasfunc($trcon), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3639,7 +3636,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trevc), lbt), Cvoid, + ccall((@blasfunc($trevc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, @@ -3696,7 +3693,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trrfs), lbt), Cvoid, + ccall((@blasfunc($trrfs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong, Clong), @@ -3767,7 +3764,7 @@ for (stev, stebz, stegr, stein, elty) in Zmat = similar(dv, $elty, (n, job != 'N' ? n : 0)) work = Vector{$elty}(undef, max(1, 2n-2)) info = Ref{BlasInt}() - ccall((@blasfunc($stev), lbt), Cvoid, + ccall((@blasfunc($stev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), job, n, dv, ev, Zmat, n, work, info, 1) @@ -3795,7 +3792,7 @@ for (stev, stebz, stegr, stein, elty) in work = Vector{$elty}(undef, 4*n) iwork = Vector{BlasInt}(undef, 3*n) info = Ref{BlasInt}() - ccall((@blasfunc($stebz), lbt), Cvoid, + ccall((@blasfunc($stebz), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -3836,7 +3833,7 @@ for (stev, stebz, stegr, stein, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($stegr), lbt), Cvoid, + ccall((@blasfunc($stegr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -3901,7 +3898,7 @@ for (stev, stebz, stegr, stein, elty) in iwork = Vector{BlasInt}(undef, n) ifail = Vector{BlasInt}(undef, m) info = Ref{BlasInt}() - ccall((@blasfunc($stein), lbt), Cvoid, + ccall((@blasfunc($stein), libblastrampoline), Cvoid, (Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -3989,7 +3986,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($syconv), lbt), Cvoid, + ccall((@blasfunc($syconv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong, Clong), uplo, 'C', n, A, max(1,stride(A,2)), ipiv, work, info, 1, 1) @@ -4018,7 +4015,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), lbt), Cvoid, + ccall((@blasfunc($sysv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4052,7 +4049,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), lbt), Cvoid, + ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, stride(A,2), ipiv, work, lwork, info, 1) @@ -4080,7 +4077,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($sytri), lbt), Cvoid, +# ccall((@blasfunc($sytri), libblastrampoline), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info, 1) @@ -4107,7 +4104,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), lbt), Cvoid, + ccall((@blasfunc($sytri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4134,7 +4131,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), lbt), Cvoid, + ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4170,7 +4167,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), lbt), Cvoid, + ccall((@blasfunc($sysv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4204,7 +4201,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), lbt), Cvoid, + ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, stride(A,2), ipiv, work, lwork, info, 1) @@ -4230,7 +4227,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), lbt), Cvoid, + ccall((@blasfunc($sytri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4257,7 +4254,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), lbt), Cvoid, + ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4297,7 +4294,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty) in # allocate info = Ref{BlasInt}() - ccall((@blasfunc($syconvf), lbt), Cvoid, + ccall((@blasfunc($syconvf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -4332,7 +4329,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($syconv), lbt), Cvoid, + ccall((@blasfunc($syconv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong, Clong), uplo, 'C', n, A, max(1,stride(A,2)), ipiv, work, info, 1, 1) @@ -4361,7 +4358,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hesv), lbt), Cvoid, + ccall((@blasfunc($hesv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4392,7 +4389,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrf), lbt), Cvoid, + ccall((@blasfunc($hetrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4421,7 +4418,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($hetri), lbt), Cvoid, +# ccall((@blasfunc($hetri), libblastrampoline), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info, 1) @@ -4449,7 +4446,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($hetri), lbt), Cvoid, + ccall((@blasfunc($hetri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4474,7 +4471,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($hetrs), lbt), Cvoid, + ccall((@blasfunc($hetrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4509,7 +4506,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hesv), lbt), Cvoid, + ccall((@blasfunc($hesv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4540,7 +4537,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i in 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrf), lbt), Cvoid, + ccall((@blasfunc($hetrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4567,7 +4564,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($hetri), lbt), Cvoid, + ccall((@blasfunc($hetri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4592,7 +4589,7 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($hetrs), lbt), Cvoid, + ccall((@blasfunc($hetrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4628,7 +4625,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), lbt), Cvoid, + ccall((@blasfunc($sysv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4663,7 +4660,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), lbt), Cvoid, + ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4692,7 +4689,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in # lwork = BlasInt(-1) # info = Ref{BlasInt}() # for i in 1:2 -# ccall((@blasfunc($sytri), lbt), Cvoid, +# ccall((@blasfunc($sytri), libblastrampoline), Cvoid, # (Ptr{UInt8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info, 1) @@ -4719,7 +4716,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), lbt), Cvoid, + ccall((@blasfunc($sytri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4745,7 +4742,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), lbt), Cvoid, + ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4781,7 +4778,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sysv), lbt), Cvoid, + ccall((@blasfunc($sysv), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), @@ -4816,7 +4813,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($sytrf), lbt), Cvoid, + ccall((@blasfunc($sytrf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, lwork, info, 1) @@ -4843,7 +4840,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in chkuplo(uplo) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($sytri), lbt), Cvoid, + ccall((@blasfunc($sytri), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Clong), uplo, n, A, max(1,stride(A,2)), ipiv, work, info, 1) @@ -4869,7 +4866,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in throw(DimensionMismatch("B has first dimension $(size(B,1)), but needs $n")) end info = Ref{BlasInt}() - ccall((@blasfunc($sytrs), lbt), Cvoid, + ccall((@blasfunc($sytrs), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), uplo, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1) @@ -4911,7 +4908,7 @@ for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in # allocate info = Ref{BlasInt}() - ccall((@blasfunc($syconvf), lbt), Cvoid, + ccall((@blasfunc($syconvf), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong, Clong), @@ -5044,7 +5041,7 @@ for (syev, syevr, sygvd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($syev), lbt), Cvoid, + ccall((@blasfunc($syev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong, Clong), jobz, uplo, n, A, max(1,stride(A,2)), W, work, lwork, info, 1, 1) @@ -5095,7 +5092,7 @@ for (syev, syevr, sygvd, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($syevr), lbt), Cvoid, + ccall((@blasfunc($syevr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{BlasInt}, @@ -5146,7 +5143,7 @@ for (syev, syevr, sygvd, elty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($sygvd), lbt), Cvoid, + ccall((@blasfunc($sygvd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, @@ -5190,7 +5187,7 @@ for (syev, syevr, sygvd, elty, relty) in rwork = Vector{$relty}(undef, max(1, 3n-2)) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($syev), lbt), Cvoid, + ccall((@blasfunc($syev), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong), @@ -5247,7 +5244,7 @@ for (syev, syevr, sygvd, elty, relty) in liwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1], lrwork as rwork[1] and liwork as iwork[1] - ccall((@blasfunc($syevr), lbt), Cvoid, + ccall((@blasfunc($syevr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{BlasInt}, @@ -5304,7 +5301,7 @@ for (syev, syevr, sygvd, elty, relty) in lrwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1], lrwork as rwork[1] and liwork as iwork[1] - ccall((@blasfunc($sygvd), lbt), Cvoid, + ccall((@blasfunc($sygvd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, @@ -5405,7 +5402,7 @@ for (bdsqr, relty, elty) in # Allocate work = Vector{$relty}(undef, 4n) info = Ref{BlasInt}() - ccall((@blasfunc($bdsqr), lbt), Cvoid, + ccall((@blasfunc($bdsqr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5476,7 +5473,7 @@ for (bdsdc, elty) in work = Vector{$elty}(undef, lwork) iwork = Vector{BlasInt}(undef, 8n) info = Ref{BlasInt}() - ccall((@blasfunc($bdsdc), lbt), Cvoid, + ccall((@blasfunc($bdsdc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -5528,7 +5525,7 @@ for (gecon, elty) in work = Vector{$elty}(undef, 4n) iwork = Vector{BlasInt}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($gecon), lbt), Cvoid, + ccall((@blasfunc($gecon), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Clong), @@ -5562,7 +5559,7 @@ for (gecon, elty, relty) in work = Vector{$elty}(undef, 2n) rwork = Vector{$relty}(undef, 2n) info = Ref{BlasInt}() - ccall((@blasfunc($gecon), lbt), Cvoid, + ccall((@blasfunc($gecon), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ref{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}, Clong), @@ -5605,7 +5602,7 @@ for (gehrd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gehrd), lbt), Cvoid, + ccall((@blasfunc($gehrd), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -5656,7 +5653,7 @@ for (orghr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orghr), lbt), Cvoid, + ccall((@blasfunc($orghr), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}), @@ -5713,7 +5710,7 @@ for (ormhr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormhr), lbt), Cvoid, + ccall((@blasfunc($ormhr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5759,7 +5756,7 @@ for (hetrd, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($hetrd), lbt), Cvoid, + ccall((@blasfunc($hetrd), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -5809,7 +5806,7 @@ for (orgtr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($orgtr), lbt), Cvoid, + ccall((@blasfunc($orgtr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Clong), @@ -5867,7 +5864,7 @@ for (ormtr, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($ormtr), lbt), Cvoid, + ccall((@blasfunc($ormtr), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5912,7 +5909,7 @@ for (gees, gges, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gees), lbt), Cvoid, + ccall((@blasfunc($gees), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, @@ -5957,7 +5954,7 @@ for (gees, gges, elty) in lwork = BlasInt(-1) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gges), lbt), Cvoid, + ccall((@blasfunc($gges), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -6007,7 +6004,7 @@ for (gees, gges, elty, relty) in rwork = Vector{$relty}(undef, n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gees), lbt), Cvoid, + ccall((@blasfunc($gees), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -6053,7 +6050,7 @@ for (gees, gges, elty, relty) in rwork = Vector{$relty}(undef, 8n) info = Ref{BlasInt}() for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($gges), lbt), Cvoid, + ccall((@blasfunc($gges), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ptr{Cvoid}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -6118,7 +6115,7 @@ for (trexc, trsen, tgsen, elty) in ldq = max(1, stride(Q, 2)) work = Vector{$elty}(undef, n) info = Ref{BlasInt}() - ccall((@blasfunc($trexc), lbt), Cvoid, + ccall((@blasfunc($trexc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, @@ -6160,7 +6157,7 @@ for (trexc, trsen, tgsen, elty) in s = Ref{$elty}(zero($elty)) sep = Ref{$elty}(zero($elty)) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($trsen), lbt), Cvoid, + ccall((@blasfunc($trsen), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ref{$elty}, @@ -6225,7 +6222,7 @@ for (trexc, trsen, tgsen, elty) in info = Ref{BlasInt}() select = convert(Array{BlasInt}, select) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($tgsen), lbt), Cvoid, + ccall((@blasfunc($tgsen), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, @@ -6269,7 +6266,7 @@ for (trexc, trsen, tgsen, elty, relty) in ldt = max(1, stride(T, 2)) ldq = max(1, stride(Q, 2)) info = Ref{BlasInt}() - ccall((@blasfunc($trexc), lbt), Cvoid, + ccall((@blasfunc($trexc), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, @@ -6307,7 +6304,7 @@ for (trexc, trsen, tgsen, elty, relty) in s = Ref{$relty}(zero($relty)) sep = Ref{$relty}(zero($relty)) for i = 1:2 # first call returns lwork as work[1] - ccall((@blasfunc($trsen), lbt), Cvoid, + ccall((@blasfunc($trsen), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$relty}, Ref{$relty}, @@ -6369,7 +6366,7 @@ for (trexc, trsen, tgsen, elty, relty) in info = Ref{BlasInt}() select = convert(Array{BlasInt}, select) for i = 1:2 # first call returns lwork as work[1] and liwork as iwork[1] - ccall((@blasfunc($tgsen), lbt), Cvoid, + ccall((@blasfunc($tgsen), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -6455,7 +6452,7 @@ for (fn, elty, relty) in ((:dtrsyl_, :Float64, :Float64), ldc = max(1, stride(C, 2)) scale = Ref{$relty}() info = Ref{BlasInt}() - ccall((@blasfunc($fn), lbt), Cvoid, + ccall((@blasfunc($fn), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$relty}, Ptr{BlasInt}, Clong, Clong), From 04660ea15aa37eba86999a6de57af7c1d1368315 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sat, 26 Feb 2022 16:28:10 -0500 Subject: [PATCH 4/6] Remove test for LinearAlgebra.LAPACK.liblapack --- stdlib/LinearAlgebra/test/lapack.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/stdlib/LinearAlgebra/test/lapack.jl b/stdlib/LinearAlgebra/test/lapack.jl index 284b512d93a18..dfcf3c89dac2a 100644 --- a/stdlib/LinearAlgebra/test/lapack.jl +++ b/stdlib/LinearAlgebra/test/lapack.jl @@ -702,9 +702,6 @@ let A = [NaN NaN; NaN NaN] @test_throws ArgumentError eigen(A) end -# # https://github.com/JuliaLang/julia/pull/39845 -@test LinearAlgebra.LAPACK.liblapack == "libblastrampoline" - # Issue #42762 https://github.com/JuliaLang/julia/issues/42762 # Tests geqrf! and gerqf! with null column dimensions a = zeros(2,0), zeros(0) From f85b6e524a6d1fcc95d186005319c8b0d35a20cf Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sat, 26 Feb 2022 23:28:20 -0500 Subject: [PATCH 5/6] Fix --- NEWS.md | 6 ++++++ base/Makefile | 2 -- stdlib/LinearAlgebra/test/blas.jl | 4 ---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NEWS.md b/NEWS.md index 32c89cfe09861..1ce80e71dd90c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -42,6 +42,12 @@ Standard library changes #### LinearAlgebra +* We are now wholly reliant on libblastrampoline (LBT) for calling + BLAS and LAPACK. OpenBLAS is shipped by default, but building the + system image with other BLAS/LAPACK libraries is not + supported. Instead, it is recommended that the LBT mechanism be used + for swapping BLAS/LAPACK with vendor provided ones. ([#44360]) + #### Markdown #### Printf diff --git a/base/Makefile b/base/Makefile index 1924499f43951..61f9647ebf24a 100644 --- a/base/Makefile +++ b/base/Makefile @@ -47,8 +47,6 @@ else @echo "const MACHINE = \"$(XC_HOST)\"" >> $@ endif @echo "const libm_name = \"$(LIBMNAME)\"" >> $@ - @echo "const libblas_name = \"libblastrampoline\"" >> $@ - @echo "const liblapack_name = \"libblastrampoline\"" >> $@ ifeq ($(USE_BLAS64), 1) @echo "const USE_BLAS64 = true" >> $@ else diff --git a/stdlib/LinearAlgebra/test/blas.jl b/stdlib/LinearAlgebra/test/blas.jl index d39f7c45ba205..117d7dc103605 100644 --- a/stdlib/LinearAlgebra/test/blas.jl +++ b/stdlib/LinearAlgebra/test/blas.jl @@ -668,10 +668,6 @@ end @test BLAS.get_num_threads() === default end -# https://github.com/JuliaLang/julia/pull/39845 -@test LinearAlgebra.BLAS.libblas == "libblastrampoline" -@test LinearAlgebra.BLAS.liblapack == "libblastrampoline" - @testset "test for 0-strides" for elty in (Float32, Float64, ComplexF32, ComplexF64) A = randn(elty, 10, 10); a = view([randn(elty)], 1 .+ 0(1:10)) From c11710d7f98cf87af40a753eca439b62619c1c63 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sun, 27 Feb 2022 22:10:00 -0500 Subject: [PATCH 6/6] Fix the precompile tests --- test/precompile.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/precompile.jl b/test/precompile.jl index d39dcd9f7ccb8..e5e1c35ec34af 100644 --- a/test/precompile.jl +++ b/test/precompile.jl @@ -359,10 +359,10 @@ precompile_test_harness(false) do dir Dict(let m = Base.root_module(Base, s) Base.PkgId(m) => Base.module_build_id(m) end for s in - [:ArgTools, :Artifacts, :Base64, :CRC32c, :Dates, :DelimitedFiles, - :Distributed, :Downloads, :FileWatching, :Future, :InteractiveUtils, + [:ArgTools, :Artifacts, :Base64, :CompilerSupportLibraries_jll, :CRC32c, :Dates, :DelimitedFiles, + :Distributed, :Downloads, :FileWatching, :Future, :InteractiveUtils, :libblastrampoline_jll, :LazyArtifacts, :LibCURL, :LibCURL_jll, :LibGit2, :Libdl, :LinearAlgebra, - :Logging, :Markdown, :Mmap, :MozillaCACerts_jll, :NetworkOptions, :Pkg, :Printf, + :Logging, :Markdown, :Mmap, :MozillaCACerts_jll, :NetworkOptions, :OpenBLAS_jll, :Pkg, :Printf, :Profile, :p7zip_jll, :REPL, :Random, :SHA, :Serialization, :SharedArrays, :Sockets, :SparseArrays, :Statistics, :SuiteSparse, :TOML, :Tar, :Test, :UUIDs, :Unicode, :nghttp2_jll]