diff --git a/LICENSE.md b/LICENSE.md index 24c6b7e4cb998..1070bdb9ebadd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -74,6 +74,7 @@ Julia builds the following libraries by default, but does not use them itself: Julia's build process uses the following external tools: - [PATCHELF](http://hydra.nixos.org/build/1524660/download/1/README) +- [OBJCONV](http://www.agner.org/optimize/#objconv) Julia bundles the following external programs and libraries on some platforms: diff --git a/Makefile b/Makefile index de4d4442e408b..450cc5fc794a6 100644 --- a/Makefile +++ b/Makefile @@ -380,7 +380,7 @@ source-dist: git-submodules # Create file source-dist.tmp to hold all the filenames that go into the tarball echo "base/version_git.jl" > source-dist.tmp git ls-files >> source-dist.tmp - ls deps/*.tar.gz deps/*.tar.bz2 deps/*.tgz >> source-dist.tmp + ls deps/*.tar.gz deps/*.tar.bz2 deps/*.tar.xz deps/*.tgz deps/*.zip >> source-dist.tmp git submodule --quiet foreach 'git ls-files | sed "s&^&$$path/&"' >> source-dist.tmp # Remove unwanted files diff --git a/base/interactiveutil.jl b/base/interactiveutil.jl index 26ff8bf6d7be8..40e2058088d4b 100644 --- a/base/interactiveutil.jl +++ b/base/interactiveutil.jl @@ -173,7 +173,7 @@ function versioninfo(io::IO=STDOUT, verbose::Bool=false) Sys.cpu_summary(io) println(io ) end - if Base.libblas_name == "libopenblas" || blas_vendor() == :openblas + if Base.libblas_name == "libopenblas" || blas_vendor() == :openblas || blas_vendor() == :openblas64 openblas_config = openblas_get_config() println(io, " BLAS: libopenblas (", openblas_config, ")") else diff --git a/base/linalg/blas.jl b/base/linalg/blas.jl index d81a98888d02a..5e754e6c3f50e 100644 --- a/base/linalg/blas.jl +++ b/base/linalg/blas.jl @@ -1,7 +1,7 @@ module BLAS import ..axpy! -import Base.copy! +import Base: copy!, blasfunc export # Level 1 @@ -57,14 +57,14 @@ import ..LinAlg: BlasReal, BlasComplex, BlasFloat, BlasChar, BlasInt, blas_int, # Level 1 ## copy -for (fname, elty) in ((:dcopy_,:Float64), +for (fname, elty) in ((:dcopy_,:Float64), (:scopy_,:Float32), - (:zcopy_,:Complex128), + (:zcopy_,:Complex128), (:ccopy_,:Complex64)) @eval begin # SUBROUTINE DCOPY(N,DX,INCX,DY,INCY) function blascopy!(n::Integer, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer, DY::Union(Ptr{$elty},StridedArray{$elty}), incy::Integer) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, DX, &incx, DY, &incy) DY @@ -73,14 +73,14 @@ for (fname, elty) in ((:dcopy_,:Float64), end ## scal -for (fname, elty) in ((:dscal_,:Float64), +for (fname, elty) in ((:dscal_,:Float64), (:sscal_,:Float32), - (:zscal_,:Complex128), + (:zscal_,:Complex128), (:cscal_,:Complex64)) @eval begin # SUBROUTINE DSCAL(N,DA,DX,INCX) function scal!(n::Integer, DA::$elty, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), &n, &DA, DX, &incx) DX @@ -93,7 +93,7 @@ for (fname, elty, celty) in ((:sscal_, :Float32, :Complex64), (:dscal_, :Float64, :Complex128)) @eval begin function scal!(n::Integer, DA::$elty, DX::Union(Ptr{$celty},StridedArray{$celty}), incx::Integer) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$celty}, Ptr{BlasInt}), &(2*n), &DA, DX, &incx) DX @@ -102,7 +102,7 @@ for (fname, elty, celty) in ((:sscal_, :Float32, :Complex64), end ## dot -for (fname, elty) in ((:ddot_,:Float64), +for (fname, elty) in ((:ddot_,:Float64), (:sdot_,:Float32)) @eval begin # DOUBLE PRECISION FUNCTION DDOT(N,DX,INCX,DY,INCY) @@ -112,7 +112,7 @@ for (fname, elty) in ((:ddot_,:Float64), # * .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function dot(n::Integer, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer, DY::Union(Ptr{$elty},StridedArray{$elty}), incy::Integer) - ccall(($(string(fname)),libblas), $elty, + ccall(($(blasfunc(fname)), libblas), $elty, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, DX, &incx, DY, &incy) end @@ -129,7 +129,7 @@ for (fname, elty) in ((:cblas_zdotc_sub,:Complex128), # DOUBLE PRECISION DX(*),DY(*) function dotc(n::Integer, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer, DY::Union(Ptr{$elty},StridedArray{$elty}), incy::Integer) result = Array($elty, 1) - ccall(($(string(fname)),libblas), $elty, + ccall(($(blasfunc(fname)), libblas), $elty, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[1] @@ -147,7 +147,7 @@ for (fname, elty) in ((:cblas_zdotu_sub,:Complex128), # DOUBLE PRECISION DX(*),DY(*) function dotu(n::Integer, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer, DY::Union(Ptr{$elty},StridedArray{$elty}), incy::Integer) result = Array($elty, 1) - ccall(($(string(fname)),libblas), $elty, + ccall(($(blasfunc(fname)), libblas), $elty, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[1] @@ -178,7 +178,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},StridedVector{$elty}), incx::Integer) - ccall(($(string(fname)),libblas), $ret_type, + ccall(($(blasfunc(fname)), libblas), $ret_type, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, X, &incx) end @@ -195,7 +195,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},StridedVector{$elty}), incx::Integer) - ccall(($(string(fname)),libblas), $ret_type, + ccall(($(blasfunc(fname)), libblas), $ret_type, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, X, &incx) end @@ -218,7 +218,7 @@ for (fname, elty) in ((:daxpy_,:Float64), #* .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function axpy!(n::Integer, alpha::($elty), dx::Union(Ptr{$elty}, StridedArray{$elty}), incx::Integer, dy::Union(Ptr{$elty}, StridedArray{$elty}), incy::Integer) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, &alpha, dx, &incx, dy, &incy) dy @@ -249,7 +249,7 @@ for (fname, elty) in ((:idamax_,:Float64), (:icamax_,:Complex64)) @eval begin function iamax(n::BlasInt, dx::Union(StridedVector{$elty}, Ptr{$elty}), incx::BlasInt) - ccall(($(string(fname)), libblas),BlasInt, + ccall(($(blasfunc(fname)), libblas),BlasInt, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, dx, &incx) end @@ -275,7 +275,7 @@ for (fname, elty) in ((:dgemv_,:Float64), function gemv!(trans::BlasChar, alpha::($elty), A::StridedVecOrMat{$elty}, X::StridedVector{$elty}, beta::($elty), Y::StridedVector{$elty}) m,n = size(A,1),size(A,2) length(X) == (trans == 'N' ? n : m) && length(Y) == (trans == 'N' ? m : n) || throw(DimensionMismatch("")) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -294,9 +294,9 @@ for (fname, elty) in ((:dgemv_,:Float64), end ### (GB) general banded matrix-vector multiplication -for (fname, elty) in ((:dgbmv_,:Float64), +for (fname, elty) in ((:dgbmv_,:Float64), (:sgbmv_,:Float32), - (:zgbmv_,:Complex128), + (:zgbmv_,:Complex128), (:cgbmv_,:Complex64)) @eval begin # SUBROUTINE DGBMV(TRANS,M,N,KL,KU,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) @@ -307,7 +307,7 @@ for (fname, elty) in ((:dgbmv_,:Float64), # * .. Array Arguments .. # DOUBLE PRECISION A(LDA,*),X(*),Y(*) function gbmv!(trans::BlasChar, m::Integer, kl::Integer, ku::Integer, alpha::($elty), A::StridedMatrix{$elty}, x::StridedVector{$elty}, beta::($elty), y::StridedVector{$elty}) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -346,7 +346,7 @@ for (fname, elty) in ((:dsymv_,:Float64), m, n = size(A) if m != n throw(DimensionMismatch("Matrix A is $m by $n but must be square")) end if m != length(x) || m != length(y) throw(DimensionMismatch("")) end - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -375,7 +375,7 @@ for (fname, elty) in ((:zhemv_,:Complex128), lda = max(1, stride(A, 2)) incx = stride(x, 1) incy = stride(y, 1) - ccall(($fname, libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -394,9 +394,9 @@ for (fname, elty) in ((:zhemv_,:Complex128), end ### sbmv, (SB) symmetric banded matrix-vector multiplication -for (fname, elty) in ((:dsbmv_,:Float64), +for (fname, elty) in ((:dsbmv_,:Float64), (:ssbmv_,:Float32), - (:zsbmv_,:Complex128), + (:zsbmv_,:Complex128), (:csbmv_,:Complex64)) @eval begin # SUBROUTINE DSBMV(UPLO,N,K,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) @@ -407,7 +407,7 @@ for (fname, elty) in ((:dsbmv_,:Float64), # * .. Array Arguments .. # DOUBLE PRECISION A(LDA,*),X(*),Y(*) function sbmv!(uplo::BlasChar, k::Integer, alpha::($elty), A::StridedMatrix{$elty}, x::StridedVector{$elty}, beta::($elty), y::StridedVector{$elty}) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -443,7 +443,7 @@ for (fname, elty) in ((:dtrmv_,:Float64), if n != length(x) throw(DimensionMismatch("length(x)=$(length(x))does not match size(A)=$(size(A))")) end - ccall(($(string(fname)), libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &trans, &diag, &n, @@ -470,7 +470,7 @@ for (fname, elty) in ((:dtrsv_,:Float64), function trsv!(uplo::Char, trans::Char, diag::Char, A::StridedMatrix{$elty}, x::StridedVector{$elty}) n = chksquare(A) n==length(x) || throw(DimensionMismatch("size of A is $n != length(x) = $(length(x))")) - ccall(($(string(fname)), libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &trans, &diag, &n, @@ -493,7 +493,7 @@ for (fname, elty) in ((:dger_,:Float64), m, n = size(A) m == length(x) || throw(DimensionMismatch("")) n == length(y) || throw(DimensionMismatch("")) - ccall(($(string(fname)), libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), @@ -514,7 +514,7 @@ for (fname, elty) in ((:dsyr_,:Float64), function syr!(uplo::Char, α::$elty, x::StridedVector{$elty}, A::StridedMatrix{$elty}) n = chksquare(A) length(x) == n || throw(DimensionMismatch("Length of vector must be the same as the matrix dimensions")) - ccall(($(string(fname)), libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, &α, x, @@ -531,7 +531,7 @@ for (fname, elty) in ((:zher_,:Complex128), function her!(uplo::Char, α::$elty, x::StridedVector{$elty}, A::StridedMatrix{$elty}) n = chksquare(A) length(x) == A || throw(DimensionMismatch("Length of vector must be the same as the matrix dimensions")) - ccall(($(string(fname)), libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, &α, x, @@ -566,7 +566,7 @@ for (gemm, elty) in if m != size(C,1) || n != size(C,2) throw(DimensionMismatch("")) end - ccall(($(string(gemm)),libblas), Void, + ccall(($(blasfunc(gemm)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -603,7 +603,7 @@ for (mfname, elty) in ((:dsymm_,:Float64), m, n = size(C) j = chksquare(A) if j != (side == 'L' ? m : n) || size(B,2) != n throw(DimensionMismatch("")) end - ccall(($(string(mfname)),libblas), Void, + ccall(($(blasfunc(mfname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -641,7 +641,7 @@ for (fname, elty) in ((:dsyrk_,:Float64), nn = size(A, trans == 'N' ? 1 : 2) if nn != n throw(DimensionMismatch("syrk!")) end k = size(A, trans == 'N' ? 2 : 1) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -674,7 +674,7 @@ for (fname, elty) in ((:zherk_,:Complex128), (:cherk_,:Complex64)) n = chksquare(C) n == size(A, trans == 'N' ? 1 : 2) || throw(DimensionMismatch("herk!")) k = size(A, trans == 'N' ? 2 : 1) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -713,7 +713,7 @@ for (fname, elty) in ((:dsyr2k_,:Float64), nn = size(A, trans == 'N' ? 1 : 2) if nn != n throw(DimensionMismatch("syr2k!")) end k = size(A, trans == 'N' ? 2 : 1) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -749,7 +749,7 @@ for (fname, elty1, elty2) in ((:zher2k_,:Complex128,:Float64), (:cher2k_,:Comple n = chksquare(C) n == size(A, trans == 'N' ? 1 : 2) || throw(DimensionMismatch("her2k!")) k = size(A, trans == 'N' ? 2 : 1) - ccall(($(string(fname)),libblas), Void, + ccall(($(blasfunc(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty1}, Ptr{$elty1}, Ptr{BlasInt}, Ptr{$elty1}, Ptr{BlasInt}, Ptr{$elty2}, Ptr{$elty1}, Ptr{BlasInt}), @@ -785,7 +785,7 @@ for (mmname, smname, elty) in m, n = size(B) nA = chksquare(A) if nA != (side == 'L' ? m : n) throw(DimensionMismatch("trmm!")) end - ccall(($(string(mmname)), libblas), Void, + ccall(($(blasfunc(mmname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &side, &uplo, &transa, &diag, &m, &n, @@ -808,7 +808,7 @@ for (mmname, smname, elty) in m, n = size(B) k = chksquare(A) k==(side == 'L' ? m : n) || throw(DimensionMismatch("size of A is $n, size(B)=($m,$n) and transa='$transa'")) - ccall(($(string(smname)), libblas), Void, + ccall(($(blasfunc(smname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), diff --git a/base/linalg/lapack.jl b/base/linalg/lapack.jl index 79bee8db9c7bb..9e8ac8834e2a3 100644 --- a/base/linalg/lapack.jl +++ b/base/linalg/lapack.jl @@ -3,6 +3,8 @@ module LAPACK const liblapack = Base.liblapack_name +import Base.blasfunc + import ..LinAlg: BlasFloat, BlasChar, BlasInt, blas_int, LAPACKException, DimensionMismatch, SingularException, PosDefException, chkstride1, chksquare @@ -47,7 +49,7 @@ for (gbtrf, gbtrs, elty) in n = size(AB, 2) mnmn = min(m, n) ipiv = similar(AB, BlasInt, mnmn) - ccall(($(string(gbtrf)),liblapack), Void, + ccall(($(blasfunc(gbtrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, &kl, &ku, AB, &max(1,stride(AB,2)), ipiv, info) @@ -68,7 +70,7 @@ for (gbtrf, gbtrs, elty) in info = Array(BlasInt, 1) n = size(AB,2) if m != n || m != size(B,1) throw(DimensionMismatch("gbtrs!")) end - ccall(($(string(gbtrs)),liblapack), Void, + ccall(($(blasfunc(gbtrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -100,7 +102,7 @@ for (gebal, gebak, elty, relty) in ihi = Array(BlasInt, 1) ilo = Array(BlasInt, 1) scale = similar(A, $relty, n) - ccall(($(string(gebal)),liblapack), Void, + ccall(($(blasfunc(gebal)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), &job, &n, A, &max(1,stride(A,2)), ilo, ihi, scale, info) @@ -119,7 +121,7 @@ for (gebal, gebak, elty, relty) in chkstride1(V) chksquare(V) info = Array(BlasInt, 1) - ccall(($(string(gebak)),liblapack), Void, + ccall(($(blasfunc(gebak)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &job, &side, &size(V,1), &ilo, &ihi, scale, &n, V, &max(1,stride(V,2)), info) @@ -170,7 +172,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(gebrd)),liblapack), Void, + ccall(($(blasfunc(gebrd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -198,7 +200,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) work = Array($elty, (1,)) for i in 1:2 # first call returns lwork as work[1] - ccall(($(string(gelqf)),liblapack), Void, + ccall(($(blasfunc(gelqf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &lda, tau, work, &lwork, info) @@ -225,7 +227,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) work = Array($elty, (1,)) for i in 1:2 # first call returns lwork as work[1] - ccall(($(string(geqlf)),liblapack), Void, + ccall(($(blasfunc(geqlf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &lda, tau, work, &lwork, info) @@ -256,7 +258,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty if cmplx; rwork = Array($relty, 2n); end for i in 1:2 if cmplx - ccall(($(string(geqp3)),liblapack), Void, + ccall(($(blasfunc(geqp3)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), @@ -264,7 +266,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty jpvt, tau, work, &lwork, rwork, info) else - ccall(($(string(geqp3)),liblapack), Void, + ccall(($(blasfunc(geqp3)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -290,7 +292,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Array($elty, nb*n) if n > 0 info = Array(BlasInt, 1) - ccall(($(string(geqrt)), liblapack), Void, + ccall(($(blasfunc(geqrt)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), @@ -308,7 +310,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty if p < n || q < n throw(DimensionMismatch("block reflector")) end if n > 0 info = Array(BlasInt, 1) - ccall(($(string(geqrt3)), liblapack), Void, + ccall(($(blasfunc(geqrt3)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &max(1, stride(A, 2)), @@ -331,7 +333,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 # first call returns lwork as work[1] - ccall(($(string(geqrf)),liblapack), Void, + ccall(($(blasfunc(geqrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &max(1,stride(A,2)), tau, work, &lwork, info) @@ -356,7 +358,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) work = Array($elty, 1) for i in 1:2 # first call returns lwork as work[1] - ccall(($(string(gerqf)),liblapack), Void, + ccall(($(blasfunc(gerqf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &max(1,stride(A,2)), tau, work, &lwork, info) @@ -380,7 +382,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty m, n = size(A) lda = max(1,stride(A, 2)) ipiv = similar(A, BlasInt, min(m,n)) - ccall(($(string(getrf)),liblapack), Void, + ccall(($(blasfunc(getrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &lda, ipiv, info) @@ -429,7 +431,7 @@ for (tzrzf, ormrz, elty) in lwork = -1 info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(tzrzf)), liblapack), Void, + ccall(($(blasfunc(tzrzf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &lda, @@ -461,7 +463,7 @@ for (tzrzf, ormrz, elty) in lwork = -1 info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(ormrz)), liblapack), Void, + ccall(($(blasfunc(ormrz)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -502,7 +504,7 @@ for (gels, gesv, getrs, getri, elty) in work = Array($elty, 1) lwork = blas_int(-1) for i in 1:2 - ccall(($(string(gels)),liblapack), Void, + ccall(($(blasfunc(gels)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -538,7 +540,7 @@ for (gels, gesv, getrs, getri, elty) in if size(B,1) != n throw(DimensionMismatch("gesv!")) end ipiv = similar(A, BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(gesv)),liblapack), Void, + ccall(($(blasfunc(gesv)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -558,7 +560,7 @@ for (gels, gesv, getrs, getri, elty) in n==size(B, 1) || throw(DimensionMismatch("left and right hand sides do not fit")) nrhs = size(B, 2) info = Array(BlasInt, 1) - ccall(($(string(getrs)),liblapack), Void, + ccall(($(blasfunc(getrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &trans, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -580,7 +582,7 @@ for (gels, gesv, getrs, getri, elty) in lwork = -1 work = Array($elty, 1) for i in 1:2 - ccall(($(string(getri)),liblapack), Void, + ccall(($(blasfunc(getri)), liblapack), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, A, &lda, ipiv, work, &lwork, info) @@ -626,7 +628,7 @@ for (gesvx, elty) in iwork = Array($elty, n) info = Array(BlasInt, 1) X = similar(A, $elty, n, nrhs) - ccall(($(string(gesvx)),liblapack), Void, + ccall(($(blasfunc(gesvx)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasChar}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, @@ -681,7 +683,7 @@ for (gesvx, elty, relty) in rwork = Array($relty, 2n) info = Array(BlasInt, 1) x = similar(A, $elty, n, nrhs) - ccall(($(string(gesvx)),liblapack), Void, + ccall(($(blasfunc(gesvx)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasChar}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, @@ -730,7 +732,7 @@ for (gelsd, gelsy, elty) in lwork = blas_int(-1) iwork = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(gelsd)),liblapack), Void, + ccall(($(blasfunc(gelsd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -772,7 +774,7 @@ for (gelsd, gelsy, elty) in lwork = -1 info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gelsy)), liblapack), Void, + ccall(($(blasfunc(gelsy)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -819,7 +821,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Array($relty, 1) iwork = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(gelsd)),liblapack), Void, + ccall(($(blasfunc(gelsd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -863,7 +865,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Array($relty, 2n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gelsy)), liblapack), Void, + ccall(($(blasfunc(gelsy)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -909,7 +911,7 @@ for (gglse, elty) in ((:dgglse_, :Float64), work = Array($elty, 1) lwork = blas_int(-1) for i in 1:2 - ccall(($(string(gglse)),liblapack), Void, + ccall(($(blasfunc(gglse)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, @@ -962,7 +964,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Array(BlasInt, 1) for i = 1:2 if cmplx - ccall(($(string(geev)),liblapack), Void, + ccall(($(blasfunc(geev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -970,7 +972,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) else - ccall(($(string(geev)),liblapack), Void, + ccall(($(blasfunc(geev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1025,7 +1027,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Array(BlasInt, 1) for i = 1:2 if cmplx - ccall(($(string(gesdd)),liblapack), Void, + ccall(($(blasfunc(gesdd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1033,7 +1035,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) else - ccall(($(string(gesdd)),liblapack), Void, + ccall(($(blasfunc(gesdd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1070,7 +1072,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Array(BlasInt, 1) for i in 1:2 if cmplx - ccall(($(string(gesvd)),liblapack), Void, + ccall(($(blasfunc(gesvd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1078,7 +1080,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) else - ccall(($(string(gesvd)),liblapack), Void, + ccall(($(blasfunc(gesvd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1129,7 +1131,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in iwork = Array(BlasInt, n) info = Array(BlasInt, 1) if cmplx - ccall(($(string(ggsvd)),liblapack), Void, + ccall(($(blasfunc(ggsvd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1143,7 +1145,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in V, &ldv, Q, &ldq, work, rwork, iwork, info) else - ccall(($(string(ggsvd)),liblapack), Void, + ccall(($(blasfunc(ggsvd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1206,7 +1208,7 @@ for (geevx, ggev, elty) in iwork = Array(BlasInt, sense == 'N' || sense == 'E' ? 0 : (sense == 'V' || sense == 'B' ? 2n-2 : throw(ArgumentError("argument sense must be 'N', 'E', 'V' or 'B'")))) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(geevx)),Base.liblapack_name), Void, + ccall(($(blasfunc(geevx)), liblapack), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1253,7 +1255,7 @@ for (geevx, ggev, elty) in lwork = -one(BlasInt) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(ggev)), liblapack), Void, + ccall(($(blasfunc(ggev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, @@ -1311,7 +1313,7 @@ for (geevx, ggev, elty, relty) in rwork = Array($relty, 2n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(geevx)),Base.liblapack_name), Void, + ccall(($(blasfunc(geevx)), liblapack), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1358,7 +1360,7 @@ for (geevx, ggev, elty, relty) in rwork = Array($relty, 8n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(ggev)), liblapack), Void, + ccall(($(blasfunc(ggev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1399,7 +1401,7 @@ for (laic1, elty) in sestpr = Array($elty, 1) s = Array($elty, 1) c = Array($elty, 1) - ccall(($(string(laic1)), liblapack), Void, + ccall(($(blasfunc(laic1)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}), @@ -1429,7 +1431,7 @@ for (laic1, elty, relty) in sestpr = Array($relty, 1) s = Array($elty, 1) c = Array($elty, 1) - ccall(($(string(laic1)), liblapack), Void, + ccall(($(blasfunc(laic1)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}), @@ -1447,7 +1449,7 @@ for (gtsv, gttrf, gttrs, elty) in ((:dgtsv_,:dgttrf_,:dgttrs_,:Float64), (:sgtsv_,:sgttrf_,:sgttrs_,:Float32), (:zgtsv_,:zgttrf_,:zgttrs_,:Complex128), - (:cgtsv_,:cgttrf_,:cgttrs_,:Complex64)) + (:cgtsv_,:cgttrf_,:cgttrs_,:Complex64)) @eval begin # SUBROUTINE DGTSV( N, NRHS, DL, D, DU, B, LDB, INFO ) # .. Scalar Arguments .. @@ -1462,7 +1464,7 @@ for (gtsv, gttrf, gttrs, elty) in n == size(B,1) || throw(DimensionMismatch("right hand side has wrong number of rows")) n == 0 && return B # Early exit if possible info = Array(BlasInt, 1) - ccall(($(string(gtsv)),liblapack), Void, + ccall(($(blasfunc(gtsv)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, &size(B,2), dl, d, du, B, &max(1,stride(B,2)), info) @@ -1483,7 +1485,7 @@ for (gtsv, gttrf, gttrs, elty) in du2 = similar(d, $elty, n-2) ipiv = similar(d, BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(gttrf)),liblapack), Void, + ccall(($(blasfunc(gttrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, dl, d, du, du2, ipiv, info) @@ -1505,7 +1507,7 @@ for (gtsv, gttrf, gttrs, elty) in if length(dl) != n - 1 || length(du) != n - 1 throw(DimensionMismatch("gttrs!")) end if n != size(B,1) throw(DimensionMismatch("gttrs!")) end info = Array(BlasInt, 1) - ccall(($(string(gttrs)),liblapack), Void, + ccall(($(blasfunc(gttrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -1537,7 +1539,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(orglq)),liblapack), Void, + ccall(($(blasfunc(orglq)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, &k, A, &max(1,stride(A,2)), tau, work, &lwork, info) @@ -1567,7 +1569,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(orgqr)),liblapack), Void, + ccall(($(blasfunc(orgqr)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, &k, A, @@ -1605,7 +1607,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(ormlq)),liblapack), Void, + ccall(($(blasfunc(ormlq)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -1639,7 +1641,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(ormqr)),liblapack), Void, + ccall(($(blasfunc(ormqr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1678,7 +1680,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in ldc = max(1, stride(C,2)) work = Array($elty, wss) info = Array(BlasInt, 1) - ccall(($(string(gemqrt)), liblapack), Void, + ccall(($(blasfunc(gemqrt)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1713,7 +1715,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in @chkuplo if size(B,1) != n throw(DimensionMismatch("posv!")) end info = Array(BlasInt, 1) - ccall(($(string(posv)),liblapack), Void, + ccall(($(blasfunc(posv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), B, &max(1,stride(B,2)), info) @@ -1734,7 +1736,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in lda = max(1,stride(A,2)) lda==0 && return A, 0 info = Array(BlasInt, 1) - ccall(($(string(potrf)),liblapack), Void, + ccall(($(blasfunc(potrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &size(A,1), A, &lda, info) @assertargsok @@ -1753,7 +1755,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in chkstride1(A) @chkuplo info = Array(BlasInt, 1) - ccall(($(string(potri)),liblapack), Void, + ccall(($(blasfunc(potri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &size(A,1), A, &max(1,stride(A,2)), info) @assertargsok @@ -1776,7 +1778,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in if lda == 0 || nrhs == 0 return B end ldb = max(1,stride(B,2)) info = Array(BlasInt, 1) - ccall(($(string(potrs)),liblapack), Void, + ccall(($(blasfunc(potrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &nrhs, A, @@ -1800,7 +1802,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in rank = Array(BlasInt, 1) work = Array($rtyp, 2n) info = Array(BlasInt, 1) - ccall(($(string(pstrf)),liblapack), Void, + ccall(($(blasfunc(pstrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$rtyp}, Ptr{$rtyp}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), piv, rank, &tol, work, info) @@ -1814,8 +1816,8 @@ end ## Direct solvers for general tridiagonal and symmetric positive-definite tridiagonal for (ptsv, pttrf, pttrs, elty, relty) in ((:dptsv_,:dpttrf_,:dpttrs_,:Float64,:Float64), - (:sptsv_,:spttrf_,:spttrs_,:Float32,:Float32), - (:zptsv_,:zpttrf_,:zpttrs_,:Complex128,:Float64), + (:sptsv_,:spttrf_,:spttrs_,:Float32,:Float32), + (:zptsv_,:zpttrf_,:zpttrs_,:Complex128,:Float64), (:cptsv_,:cpttrf_,:cpttrs_,:Complex64,:Float32)) @eval begin # SUBROUTINE DPTSV( N, NRHS, D, E, B, LDB, INFO ) @@ -1828,7 +1830,7 @@ for (ptsv, pttrf, pttrs, elty, relty) in n = length(D) if length(E) != n - 1 || n != size(B,1) throw(DimensionMismatch("ptsv!")) end info = Array(BlasInt, 1) - ccall(($(string(ptsv)),liblapack), Void, + ccall(($(blasfunc(ptsv)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, &size(B,2), D, E, B, &max(1,stride(B,2)), info) @@ -1844,7 +1846,7 @@ for (ptsv, pttrf, pttrs, elty, relty) in n = length(D) if length(E) != (n-1) throw(DimensionMismatch("pttrf!")) end info = Array(BlasInt, 1) - ccall(($(string(pttrf)),liblapack), Void, + ccall(($(blasfunc(pttrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}), &n, D, E, info) @lapackerror @@ -1866,7 +1868,7 @@ for (pttrs, elty, relty) in n = length(D) if length(E) != (n-1) || size(B,1) != n throw(DimensionMismatch("pttrs!")) end info = Array(BlasInt, 1) - ccall(($(string(pttrs)),liblapack), Void, + ccall(($(blasfunc(pttrs)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, &size(B,2), D, E, B, &max(1,stride(B,2)), info) @@ -1893,7 +1895,7 @@ for (pttrs, elty, relty) in n = length(D) if length(E) != (n-1) || size(B,1) != n throw(DimensionMismatch("pttrs!")) end info = Array(BlasInt, 1) - ccall(($(string(pttrs)),liblapack), Void, + ccall(($(blasfunc(pttrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), D, E, B, &max(1,stride(B,2)), info) @@ -1922,7 +1924,7 @@ for (trtri, trtrs, elty) in @chkuplo lda = max(1,stride(A, 2)) info = Array(BlasInt, 1) - ccall(($(string(trtri)),liblapack), Void, + ccall(($(blasfunc(trtri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &diag, &n, A, &lda, info) @@ -1942,7 +1944,7 @@ for (trtri, trtrs, elty) in @chkuplo size(B,1)==n || throw(DimensionMismatch("")) info = Array(BlasInt, 1) - ccall(($(string(trtrs)),liblapack), Void, + ccall(($(blasfunc(trtrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &trans, &diag, &n, &size(B,2), A, &max(1,stride(A,2)), @@ -1976,7 +1978,7 @@ for (trcon, trevc, trrfs, elty) in work = Array($elty, 3n) iwork = Array(BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(trcon)),liblapack), Void, + ccall(($(blasfunc(trcon)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &norm, &uplo, &diag, &n, @@ -2009,7 +2011,7 @@ for (trcon, trevc, trrfs, elty) in work = Array($elty, 3n) info = Array(BlasInt, 1) - ccall(($(string(trevc)),liblapack), Void, + ccall(($(blasfunc(trevc)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt},Ptr{BlasInt}, Ptr{BlasInt}, @@ -2058,7 +2060,7 @@ for (trcon, trevc, trrfs, elty) in work = Array($elty, 3n) iwork = Array(BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(trrfs)),liblapack), Void, + ccall(($(blasfunc(trrfs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -2092,7 +2094,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Array($elty, 2n) rwork = Array($relty, n) info = Array(BlasInt, 1) - ccall(($(string(trcon)),liblapack), Void, + ccall(($(blasfunc(trcon)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}), &norm, &uplo, &diag, &n, @@ -2128,7 +2130,7 @@ for (trcon, trevc, trrfs, elty, relty) in rwork = Array($relty, n) info = Array(BlasInt, 1) - ccall(($(string(trevc)),liblapack), Void, + ccall(($(blasfunc(trevc)), liblapack), Void, (Ptr{Char}, Ptr{Char}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -2177,7 +2179,7 @@ for (trcon, trevc, trrfs, elty, relty) in work=Array($elty, 2n) rwork=Array($relty, n) info=Array(BlasInt, 1) - ccall(($(string(trrfs)),liblapack), Void, + ccall(($(blasfunc(trrfs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}), @@ -2206,7 +2208,7 @@ for (stev, stebz, stegr, stein, elty) in Zmat = similar(dv, $elty, (n, job != 'N' ? n : 0)) work = Array($elty, max(1, 2n-2)) info = Array(BlasInt, 1) - ccall(($(string(stev)),liblapack), Void, + ccall(($(blasfunc(stev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &job, &n, dv, ev, Zmat, &n, work, info) @@ -2229,7 +2231,7 @@ for (stev, stebz, stegr, stein, elty) in work = Array($elty, 4*n) iwork = Array(BlasInt,3*n) info = Array(BlasInt, 1) - ccall(($(string(stebz)),liblapack), Void, + ccall(($(blasfunc(stebz)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -2267,7 +2269,7 @@ for (stev, stebz, stegr, stein, elty) in liwork = -one(BlasInt) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(stegr)), liblapack), Void, + ccall(($(blasfunc(stegr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -2326,7 +2328,7 @@ for (stev, stebz, stegr, stein, elty) in ifail = Array(BlasInt,m) info = Array(BlasInt,1) - ccall(($(string(stein)),liblapack), Void, + ccall(($(blasfunc(stein)), liblapack), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -2365,7 +2367,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(syconv)),liblapack), Void, + ccall(($(blasfunc(syconv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &'C', &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2390,7 +2392,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(sysv)),liblapack), Void, + ccall(($(blasfunc(sysv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), @@ -2421,7 +2423,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(sytrf)),liblapack), Void, + ccall(($(blasfunc(sytrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, A, &stride(A,2), ipiv, work, &lwork, info) @@ -2449,7 +2451,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in # lwork = blas_int(-1) # info = Array(BlasInt, 1) # for i in 1:2 -# ccall(($(string(sytri)),liblapack), Void, +# ccall(($(blasfunc(sytri)), liblapack), Void, # (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2475,7 +2477,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(sytri)),liblapack), Void, + ccall(($(blasfunc(sytri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2498,7 +2500,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in @chkuplo if n != size(B,1) throw(DimensionMismatch("sytrs!")) end info = Array(BlasInt, 1) - ccall(($(string(sytrs)),liblapack), Void, + ccall(($(blasfunc(sytrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -2528,7 +2530,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(syconv)),liblapack), Void, + ccall(($(blasfunc(syconv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &'C', &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2553,7 +2555,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(hesv)),liblapack), Void, + ccall(($(blasfunc(hesv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), @@ -2583,7 +2585,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(hetrf)),liblapack), Void, + ccall(($(blasfunc(hetrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2612,7 +2614,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in # lwork = blas_int(-1) # info = Array(BlasInt, 1) # for i in 1:2 -# ccall(($(string(hetri)),liblapack), Void, +# ccall(($(blasfunc(hetri)), liblapack), Void, # (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2638,7 +2640,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(hetri)),liblapack), Void, + ccall(($(blasfunc(hetri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2659,7 +2661,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in n = chksquare(A) if n != size(B,1) throw(DimensionMismatch("hetrs!")) end info = Array(BlasInt, 1) - ccall(($(string(hetrs)),liblapack), Void, + ccall(($(blasfunc(hetrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -2691,7 +2693,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(sysv)),liblapack), Void, + ccall(($(blasfunc(sysv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), @@ -2722,7 +2724,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(sytrf)),liblapack), Void, + ccall(($(blasfunc(sytrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2751,7 +2753,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in # lwork = blas_int(-1) # info = Array(BlasInt, 1) # for i in 1:2 -# ccall(($(string(sytri)),liblapack), Void, +# ccall(($(blasfunc(sytri)), liblapack), Void, # (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2777,7 +2779,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(sytri)),liblapack), Void, + ccall(($(blasfunc(sytri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2799,7 +2801,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in @chkuplo if n != size(B,1) throw(DimensionMismatch("sytrs!")) end info = Array(BlasInt, 1) - ccall(($(string(sytrs)),liblapack), Void, + ccall(($(blasfunc(sytrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -2828,7 +2830,7 @@ for (syev, syevr, sygvd, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(syev)),liblapack), Void, + ccall(($(blasfunc(syev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &jobz, &uplo, &n, A, &max(1,stride(A,2)), W, work, &lwork, info) @@ -2877,7 +2879,7 @@ for (syev, syevr, sygvd, elty) in liwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(syevr)),liblapack), Void, + ccall(($(blasfunc(syevr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -2923,7 +2925,7 @@ for (syev, syevr, sygvd, elty) in liwork = -one(BlasInt) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(sygvd)),liblapack), Void, + ccall(($(blasfunc(sygvd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -2967,7 +2969,7 @@ for (syev, syevr, sygvd, elty, relty) in rwork = Array($relty, max(1, 3n-2)) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(syev)),liblapack), Void, + ccall(($(blasfunc(syev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), &jobz, &uplo, &n, A, &stride(A,2), W, work, &lwork, rwork, info) @@ -3020,7 +3022,7 @@ for (syev, syevr, sygvd, elty, relty) in liwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(syevr)),liblapack), Void, + ccall(($(blasfunc(syevr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -3076,7 +3078,7 @@ for (syev, syevr, sygvd, elty, relty) in lrwork = -one(BlasInt) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(sygvd)),liblapack), Void, + ccall(($(blasfunc(sygvd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, @@ -3136,7 +3138,7 @@ for (bdsqr, relty, elty) in work = Array($elty, 4n) info = Array(BlasInt,1) - ccall(($(string(bdsqr)),liblapack), Void, + ccall(($(blasfunc(bdsqr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -3194,7 +3196,7 @@ for (bdsdc, elty) in work =Array($elty, lwork) iwork=Array(BlasInt, 8n) info =Array(BlasInt, 1) - ccall(($(string(bdsdc)),liblapack), Void, + ccall(($(blasfunc(bdsdc)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -3231,7 +3233,7 @@ for (gecon, elty) in work = Array($elty, 4n) iwork = Array(BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(gecon)),liblapack), Void, + ccall(($(blasfunc(gecon)), liblapack), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -3265,7 +3267,7 @@ for (gecon, elty, relty) in work = Array($elty, 2n) rwork = Array($relty, 2n) info = Array(BlasInt, 1) - ccall(($(string(gecon)),liblapack), Void, + ccall(($(blasfunc(gecon)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}), @@ -3297,7 +3299,7 @@ for (gehrd, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gehrd)),liblapack), Void, + ccall(($(blasfunc(gehrd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -3336,7 +3338,7 @@ for (orghr, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(orghr)),liblapack), Void, + ccall(($(blasfunc(orghr)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -3378,7 +3380,7 @@ for (gees, gges, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gees)),liblapack), Void, + ccall(($(blasfunc(gees)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{Void}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -3420,7 +3422,7 @@ for (gees, gges, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gges)), liblapack), Void, + ccall(($(blasfunc(gges)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{Void}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -3468,7 +3470,7 @@ for (gees, gges, elty, relty) in rwork = Array($relty, n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gees)),liblapack), Void, + ccall(($(blasfunc(gees)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{Void}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -3511,7 +3513,7 @@ for (gees, gges, elty, relty) in rwork = Array($relty, 8n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gges)), liblapack), Void, + ccall(($(blasfunc(gges)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{Void}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -3563,7 +3565,7 @@ for (trsen, elty) in select = convert(Array{BlasInt}, select) for i = 1:2 - ccall(($(string(trsen)), liblapack), Void, + ccall(($(blasfunc(trsen)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{Void}, Ptr{Void}, @@ -3611,7 +3613,7 @@ for (trsen, elty) in select = convert(Array{BlasInt}, select) for i = 1:2 - ccall(($(string(trsen)), liblapack), Void, + ccall(($(blasfunc(trsen)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{Void}, Ptr{Void}, @@ -3649,7 +3651,7 @@ for (fn, elty, relty) in ((:dsfrk_, :Float64, :Float64), k, n = size(A) end lda = max(1, stride(A, 2)) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blasfunc(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}), @@ -3670,7 +3672,7 @@ for (fn, elty) in ((:dpftrf_, :Float64), function pftrf!(transr::Char, uplo::Char, A::StridedVector{$elty}) n = int(div(sqrt(8length(A)), 2)) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blasfunc(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &transr, &uplo, &n, A, @@ -3691,7 +3693,7 @@ for (fn, elty) in ((:dpftri_, :Float64), function pftri!(transr::Char, uplo::Char, A::StridedVector{$elty}) n = int(div(sqrt(8length(A)), 2)) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blasfunc(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &transr, &uplo, &n, A, @@ -3716,7 +3718,7 @@ for (fn, elty) in ((:dpftrs_, :Float64), nhrs = size(B, 2) ldb = max(1, stride(B, 2)) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blasfunc(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &transr, &uplo, &n, &nhrs, @@ -3739,7 +3741,7 @@ for (fn, elty) in ((:dtfsm_, :Float64), m, n = size(B) if int(div(sqrt(8length(A)), 2)) != m throw(DimensionMismatch("")) end ldb = max(1, stride(B, 2)) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blasfunc(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -3760,7 +3762,7 @@ for (fn, elty) in ((:dtftri_, :Float64), function tftri!(transr::Char, uplo::Char, diag::Char, A::StridedVector{$elty}) n = int(div(sqrt(8length(A)), 2)) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blasfunc(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &transr, &uplo, &diag, &n, @@ -3782,7 +3784,7 @@ for (fn, elty) in ((:dtfttr_, :Float64), n = int(div(sqrt(8length(Arf)), 2)) info = Array(BlasInt, 1) A = similar(Arf, $elty, n, n) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blasfunc(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &transr, &uplo, &n, Arf, @@ -3805,7 +3807,7 @@ for (fn, elty) in ((:dtrttf_, :Float64), lda = max(1, stride(A, 2)) info = Array(BlasInt, 1) Arf = similar(A, $elty, div(n*(n+1), 2)) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blasfunc(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &transr, &uplo, &n, A, @@ -3834,7 +3836,7 @@ for (fn, elty, relty) in ((:dtrsyl_, :Float64, :Float64), scale = Array($relty, 1) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blasfunc(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), diff --git a/base/util.jl b/base/util.jl index f593231ac73a0..df11d7c6d33f8 100644 --- a/base/util.jl +++ b/base/util.jl @@ -107,6 +107,10 @@ function blas_vendor() cglobal((:openblas_set_num_threads, Base.libblas_name), Void) return :openblas end + try + cglobal((:openblas_set_num_threads64_, Base.libblas_name), Void) + return :openblas64 + end try cglobal((:MKL_Set_Num_Threads, Base.libblas_name), Void) return :mkl @@ -114,12 +118,20 @@ function blas_vendor() return :unknown end -openblas_get_config() = strip(bytestring( ccall((:openblas_get_config, Base.libblas_name), Ptr{Uint8}, () ))) +if blas_vendor() == :openblas64 + blasfunc(x) = string(x)*"64_" + openblas_get_config() = strip(bytestring( ccall((:openblas_get_config64_, Base.libblas_name), Ptr{Uint8}, () ))) +else + blasfunc(x) = string(x) + openblas_get_config() = strip(bytestring( ccall((:openblas_get_config, Base.libblas_name), Ptr{Uint8}, () ))) +end function blas_set_num_threads(n::Integer) blas = blas_vendor() if blas == :openblas return ccall((:openblas_set_num_threads, Base.libblas_name), Void, (Int32,), n) + elseif blas == :openblas64 + return ccall((:openblas_set_num_threads64_, Base.libblas_name), Void, (Int32,), n) elseif blas == :mkl # MKL may let us set the number of threads in several ways return ccall((:MKL_Set_Num_Threads, Base.libblas_name), Void, (Cint,), n) @@ -133,7 +145,7 @@ end function check_blas() blas = blas_vendor() - if blas == :openblas + if blas == :openblas || blas == :openblas64 openblas_config = openblas_get_config() openblas64 = ismatch(r".*USE64BITINT.*", openblas_config) if Base.USE_BLAS64 != openblas64 diff --git a/deps/Makefile b/deps/Makefile index 81363f2584b6f..4e5b75f302ab4 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -19,7 +19,7 @@ CONFIGURE_COMMON += F77="$(FC)" CC="$(CC)" CXX="$(CXX)" MAKE_COMMON = DESTDIR="" prefix=$(build_prefix) bindir=$(build_bindir) libdir=$(build_libdir) libexecdir=$(build_libexecdir) datarootdir=$(build_datarootdir) includedir=$(build_includedir) sysconfdir=$(build_sysconfdir) #autoconf configure-driven scripts: llvm pcre arpack fftw unwind gmp mpfr patchelf uv -#custom Makefile rules: openlibm Rmath dsfmt suitesparse-wrapper suitesparse lapack openblas mojibake +#custom Makefile rules: openlibm Rmath dsfmt suitesparse-wrapper suitesparse lapack openblas mojibake objconv # prevent installing libs into usr/lib64 on opensuse unexport CONFIG_SITE @@ -77,6 +77,11 @@ endif ifeq ($(USE_SYSTEM_BLAS), 0) STAGE1_DEPS += openblas +ifeq ($(USE_BLAS64), 1) +ifeq ($(OS), Darwin) +STAGE1_DEPS += objconv +endif +endif endif ifeq ($(USE_SYSTEM_FFTW), 0) @@ -140,7 +145,7 @@ install: $(addprefix install-, $(DEP_LIBS)) cleanall: $(addprefix clean-, $(DEP_LIBS)) distcleanall: $(addprefix distclean-, $(DEP_LIBS)) rm -rf $(build_prefix) -getall: get-llvm get-uv get-pcre get-openlibm get-openspecfun get-dsfmt get-Rmath get-openblas get-lapack get-fftw get-suitesparse get-arpack get-unwind get-osxunwind get-gmp get-mpfr get-patchelf get-mojibake get-virtualenv +getall: get-llvm get-uv get-pcre get-openlibm get-openspecfun get-dsfmt get-Rmath get-openblas get-lapack get-fftw get-suitesparse get-arpack get-unwind get-osxunwind get-gmp get-mpfr get-patchelf get-mojibake get-virtualenv get-objconv ## PATHS ## # sort is used to remove potential duplicates @@ -829,7 +834,11 @@ endif # 64-bit BLAS interface ifeq ($(USE_BLAS64), 1) -OPENBLAS_BUILD_OPTS += INTERFACE64=1 +OPENBLAS_BUILD_OPTS += INTERFACE64=1 SYMBOLSUFFIX="64_" +ifeq ($(OS), Darwin) +OPENBLAS_BUILD_OPTS += OBJCONV=$(JULIAHOME)/deps/objconv/objconv +$(OPENBLAS_OBJ_SOURCE): $(OBJCONV_SOURCE) +endif endif # Decide whether to build for 32-bit or 64-bit arch @@ -864,6 +873,7 @@ endif mkdir -p openblas-$(OPENBLAS_VER) && \ $(TAR) -C openblas-$(OPENBLAS_VER) --strip-components 1 -xf $< perl -i -ple 's/^\s*(EXTRALIB\s*\+=\s*-lSystemStubs)\s*$$/# $$1/g' openblas-$(OPENBLAS_VER)/Makefile.system + cd openblas-$(OPENBLAS_VER) && patch -p1 < ../openblas-symbol-rename.patch echo 1 > $@ $(OPENBLAS_OBJ_SOURCE): openblas-$(OPENBLAS_VER)/config.status $(MAKE) -C openblas-$(OPENBLAS_VER) $(OPENBLAS_BUILD_OPTS) || (echo "*** Clean the OpenBLAS build with 'make -C deps clean-openblas'. Rebuild with 'make OPENBLAS_USE_THREAD=0 if OpenBLAS had trouble linking libpthread.so, and with 'make OPENBLAS_TARGET_ARCH=NEHALEM' if there were errors building SandyBridge support. Both these options can also be used simultaneously. ***" && false) @@ -1026,12 +1036,28 @@ install-lapack: $(LAPACK_OBJ_TARGET) ## ARPACK ## ARPACK_FFLAGS = $(GFORTBLAS_FFLAGS) +ARPACK_CFLAGS = ifeq ($(USE_BLAS64), 1) ifeq ($(USEIFC),1) ARPACK_FFLAGS += -i8 else ARPACK_FFLAGS += -fdefault-integer-8 +ifeq ($(USE_SYSTEM_BLAS), 0) +ifneq ($(USE_INTEL_MKL), 1) +ARPACK_FFLAGS += -cpp -ffixed-line-length-none +ARPACK_OPENBLASFCNS1 = axpy copy gemv geqr2 lacpy lahqr lanhs larnv lartg lascl laset scal trevc trmm trsen +ARPACK_OPENBLASFCNS2 = dot ger labad laev2 lamch lanst lanv2 lapy2 larf larfg lasr nrm2 orm2r rot steqr swap +ARPACK_OPENBLASFCNS3 = dotc geru unm2r +ARPACK_OPENBLASFCNS4 = COPY LABAD LAMCH LANHS LANV2 LARFG ROT +ARPACK_FFLAGS += $(foreach fcn, $(ARPACK_OPENBLASFCNS1) $(ARPACK_OPENBLASFCNS2), -Ds$(fcn)=s$(fcn)_64 -Dd$(fcn)=d$(fcn)_64) +ARPACK_FFLAGS += $(foreach fcn, $(ARPACK_OPENBLASFCNS1) $(ARPACK_OPENBLASFCNS3), -Dc$(fcn)=c$(fcn)_64 -Dz$(fcn)=z$(fcn)_64) +ARPACK_FFLAGS += $(foreach fcn, $(ARPACK_OPENBLASFCNS4), -DS$(fcn)=S$(fcn)_64 -DD$(fcn)=D$(fcn)_64) +ARPACK_FFLAGS += -Dscnrm2=scnrm2_64 -Ddznrm2=dznrm2_64 -Dcsscal=csscal_64 -Dzdscal=zdscal_64 +# CFLAGS are for the configure checks +ARPACK_CFLAGS += -Dsgemm_=sgemm_64_ -Dcheev_=cheev_64_ +endif +endif endif endif @@ -1044,7 +1070,7 @@ ARPACK_OBJ_TARGET = $(build_shlibdir)/libarpack.$(SHLIB_EXT) ARPACK_MFLAGS = F77="$(FC)" MPIF77="$(FC)" ARPACK_FFLAGS += $(FFLAGS) $(JFFLAGS) -ARPACK_FLAGS = --with-blas="$(LIBBLAS)" --with-lapack="$(LIBLAPACK)" --disable-mpi --enable-shared FFLAGS="$(ARPACK_FFLAGS)" +ARPACK_FLAGS = --with-blas="$(LIBBLAS)" --with-lapack="$(LIBLAPACK)" --disable-mpi --enable-shared FFLAGS="$(ARPACK_FFLAGS)" CFLAGS="$(ARPACK_CFLAGS)" ifneq ($(OS),WINNT) ARPACK_FLAGS += LDFLAGS="$(LDFLAGS) -Wl,-rpath,'$(build_libdir)'" endif @@ -1287,8 +1313,16 @@ SUITESPARSE_OBJ_SOURCE = SuiteSparse-$(SUITESPARSE_VER)/UMFPACK/Lib/libumfpack.a SUITESPARSE_OBJ_TARGET = $(build_shlibdir)/libspqr.$(SHLIB_EXT) ifeq ($(USE_BLAS64), 1) -UMFPACK_CONFIG = -DLONGBLAS='long long' -CHOLMOD_CONFIG = -DLONGBLAS='long long' +UMFPACK_CONFIG = -DLONGBLAS='long long' +CHOLMOD_CONFIG = -DLONGBLAS='long long' +SPQR_CONFIG = -DLONGBLAS='long long' +ifeq ($(USE_SYSTEM_BLAS), 0) +ifneq ($(USE_INTEL_MKL), 1) +UMFPACK_CONFIG += -DSUN64 +CHOLMOD_CONFIG += -DSUN64 +SPQR_CONFIG += -DSUN64 +endif +endif endif SUITE_SPARSE_LIB = -lm @@ -1302,7 +1336,7 @@ SUITE_SPARSE_LIB += -Wl,-rpath,'$(build_libdir)' endif SUITESPARSE_MFLAGS = CC="$(CC)" CXX="$(CXX)" F77="$(FC)" AR="$(AR)" RANLIB="$(RANLIB)" BLAS="$(LIBBLAS)" LAPACK="$(LIBLAPACK)" \ INSTALL_LIB="$(build_libdir)" INSTALL_INCLUDE="$(build_includedir)" LIB="$(SUITE_SPARSE_LIB)" \ - UMFPACK_CONFIG="$(UMFPACK_CONFIG)" CHOLMOD_CONFIG="$(CHOLMOD_CONFIG)" + UMFPACK_CONFIG="$(UMFPACK_CONFIG)" CHOLMOD_CONFIG="$(CHOLMOD_CONFIG)" SPQR_CONFIG="$(SPQR_CONFIG)" SuiteSparse-$(SUITESPARSE_VER).tar.gz: $(JLDOWNLOAD) $@ http://faculty.cse.tamu.edu/davis/SuiteSparse/$@ @@ -1665,6 +1699,33 @@ compile-virtualenv: $(VIRTUALENV_SOURCE) check-virtualenv: compile-virtualenv install-virtualenv: $(VIRTUALENV_TARGET) +## objconv ## + +OBJCONV_SOURCE = objconv/objconv +OBJCONV_TARGET = $(build_bindir)/objconv + +objconv.zip: + $(JLDOWNLOAD) $@ http://www.agner.org/optimize/objconv.zip +objconv/config.status: objconv.zip + unzip -d objconv $< + cd objconv && unzip source.zip + echo 1 > $@ +$(OBJCONV_SOURCE): objconv/config.status + cd objconv && $(CXX) -o objconv -O2 *.cpp +$(OBJCONV_TARGET): $(OBJCONV_SOURCE) | $(build_bindir) + cp -f $< $@ + +clean-objconv: + -rm -f $(OBJCONV_TARGET) +distclean-objconv: + -rm -rf objconv.zip objconv + +get-objconv: objconv.zip +configure-objconv: objconv/config.status +compile-objconv: $(OBJCONV_SOURCE) +check-objconv: compile-objconv +install-objconv: $(OBJCONV_TARGET) + ## phony targets ## .PHONY: default compile install cleanall distcleanall \ diff --git a/deps/openblas-symbol-rename.patch b/deps/openblas-symbol-rename.patch new file mode 100644 index 0000000000000..c5ed9a1b85cf8 --- /dev/null +++ b/deps/openblas-symbol-rename.patch @@ -0,0 +1,333 @@ +diff --git a/Makefile.system b/Makefile.system +index d2ff741..ec6339d 100644 +--- a/Makefile.system ++++ b/Makefile.system +@@ -186,6 +186,8 @@ LD = $(CROSS_SUFFIX)ld + RANLIB = $(CROSS_SUFFIX)ranlib + NM = $(CROSS_SUFFIX)nm + DLLWRAP = $(CROSS_SUFFIX)dllwrap ++OBJCOPY = $(CROSS_SUFFIX)objcopy ++OBJCONV = $(CROSS_SUFFIX)objconv + + # + # OS dependent settings +@@ -845,6 +847,14 @@ else + LIBPREFIX = libopenblas_$(LIBNAMESUFFIX) + endif + ++ifndef SYMBOLPREFIX ++SYMBOLPREFIX = ++endif ++ ++ifndef SYMBOLSUFFIX ++SYMBOLSUFFIX = ++endif ++ + KERNELDIR = $(TOPDIR)/kernel/$(ARCH) + + include $(TOPDIR)/Makefile.$(ARCH) +diff --git a/exports/Makefile b/exports/Makefile +index c798bc7..f2f6881 100644 +--- a/exports/Makefile ++++ b/exports/Makefile +@@ -88,12 +88,18 @@ dll : ../$(LIBDLLNAME) + -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(FEXTRALIB) $(EXTRALIB) + + libopenblas.def : gensymbol +- perl ./gensymbol win2k $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) ++ perl ./gensymbol win2k $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" > $(@F) + + libgoto_hpl.def : gensymbol +- perl ./gensymbol win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) ++ perl ./gensymbol win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" > $(@F) + ++ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX)) + $(LIBDYNNAME) : ../$(LIBNAME) osx.def ++else ++../$(LIBNAME).renamed : ../$(LIBNAME) objconv.def ++ $(OBJCONV) @objconv.def ../$(LIBNAME) ../$(LIBNAME).renamed ++$(LIBDYNNAME) : ../$(LIBNAME).renamed osx.def ++endif + $(FC) $(FFLAGS) -all_load -headerpad_max_install_names -install_name $(CURDIR)/../$(LIBDYNNAME) -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) + + dllinit.$(SUFFIX) : dllinit.c +@@ -103,16 +109,22 @@ ifeq ($(OSNAME), Linux) + + so : ../$(LIBSONAME) + ++ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX)) + ../$(LIBSONAME) : ../$(LIBNAME) linktest.c ++else ++../$(LIBNAME).renamed : ../$(LIBNAME) objcopy.def ++ $(OBJCOPY) --redefine-syms objcopy.def ../$(LIBNAME) ../$(LIBNAME).renamed ++../$(LIBSONAME) : ../$(LIBNAME).renamed linktest.c ++endif + ifneq ($(C_COMPILER), LSB) + $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \ +- -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \ ++ -Wl,--whole-archive $< -Wl,--no-whole-archive \ + -Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB) + $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK. + else + #for LSB + env LSBCC_SHAREDLIBS=gfortran $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \ +- -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \ ++ -Wl,--whole-archive $< -Wl,--no-whole-archive \ + -Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB) + $(FC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK. + endif +@@ -125,9 +137,15 @@ ifeq ($(OSNAME), $(filter $(OSNAME),FreeBSD NetBSD)) + + so : ../$(LIBSONAME) + ++ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX)) + ../$(LIBSONAME) : ../$(LIBNAME) linktest.c ++else ++../$(LIBNAME).renamed : ../$(LIBNAME) objcopy.def ++ $(OBJCOPY) --redefine-syms objcopy.def ../$(LIBNAME) ../$(LIBNAME).renamed ++../$(LIBSONAME) : ../$(LIBNAME).renamed linktest.c ++endif + $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \ +- -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \ ++ -Wl,--whole-archive $< -Wl,--no-whole-archive \ + $(FEXTRALIB) $(EXTRALIB) + $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK. + rm -f linktest +@@ -178,17 +196,23 @@ static : ../$(LIBNAME) + rm -f goto.$(SUFFIX) + + osx.def : gensymbol ../Makefile.system ../getarch.c +- perl ./gensymbol osx $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) ++ perl ./gensymbol osx $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" > $(@F) + + aix.def : gensymbol ../Makefile.system ../getarch.c +- perl ./gensymbol aix $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) ++ perl ./gensymbol aix $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" > $(@F) ++ ++objcopy.def : gensymbol ../Makefile.system ../getarch.c ++ perl ./gensymbol objcopy $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" > $(@F) ++ ++objconv.def : gensymbol ../Makefile.system ../getarch.c ++ perl ./gensymbol objconv $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" > $(@F) + + test : linktest.c + $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) -lm && echo OK. + rm -f linktest + + linktest.c : gensymbol ../Makefile.system ../getarch.c +- perl ./gensymbol linktest $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > linktest.c ++ perl ./gensymbol linktest $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) "$(SYMBOLPREFIX)" "$(SYMBOLSUFFIX)" > linktest.c + + clean :: + @rm -f *.def *.dylib __.SYMDEF* +diff --git a/exports/gensymbol b/exports/gensymbol +index bcea836..8bd2f17 100644 +--- a/exports/gensymbol ++++ b/exports/gensymbol +@@ -2784,22 +2784,26 @@ $bu = $ARGV[2]; + + $bu = "" if (($bu eq "0") || ($bu eq "1")); + ++$symbolprefix = $ARGV[9]; ++ ++$symbolsuffix = $ARGV[10]; ++ + if ($ARGV[0] eq "osx"){ + + @underscore_objs = (@underscore_objs, @misc_common_objs); + @no_underscore_objs = (@no_underscore_objs, @misc_common_objs); + + foreach $objs (@underscore_objs) { +- print "_", $objs, $bu, "\n"; ++ print "_", $symbolprefix, $objs, $bu, $symbolsuffix, "\n"; + } + + foreach $objs (@need_2underscore_objs) { +- print "_", $objs, $bu, $bu, "\n"; ++ print "_", $symbolprefix, $objs, $bu, $bu, $symbolsuffix, "\n"; + } + + # if ($ARGV[4] == 0) { + foreach $objs (@no_underscore_objs) { +- print "_", $objs, "\n"; ++ print "_", $symbolprefix, $objs, $symbolsuffix, "\n"; + } + # } + exit(0); +@@ -2811,16 +2815,58 @@ if ($ARGV[0] eq "aix"){ + @no_underscore_objs = (@no_underscore_objs, @misc_common_objs); + + foreach $objs (@underscore_objs) { +- print $objs, $bu, "\n"; ++ print $symbolprefix, $objs, $bu, $symbolsuffix, "\n"; ++ } ++ ++ foreach $objs (@need_2underscore_objs) { ++ print $symbolprefix, $objs, $bu, $bu, $symbolsuffix, "\n"; ++ } ++ ++# if ($ARGV[4] == 0) { ++ foreach $objs (@no_underscore_objs) { ++ print $symbolprefix, $objs, $symbolsuffix, "\n"; ++ } ++# } ++ exit(0); ++} ++ ++if ($ARGV[0] eq "objcopy"){ ++ ++ @underscore_objs = (@underscore_objs, @misc_common_objs); ++ @no_underscore_objs = (@no_underscore_objs, @misc_common_objs); ++ ++ foreach $objs (@underscore_objs) { ++ print $objs, $bu, " ", $symbolprefix, $objs, $bu, $symbolsuffix, "\n"; ++ } ++ ++ foreach $objs (@need_2underscore_objs) { ++ print $objs, $bu, $bu, " ", $symbolprefix, $objs, $bu, $bu, $symbolsuffix, "\n"; ++ } ++ ++# if ($ARGV[4] == 0) { ++ foreach $objs (@no_underscore_objs) { ++ print $objs, " ", $symbolprefix, $objs, $symbolsuffix, "\n"; ++ } ++# } ++ exit(0); ++} ++ ++if ($ARGV[0] eq "objconv"){ ++ ++ @underscore_objs = (@underscore_objs, @misc_common_objs); ++ @no_underscore_objs = (@no_underscore_objs, @misc_common_objs); ++ ++ foreach $objs (@underscore_objs) { ++ print "-nr:_", $objs, $bu, ":_", $symbolprefix, $objs, $bu, $symbolsuffix, "\n"; + } + + foreach $objs (@need_2underscore_objs) { +- print $objs, $bu, $bu, "\n"; ++ print "-nr:_", $objs, $bu, $bu, ":_", $symbolprefix, $objs, $bu, $bu, $symbolsuffix, "\n"; + } + + # if ($ARGV[4] == 0) { + foreach $objs (@no_underscore_objs) { +- print $objs, "\n"; ++ print "-nr:_", $objs, ":_", $symbolprefix, $objs, $symbolsuffix, "\n"; + } + # } + exit(0); +@@ -2835,22 +2881,22 @@ if ($ARGV[0] eq "win2k"){ + foreach $objs (@underscore_objs) { + $uppercase = $objs; + $uppercase =~ tr/[a-z]/[A-Z]/; +- print "\t$objs=$objs","_ \@", $count, "\n"; ++ print "\t",$symbolprefix, $objs, $symbolsuffix, "=$objs","_ \@", $count, "\n"; + $count ++; +- print "\t",$objs, "_=$objs","_ \@", $count, "\n"; ++ print "\t",$symbolprefix, $objs, "_", $symbolsuffix, "=$objs","_ \@", $count, "\n"; + $count ++; +- print "\t$uppercase=$objs", "_ \@", $count, "\n"; ++ print "\t",$symbolprefix, $uppercase, $symbolsuffix, "=$objs", "_ \@", $count, "\n"; + $count ++; + } + + foreach $objs (@need_2underscore_objs) { + $uppercase = $objs; + $uppercase =~ tr/[a-z]/[A-Z]/; +- print "\t$objs=$objs","__ \@", $count, "\n"; ++ print "\t",$symbolprefix, $objs, $symbolsuffix, "=$objs","__ \@", $count, "\n"; + $count ++; +- print "\t",$objs, "__=$objs","__ \@", $count, "\n"; ++ print "\t",$symbolprefix, $objs, "__", $symbolsuffix, "=$objs","__ \@", $count, "\n"; + $count ++; +- print "\t$uppercase=$objs", "__ \@", $count, "\n"; ++ print "\t",$symbolprefix, $uppercase, $symbolsuffix, "=$objs", "__ \@", $count, "\n"; + $count ++; + } + +@@ -2859,15 +2905,15 @@ if ($ARGV[0] eq "win2k"){ + + $uppercase = $objs; + $uppercase =~ tr/[a-z]/[A-Z]/; +- print "\t",$objs, "_=$objs","_ \@", $count, "\n"; ++ print "\t",$symbolprefix, $objs, "_", $symbolsuffix, "=$objs","_ \@", $count, "\n"; + $count ++; +- print "\t$uppercase=$objs", "_ \@", $count, "\n"; ++ print "\t",$symbolprefix, $uppercase, $symbolsuffix, "=$objs", "_ \@", $count, "\n"; + $count ++; + } + + + foreach $objs (@no_underscore_objs) { +- print "\t",$objs,"=$objs"," \@", $count, "\n"; ++ print "\t",$symbolprefix,$objs,$symbolsuffix,"=$objs"," \@", $count, "\n"; + $count ++; + } + +@@ -2880,11 +2926,11 @@ if ($ARGV[0] eq "win2khpl"){ + foreach $objs (@hplobjs) { + $uppercase = $objs; + $uppercase =~ tr/[a-z]/[A-Z]/; +- print "\t$objs=$objs","_ \@", $count, "\n"; ++ print "\t",$symbolprefix, $objs, $symbolsuffix, "=$objs","_ \@", $count, "\n"; + $count ++; +- print "\t",$objs, "_=$objs","_ \@", $count, "\n"; ++ print "\t",$symbolprefix, $objs, "_", $symbolsuffix, "=$objs","_ \@", $count, "\n"; + $count ++; +- print "\t$uppercase=$objs", "_ \@", $count, "\n"; ++ print "\t",$symbolprefix, $uppercase, $symbolsuffix, "=$objs", "_ \@", $count, "\n"; + $count ++; + } + +@@ -2905,24 +2951,24 @@ if ($ARGV[0] eq "microsoft"){ + foreach $objs (@underscore_objs) { + $uppercase = $objs; + $uppercase =~ tr/[a-z]/[A-Z]/; +- print "\t$objs = $objs","_\n"; ++ print "\t",$symbolprefix, $objs, $symbolsuffix, " = $objs","_\n"; + $count ++; +- print "\t$objs\_ = $objs","_\n"; ++ print "\t",$symbolprefix, $objs, "\_", $symbolsuffix, " = $objs","_\n"; + $count ++; +- print "\t$uppercase = $objs","_\n"; ++ print "\t",$symbolprefix, $uppercase, $symbolsuffix, " = $objs","_\n"; + $count ++; +- print "\t$uppercase\_ = $objs","_\n"; ++ print "\t",$symbolprefix, $uppercase, "\_", $symbolsuffix, " = $objs","_\n"; + $count ++; + } + + foreach $objs (@need_2underscore_objs) { + $uppercase = $objs; + $uppercase =~ tr/[a-z]/[A-Z]/; +- print "\t$objs=$objs","__ \@", $count, "\n"; ++ print "\t",$symbolprefix, $objs, $symbolsuffix, "=$objs","__ \@", $count, "\n"; + $count ++; +- print "\t",$objs, "__=$objs","__ \@", $count, "\n"; ++ print "\t",$symbolprefix, $objs, "__", $symbolsuffix, "=$objs","__ \@", $count, "\n"; + $count ++; +- print "\t$uppercase=$objs", "__ \@", $count, "\n"; ++ print "\t",$symbolprefix, $uppercase, $symbolsuffix, "=$objs", "__ \@", $count, "\n"; + $count ++; + } + +@@ -2936,16 +2982,16 @@ if ($ARGV[0] eq "linktest"){ + + print "int main(void){\n"; + foreach $objs (@underscore_objs) { +- print $objs, $bu, "();\n" if $objs ne "xerbla"; ++ print $symbolprefix, $objs, $bu, $symbolsuffix, "();\n" if $objs ne "xerbla"; + } + + foreach $objs (@need_2underscore_objs) { +- print $objs, $bu, $bu, "();\n"; ++ print $symbolprefix, $objs, $bu, $bu, $symbolsuffix, "();\n"; + } + + # if ($ARGV[4] == 0) { + foreach $objs (@no_underscore_objs) { +- print $objs, "();\n"; ++ print $symbolprefix, $objs, $symbolsuffix, "();\n"; + } + # } +