diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 00000000000000..e63431649f897b --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,28 @@ +steps: + - label: "analyzegc" + commands: + - echo "--- Install apt-get pre-reqs" + - apt-get update + - apt-get install -y build-essential libatomic1 python python3 gfortran perl wget m4 cmake pkg-config curl + - echo "--- Install in-tree LLVM dependencies" + - make -j 6 -C deps install-llvm install-clang install-llvm-tools install-libuv install-utf8proc install-unwind + - echo "+++ run clangsa/analyzegc" + - make -j 6 -C test/clangsa + - make -j 6 -C src analyzegc + agents: + queue: "juliacpu" # this should be julia -- also in pipeline settings + # os: linux # tag missing for juliacpu queue + timeout_in_minutes: 60 + - label: "llvmpasses" + commands: + - echo "--- Install apt-get pre-reqs" + - apt-get update + - apt-get install -y build-essential libatomic1 python python3 gfortran perl wget m4 cmake pkg-config curl + - echo "+++ run llvmpasses" + - make -j 6 release + - make -j 6 -C src install-analysis-deps + - make -j 6 -C test/llvmpasses + agents: + queue: "juliacpu" # this should be julia -- also in pipeline settings + # os: linux # tag missing for juliacpu queue + timeout_in_minutes: 60 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 865abeebd82af2..6cab5b68b11e91 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,3 @@ -/.github/workflows/ @JuliaLang/github-actions +CODEOWNERS @JuliaLang/github-actions +/.github/ @JuliaLang/github-actions +/.buildkite/ @JuliaLang/github-actions diff --git a/CITATION.bib b/CITATION.bib new file mode 100644 index 00000000000000..f1361a1eea0b89 --- /dev/null +++ b/CITATION.bib @@ -0,0 +1,15 @@ +% This article is the definitive citation for Julia. +@article{Julia-2017, + title={Julia: A fresh approach to numerical computing}, + author={Bezanson, Jeff and Edelman, Alan and Karpinski, Stefan and Shah, Viral B}, + journal={SIAM {R}eview}, + volume={59}, + number={1}, + pages={65--98}, + year={2017}, + publisher={SIAM}, + doi={10.1137/141000671}, + url={https://epubs.siam.org/doi/10.1137/141000671} +} + +% For more details on research related to Julia, see https://julialang.org/research diff --git a/Make.inc b/Make.inc index 207308b34b82a4..10f1b471fe7a64 100644 --- a/Make.inc +++ b/Make.inc @@ -45,7 +45,7 @@ USE_SYSTEM_BLAS:=0 USE_SYSTEM_LAPACK:=0 USE_SYSTEM_GMP:=0 USE_SYSTEM_MPFR:=0 -USE_SYSTEM_SUITESPARSE:=0 +USE_SYSTEM_LIBSUITESPARSE:=0 USE_SYSTEM_LIBUV:=0 USE_SYSTEM_UTF8PROC:=0 USE_SYSTEM_MBEDTLS:=0 @@ -1168,7 +1168,7 @@ BB_TRIPLET := $(subst $(SPACE),-,$(filter-out cxx%,$(filter-out libgfortran%,$(s LIBGFORTRAN_VERSION := $(subst libgfortran,,$(filter libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN)))) # This is the set of projects that BinaryBuilder dependencies are hooked up for. -BB_PROJECTS := BLASTRAMPOLINE OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP CSL +BB_PROJECTS := BLASTRAMPOLINE OPENBLAS LLVM LIBSUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP CSL define SET_BB_DEFAULT # First, check to see if BB is disabled on a global setting ifeq ($$(USE_BINARYBUILDER),0) @@ -1187,7 +1187,7 @@ $(foreach proj,$(BB_PROJECTS),$(eval $(call SET_BB_DEFAULT,$(proj)))) # Warn if the user tries to build something that requires `gfortran` but they don't have it installed. ifeq ($(FC_VERSION),) -ifneq ($(USE_BINARYBUILDER_OPENBLAS)$(USE_BINARYBUILDER_SUITESPARSE),11) +ifneq ($(USE_BINARYBUILDER_OPENBLAS)$(USE_BINARYBUILDER_LIBSUITESPARSE),11) $(error "Attempting to build OpenBLAS or SuiteSparse without a functioning fortran compiler!") endif endif @@ -1374,8 +1374,8 @@ endif ifeq ($(USE_SYSTEM_BLAS),1) # Since the names don't line up (`BLAS` vs. `OPENBLAS`), manually gate: USE_BINARYBUILDER_OPENBLAS := 0 -# Disable BB SuiteSparse if we're using system BLAS -USE_BINARYBUILDER_SUITESPARSE := 0 +# Disable BB LIBSUITESPARSE if we're using system BLAS +USE_BINARYBUILDER_LIBSUITESPARSE := 0 endif ifeq ($(USE_SYSTEM_LIBM),1) diff --git a/Makefile b/Makefile index d16cf2855087b9..f4207c1719021a 100644 --- a/Makefile +++ b/Makefile @@ -171,7 +171,7 @@ JL_PRIVATE_LIBS-0 += libjulia-internal-debug endif ifeq ($(USE_GPL_LIBS), 1) JL_PRIVATE_LIBS-0 += libsuitesparse_wrapper -JL_PRIVATE_LIBS-$(USE_SYSTEM_SUITESPARSE) += libamd libbtf libcamd libccolamd libcholmod libcolamd libklu libldl librbio libspqr libsuitesparseconfig libumfpack +JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBSUITESPARSE) += libamd libbtf libcamd libccolamd libcholmod libcolamd libklu libldl librbio libspqr libsuitesparseconfig libumfpack endif JL_PRIVATE_LIBS-$(USE_SYSTEM_PCRE) += libpcre2-8 JL_PRIVATE_LIBS-$(USE_SYSTEM_DSFMT) += libdSFMT @@ -189,7 +189,7 @@ else JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += libz endif ifeq ($(USE_LLVM_SHLIB),1) -JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-11jl +JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-12jl endif JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libunwind diff --git a/NEWS.md b/NEWS.md index eafec374d5a0e7..27074440b3b492 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,11 @@ New language features as `.&&` and `.||`. ([#39594]) * `⫪` (U+2AEA, `\Top`, `\downvDash`) and `⫫` (U+2AEB, `\Bot`, `\upvDash`, `\indep`) may now be used as binary operators with comparison precedence. ([#39403]) +* Repeated semicolons may now be used inside array literals to separate dimensions of an array, + with the number of semicolons specifying the particular dimension. Just as the single semicolon + in `[A; B]` has always described concatenating along the first dimension (vertically), now two + semicolons `[A;; B]` do so in the second dimension (horizontally), three semicolons `;;;` in the + third, and so on. ([#33697]) Language changes ---------------- @@ -60,6 +65,7 @@ Standard library changes * `count` and `findall` now accept an `AbstractChar` argument to search for a character in a string ([#38675]). * `range` now supports the `range(start, stop)` and `range(start, stop, length)` methods ([#39228]). * `range` now supports `start` as an optional keyword argument ([#38041]). +* Some operations on ranges will return a `StepRangeLen` instead of a `StepRange`, to allow the resulting step to be zero. Previously, `λ .* (1:9)` gave an error when `λ = 0`. ([#40320]) * `islowercase` and `isuppercase` are now compliant with the Unicode lower/uppercase categories ([#38574]). * `iseven` and `isodd` functions now support non-`Integer` numeric types ([#38976]). * `escape_string` can now receive a collection of characters in the keyword @@ -87,6 +93,8 @@ Standard library changes ``` ([#39322]) * `@lock` is now exported from Base ([#39588]). +* The experimental function `Base.catch_stack()` has been renamed to `current_exceptions()`, exported from Base and given a more specific return type ([#29901]) +* Some degree trigonometric functions, `sind`, `cosd`, `tand`, `asind`, `acosd`, `asecd`, `acscd`, `acotd`, `atand` now accept an square matrix ([#39758]). #### Package Manager @@ -100,6 +108,7 @@ Standard library changes * The shape of an `UpperHessenberg` matrix is preserved under certain arithmetic operations, e.g. when multiplying or dividing by an `UpperTriangular` matrix. ([#40039]) * `cis(A)` now supports matrix arguments ([#40194]). * `dot` now supports `UniformScaling` with `AbstractMatrix` ([#40250]). +* `det(M::AbstractMatrix{BigInt})` now calls `det_bareiss(M)`, which uses the [Bareiss](https://en.wikipedia.org/wiki/Bareiss_algorithm) algorithm to calculate precise values.([#40868]). #### Markdown @@ -117,7 +126,7 @@ Standard library changes * new `sizehint!(::SparseMatrixCSC, ::Integer)` method ([#30676]). * `cholesky()` now fully preserves the user-specified permutation. ([#40560]) - +* `issparse` now applies consistently to all wrapper arrays, including nested, by checking `issparse` on the wrapped parent array ([#37644]). #### Dates @@ -145,7 +154,7 @@ Standard library changes Deprecated or removed --------------------- -- Multiple successive semicolons in an array expresion were previously ignored (e.g. `[1 ;; 2] == [1 ; 2]`). Multiple semicolons are being reserved for future syntax and may have different behavior in a future release. +- Multiple successive semicolons in an array expresion were previously ignored (e.g., `[1 ;; 2] == [1 ; 2]`). This is now being used to separate dimensions for array literals. (see **New language features**) External dependencies diff --git a/README.md b/README.md index 38566819e0d2e9..cb1fc2bdd81807 100644 --- a/README.md +++ b/README.md @@ -144,10 +144,7 @@ Support for editing Julia is available for many [Sublime Text](https://github.com/JuliaEditorSupport/Julia-sublime), and many others. -Supported IDEs include: [Juno](http://junolab.org/) (Atom plugin), -[julia-vscode](https://github.com/JuliaEditorSupport/julia-vscode) (VS -Code plugin), and -[julia-intellij](https://github.com/JuliaEditorSupport/julia-intellij) -(IntelliJ IDEA plugin). The popular [Jupyter](https://jupyter.org/) -notebook interface is available through -[IJulia](https://github.com/JuliaLang/IJulia.jl). +Supported IDEs include: [julia-vscode](https://github.com/JuliaEditorSupport/julia-vscode) (VS +Code plugin), [Juno](http://junolab.org/) (Atom plugin). [Jupyter](https://jupyter.org/) +notebooks are available through the [IJulia](https://github.com/JuliaLang/IJulia.jl) package, and +[Pluto](https://github.com/fonsp/Pluto.jl) notebooks through the Pluto.jl package. diff --git a/base/Makefile b/base/Makefile index 5c6540331a8808..56e1cbebf21bf1 100644 --- a/base/Makefile +++ b/base/Makefile @@ -218,14 +218,14 @@ $(eval $(call symlink_system_library,LIBSSH2,libssh2)) $(eval $(call symlink_system_library,NGHTTP2,libnghttp2)) $(eval $(call symlink_system_library,CURL,libcurl)) $(eval $(call symlink_system_library,LIBGIT2,libgit2)) -$(eval $(call symlink_system_library,SUITESPARSE,libamd)) -$(eval $(call symlink_system_library,SUITESPARSE,libcamd)) -$(eval $(call symlink_system_library,SUITESPARSE,libccolamd)) -$(eval $(call symlink_system_library,SUITESPARSE,libcholmod)) -$(eval $(call symlink_system_library,SUITESPARSE,libcolamd)) -$(eval $(call symlink_system_library,SUITESPARSE,libumfpack)) -$(eval $(call symlink_system_library,SUITESPARSE,libspqr)) -$(eval $(call symlink_system_library,SUITESPARSE,libsuitesparseconfig)) +$(eval $(call symlink_system_library,LIBSUITESPARSE,libamd)) +$(eval $(call symlink_system_library,LIBSUITESPARSE,libcamd)) +$(eval $(call symlink_system_library,LIBSUITESPARSE,libccolamd)) +$(eval $(call symlink_system_library,LIBSUITESPARSE,libcholmod)) +$(eval $(call symlink_system_library,LIBSUITESPARSE,libcolamd)) +$(eval $(call symlink_system_library,LIBSUITESPARSE,libumfpack)) +$(eval $(call symlink_system_library,LIBSUITESPARSE,libspqr)) +$(eval $(call symlink_system_library,LIBSUITESPARSE,libsuitesparseconfig)) # EXCLUDED LIBRARIES (installed/used, but not vendored for use with dlopen): # libunwind endif # WINNT diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 2cbe4b501e7182..33c549d0602733 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -1829,6 +1829,24 @@ dimensions for every new input array and putting zero blocks elsewhere. For exam `cat(matrices...; dims=(1,2))` builds a block diagonal matrix, i.e. a block matrix with `matrices[1]`, `matrices[2]`, ... as diagonal blocks and matching zero blocks away from the diagonal. + +See also [`hcat`](@ref), [`vcat`](@ref), [`hvcat`](@ref), [`repeat`](@ref). + +# Examples +```jldoctest +julia> cat([1 2; 3 4], [pi, pi], fill(10, 2,3,1); dims=2) +2×6×1 Array{Float64, 3}: +[:, :, 1] = + 1.0 2.0 3.14159 10.0 10.0 10.0 + 3.0 4.0 3.14159 10.0 10.0 10.0 + +julia> cat(true, trues(2,2), trues(4)', dims=(1,2)) +4×7 Matrix{Bool}: + 1 0 0 0 0 0 0 + 0 1 1 0 0 0 0 + 0 1 1 0 0 0 0 + 0 0 0 1 1 1 1 +``` """ @inline cat(A...; dims) = _cat(dims, A...) _cat(catdims, A::AbstractArray{T}...) where {T} = cat_t(T, A...; dims=catdims) @@ -1886,7 +1904,7 @@ julia> hvcat((3,3), a,b,c,d,e,f) 1 2 3 4 5 6 -julia> [a b;c d; e f] +julia> [a b; c d; e f] 3×2 Matrix{Int64}: 1 2 3 4 @@ -2013,6 +2031,357 @@ function typed_hvcat(::Type{T}, rows::Tuple{Vararg{Int}}, as...) where T T[rs...;] end +# nd concatenation + +""" + hvncat(dims::Tuple{Vararg{Int}}, row_first, values...) + hvncat(shape::Tuple{Vararg{Tuple}}, row_first, values...) + +Horizontal, vertical, and n-dimensional concatenation of many `values` in one call. + +This function is called +for block matrix syntax. The first argument either specifies the shape of the concatenation, +similar to `hvcat`, as a tuple of tuples, or the dimensions that specify the key number of +elements along each axis, and is used to determine the output dimensions. The `dims` form +is more performant, and is used by default when the concatenation operation has the same +number of elements along each axis (e.g., [a b; c d;;; e f ; g h]). The `shape` form is used +when the number of elements along each axis is unbalanced (e.g., [a b ; c]). Unbalanced +syntax needs additional validation overhead. + +# Examples +```jldoctest +julia> a, b, c, d, e, f = 1, 2, 3, 4, 5, 6 +(1, 2, 3, 4, 5, 6) + +julia> [a b c;;; d e f] +1×3×2 Array{Int64, 3}: +[:, :, 1] = + 1 2 3 + +[:, :, 2] = + 4 5 6 + +julia> hvncat((2,1,3), false, a,b,c,d,e,f) +2×1×3 Array{Int64, 3}: +[:, :, 1] = + 1 + 2 + +[:, :, 2] = + 3 + 4 + +[:, :, 3] = + 5 + 6 + +julia> [a b;;; c d;;; e f] +1×2×3 Array{Int64, 3}: +[:, :, 1] = + 1 2 + +[:, :, 2] = + 3 4 + +[:, :, 3] = + 5 6 + +julia> hvncat(((3, 3), (3, 3), (6,)), true, a, b, c, d, e, f) +1×3×2 Array{Int64, 3}: +[:, :, 1] = + 1 2 3 + +[:, :, 2] = + 4 5 6 +``` +""" +hvncat(::Tuple{}, ::Bool) = [] +hvncat(::Tuple{}, ::Bool, xs...) = [] +hvncat(::Tuple{Vararg{Any, 1}}, ::Bool, xs...) = vcat(xs...) # methods assume 2+ dimensions +hvncat(dimsshape::Tuple, row_first::Bool, xs...) = _hvncat(dimsshape, row_first, xs...) +hvncat(dim::Int, xs...) = _hvncat(dim, true, xs...) + +_hvncat(::Union{Tuple, Int}, ::Bool) = [] +_hvncat(dimsshape::Union{Tuple, Int}, row_first::Bool, xs...) = _typed_hvncat(promote_eltypeof(xs...), dimsshape, row_first, xs...) +_hvncat(dimsshape::Union{Tuple, Int}, row_first::Bool, xs::T...) where T<:Number = _typed_hvncat(T, dimsshape, row_first, xs...) +_hvncat(dimsshape::Union{Tuple, Int}, row_first::Bool, xs::Number...) = _typed_hvncat(promote_typeof(xs...), dimsshape, row_first, xs...) +_hvncat(dimsshape::Union{Tuple, Int}, row_first::Bool, xs::AbstractArray...) = _typed_hvncat(promote_eltype(xs...), dimsshape, row_first, xs...) +_hvncat(dimsshape::Union{Tuple, Int}, row_first::Bool, xs::AbstractArray{T}...) where T = _typed_hvncat(T, dimsshape, row_first, xs...) + +typed_hvncat(::Type{T}, ::Tuple{}, ::Bool) where T = Vector{T}() +typed_hvncat(::Type{T}, ::Tuple{}, ::Bool, xs...) where T = Vector{T}() +typed_hvncat(T::Type, ::Tuple{Vararg{Any, 1}}, ::Bool, xs...) = typed_vcat(T, xs...) # methods assume 2+ dimensions +typed_hvncat(T::Type, dimsshape::Tuple, row_first::Bool, xs...) = _typed_hvncat(T, dimsshape, row_first, xs...) +typed_hvncat(T::Type, dim::Int, xs...) = _typed_hvncat(T, Val(dim), xs...) + +_typed_hvncat(::Type{T}, ::Tuple{}, ::Bool) where T = Vector{T}() +_typed_hvncat(::Type{T}, ::Tuple{}, ::Bool, xs...) where T = Vector{T}() +_typed_hvncat(::Type{T}, ::Tuple{}, ::Bool, xs::Number...) where T = Vector{T}() +function _typed_hvncat(::Type{T}, dims::Tuple{Vararg{Int, N}}, row_first::Bool, xs::Number...) where {T, N} + A = Array{T, N}(undef, dims...) + lengtha = length(A) # Necessary to store result because throw blocks are being deoptimized right now, which leads to excessive allocations + lengthx = length(xs) # Cuts from 3 allocations to 1. + if lengtha != lengthx + throw(ArgumentError("argument count does not match specified shape (expected $lengtha, got $lengthx)")) + end + hvncat_fill!(A, row_first, xs) + return A +end + +function hvncat_fill!(A::Array, row_first::Bool, xs::Tuple) + # putting these in separate functions leads to unnecessary allocations + if row_first + nr, nc = size(A, 1), size(A, 2) + nrc = nr * nc + @inbounds na = prod(size(A)[3:end]) + k = 1 + @inbounds for d ∈ 1:na + dd = nrc * (d - 1) + for i ∈ 1:nr + Ai = dd + i + for j ∈ 1:nc + A[Ai] = xs[k] + k += 1 + Ai += nr + end + end + end + else + @inbounds for k ∈ eachindex(xs) + A[k] = xs[k] + end + end +end + +_typed_hvncat(T::Type, dim::Int, ::Bool, xs...) = _typed_hvncat(T, Val(dim), xs...) # catches from _hvncat type promoters +_typed_hvncat(::Type{T}, ::Val) where T = Vector{T}() +_typed_hvncat(T::Type, ::Val{N}, xs::Number...) where N = _typed_hvncat(T, (ntuple(x -> 1, N - 1)..., length(xs)), false, xs...) +function _typed_hvncat(::Type{T}, ::Val{N}, as::AbstractArray...) where {T, N} + # optimization for arrays that can be concatenated by copying them linearly into the destination + # conditions: the elements must all have 1- or 0-length dimensions above N + @inbounds for a ∈ as + ndims(a) <= N || all(x -> size(a, x) == 1, (N + 1):ndims(a)) || + return _typed_hvncat(T, (ntuple(x -> 1, N - 1)..., length(as)), false, as...) + end + + nd = max(N, ndims(as[1])) + + Ndim = 0 + @inbounds for i ∈ 1:lastindex(as) + Ndim += cat_size(as[i], N) + for d ∈ 1:N - 1 + cat_size(as[1], d) == cat_size(as[i], d) || throw(ArgumentError("mismatched size along axis $d in element $i")) + end + end + + @inbounds A = Array{T, nd}(undef, ntuple(d -> cat_size(as[1], d), N - 1)..., Ndim, ntuple(x -> 1, nd - N)...) + k = 1 + @inbounds for a ∈ as + for i ∈ eachindex(a) + A[k] = a[i] + k += 1 + end + end + return A +end + +cat_ndims(a) = 0 +cat_ndims(a::AbstractArray) = ndims(a) + +function _typed_hvncat(::Type{T}, ::Val{N}, as...) where {T, N} + # optimization for scalars and 1-length arrays that can be concatenated by copying them linearly + # into the destination + nd = N + Ndim = 0 + @inbounds for a ∈ as + if a isa AbstractArray + cat_size(a, N) == length(a) || + throw(ArgumentError("all dimensions of elements other than $N must be of length 1")) + nd = max(nd, cat_ndims(a)) + end + Ndim += cat_size(a, N) + end + + @inbounds A = Array{T, nd}(undef, ntuple(x -> 1, N - 1)..., Ndim, ntuple(x -> 1, nd - N)...) + + k = 1 + @inbounds for a ∈ as + if a isa AbstractArray + lena = length(a) + copyto!(A, k, a, 1, lena) + k += lena + else + A[k] = a + k += 1 + end + end + return A +end + +function _typed_hvncat(::Type{T}, dims::Tuple{Vararg{Int, N}}, row_first::Bool, as...) where {T, N} + d1 = row_first ? 2 : 1 + d2 = row_first ? 1 : 2 + + # discover dimensions + @inbounds nd = max(N, cat_ndims(as[1])) + outdims = zeros(Int, nd) + + # discover number of rows or columns + @inbounds for i ∈ 1:dims[d1] + outdims[d1] += cat_size(as[i], d1) + end + + currentdims = zeros(Int, nd) + blockcount = 0 + @inbounds for i ∈ eachindex(as) + currentdims[d1] += cat_size(as[i], d1) + if currentdims[d1] == outdims[d1] + currentdims[d1] = 0 + for d ∈ (d2, 3:nd...) + currentdims[d] += cat_size(as[i], d) + if outdims[d] == 0 # unfixed dimension + blockcount += 1 + if blockcount == (d > length(dims) ? 1 : dims[d]) # last expected member of dimension + outdims[d] = currentdims[d] + currentdims[d] = 0 + blockcount = 0 + else + break + end + else # fixed dimension + if currentdims[d] == outdims[d] # end of dimension + currentdims[d] = 0 + elseif currentdims[d] < outdims[d] # dimension in progress + break + else # exceeded dimension + ArgumentError("argument $i has too many elements along axis $d") |> throw + end + end + end + elseif currentdims[d1] > outdims[d1] # exceeded dimension + ArgumentError("argument $i has too many elements along axis $d1") |> throw + end + end + + # calling sum() leads to 3 extra allocations + len = 0 + for a ∈ as + len += cat_length(a) + end + outlen = prod(outdims) + outlen == 0 && ArgumentError("too few elements in arguments, unable to infer dimensions") |> throw + len == outlen || ArgumentError("too many elements in arguments; expected $(outlen), got $(len)") |> throw + + # copy into final array + A = Array{T, nd}(undef, outdims...) + # @assert all(==(0), currentdims) + outdims .= 0 + hvncat_fill!(A, currentdims, outdims, d1, d2, as) + return A +end + +function _typed_hvncat(::Type{T}, shape::Tuple{Vararg{Tuple, N}}, row_first::Bool, as...) where {T, N} + d1 = row_first ? 2 : 1 + d2 = row_first ? 1 : 2 + shape = collect(shape) # saves allocations later + @inbounds shapelength = shape[end][1] + lengthas = length(as) + shapelength == lengthas || throw(ArgumentError("number of elements does not match shape; expected $(shapelength), got $lengthas)")) + + # discover dimensions + @inbounds nd = max(N, cat_ndims(as[1])) + outdims = zeros(Int, nd) + currentdims = zeros(Int, nd) + blockcounts = zeros(Int, nd) + shapepos = ones(Int, nd) + + @inbounds for i ∈ eachindex(as) + wasstartblock = false + for d ∈ 1:N + ad = (d < 3 && row_first) ? (d == 1 ? 2 : 1) : d + dsize = cat_size(as[i], ad) + blockcounts[d] += 1 + + if d == 1 || i == 1 || wasstartblock + currentdims[d] += dsize + elseif dsize != cat_size(as[i - 1], ad) + ArgumentError("argument $i has a mismatched number of elements along axis $ad; expected $(cat_size(as[i - 1], ad)), got $dsize") |> throw + end + + wasstartblock = blockcounts[d] == 1 # remember for next dimension + + isendblock = blockcounts[d] == shape[d][shapepos[d]] + if isendblock + if outdims[d] == 0 + outdims[d] = currentdims[d] + elseif outdims[d] != currentdims[d] + ArgumentError("argument $i has a mismatched number of elements along axis $ad; expected $(abs(outdims[d] - (currentdims[d] - dsize))), got $dsize") |> throw + end + currentdims[d] = 0 + blockcounts[d] = 0 + shapepos[d] += 1 + end + end + end + + if row_first + @inbounds outdims[1], outdims[2] = outdims[2], outdims[1] + end + + # @assert all(==(0), currentdims) + # @assert all(==(0), blockcounts) + + # copy into final array + A = Array{T, nd}(undef, outdims...) + hvncat_fill!(A, currentdims, blockcounts, d1, d2, as) + return A +end + +@inline function hvncat_fill!(A::Array{T, N}, scratch1::Vector{Int}, scratch2::Vector{Int}, d1::Int, d2::Int, as::Tuple{Vararg}) where {T, N} + outdims = size(A) + offsets = scratch1 + inneroffsets = scratch2 + @inbounds for a ∈ as + if isa(a, AbstractArray) + for ai ∈ a + Ai = hvncat_calcindex(offsets, inneroffsets, outdims, N) + A[Ai] = ai + + for j ∈ 1:N + inneroffsets[j] += 1 + inneroffsets[j] < cat_size(a, j) && break + inneroffsets[j] = 0 + end + end + else + Ai = hvncat_calcindex(offsets, inneroffsets, outdims, N) + A[Ai] = a + end + + for j ∈ (d1, d2, 3:N...) + offsets[j] += cat_size(a, j) + offsets[j] < outdims[j] && break + offsets[j] = 0 + end + end +end + +@propagate_inbounds function hvncat_calcindex(offsets::Vector{Int}, inneroffsets::Vector{Int}, + outdims::Tuple{Vararg{Int}}, nd::Int) + Ai = inneroffsets[1] + offsets[1] + 1 + for j ∈ 2:nd + increment = inneroffsets[j] + offsets[j] + for k ∈ 1:j-1 + increment *= outdims[k] + end + Ai += increment + end + Ai +end + +cat_length(a::AbstractArray) = length(a) +cat_length(::Any) = 1 + ## Reductions and accumulates ## function isequal(A::AbstractArray, B::AbstractArray) diff --git a/base/abstractarraymath.jl b/base/abstractarraymath.jl index fc1adf90d7d6e7..4dd24214a63fcb 100644 --- a/base/abstractarraymath.jl +++ b/base/abstractarraymath.jl @@ -88,13 +88,8 @@ function _dropdims(A::AbstractArray, dims::Dims) dims[j] == dims[i] && throw(ArgumentError("dropped dims must be unique")) end end - d = () - for i = 1:ndims(A) - if !in(i, dims) - d = tuple(d..., axes(A, i)) - end - end - reshape(A, d::typeof(_sub(axes(A), dims))) + ax = _foldoneto((ds, d) -> d in dims ? ds : (ds..., axes(A,d)), (), Val(ndims(A))) + reshape(A, ax::typeof(_sub(axes(A), dims))) end _dropdims(A::AbstractArray, dim::Integer) = _dropdims(A, (Int(dim),)) diff --git a/base/array.jl b/base/array.jl index 6e5b9b148a0435..9c522855957fe1 100644 --- a/base/array.jl +++ b/base/array.jl @@ -965,7 +965,7 @@ function push!(a::Array{T,1}, item) where T # convert first so we don't grow the array if the assignment won't work itemT = convert(T, item) _growend!(a, 1) - a[end] = itemT + @inbounds a[end] = itemT return a end diff --git a/base/arrayshow.jl b/base/arrayshow.jl index f942f877874844..1e9f3e59729e6b 100644 --- a/base/arrayshow.jl +++ b/base/arrayshow.jl @@ -271,17 +271,21 @@ end # typeinfo agnostic # n-dimensional arrays -show_nd(io::IO, a::AbstractArray, print_matrix::Function, label_slices::Bool) = - _show_nd(io, inferencebarrier(a), print_matrix, label_slices, map(unitrange, axes(a))) +show_nd(io::IO, a::AbstractArray, print_matrix::Function, show_full::Bool) = + _show_nd(io, inferencebarrier(a), print_matrix, show_full, map(unitrange, axes(a))) -function _show_nd(io::IO, @nospecialize(a::AbstractArray), print_matrix::Function, label_slices::Bool, axs::Tuple{Vararg{AbstractUnitRange}}) +function _show_nd(io::IO, @nospecialize(a::AbstractArray), print_matrix::Function, show_full::Bool, axs::Tuple{Vararg{AbstractUnitRange}}) limit::Bool = get(io, :limit, false) if isempty(a) return end tailinds = tail(tail(axs)) nd = ndims(a)-2 - for I in CartesianIndices(tailinds) + show_full || print(io, "[") + Is = CartesianIndices(tailinds) + lastidxs = first(Is).I + reached_last_d = false + for I in Is idxs = I.I if limit for i = 1:nd @@ -296,7 +300,9 @@ function _show_nd(io::IO, @nospecialize(a::AbstractArray), print_matrix::Functio @goto skip end end - print(io, "...\n\n") + print(io, ";"^(i+2)) + print(io, " \u2026 ") + show_full && print(io, "\n\n") @goto skip end if ind[firstindex(ind)+2] < ii <= ind[end-3] @@ -305,13 +311,29 @@ function _show_nd(io::IO, @nospecialize(a::AbstractArray), print_matrix::Functio end end end - if label_slices + if show_full _show_nd_label(io, a, idxs) end slice = view(a, axs[1], axs[2], idxs...) - print_matrix(io, slice) - print(io, idxs == map(last,tailinds) ? "" : "\n\n") + if show_full + print_matrix(io, slice) + print(io, idxs == map(last,tailinds) ? "" : "\n\n") + else + idxdiff = lastidxs .- idxs .< 0 + if any(idxdiff) + lastchangeindex = 2 + findlast(idxdiff) + print(io, ";"^lastchangeindex) + lastchangeindex == ndims(a) && (reached_last_d = true) + print(io, " ") + end + print_matrix(io, slice) + end @label skip + lastidxs = idxs + end + if !show_full + reached_last_d || print(io, ";"^(nd+2)) + print(io, "]") end end @@ -386,9 +408,9 @@ end preceded by `prefix`, supposed to encode the type of the elements. """ _show_nonempty(io::IO, X::AbstractMatrix, prefix::String) = - _show_nonempty(io, inferencebarrier(X), prefix, axes(X)) + _show_nonempty(io, inferencebarrier(X), prefix, false, axes(X)) -function _show_nonempty(io::IO, @nospecialize(X::AbstractMatrix), prefix::String, axs::Tuple{AbstractUnitRange,AbstractUnitRange}) +function _show_nonempty(io::IO, @nospecialize(X::AbstractMatrix), prefix::String, drop_brackets::Bool, axs::Tuple{AbstractUnitRange,AbstractUnitRange}) @assert !isempty(X) limit = get(io, :limit, false)::Bool indr, indc = axs @@ -407,7 +429,7 @@ function _show_nonempty(io::IO, @nospecialize(X::AbstractMatrix), prefix::String cdots = true end end - print(io, prefix, "[") + drop_brackets || print(io, prefix, "[") for rr in (rr1, rr2) for i in rr for cr in (cr1, cr2) @@ -429,12 +451,16 @@ function _show_nonempty(io::IO, @nospecialize(X::AbstractMatrix), prefix::String end last(rr) != last(indr) && rdots && print(io, "\u2026 ; ") end - print(io, "]") + if !drop_brackets + nc > 1 || print(io, ";;") + print(io, "]") + end + return nothing end _show_nonempty(io::IO, X::AbstractArray, prefix::String) = - show_nd(io, X, (io, slice) -> _show_nonempty(io, slice, prefix), false) + show_nd(io, X, (io, slice) -> _show_nonempty(io, inferencebarrier(slice), prefix, true, axes(slice)), false) # a specific call path is used to show vectors (show_vector) _show_nonempty(::IO, ::AbstractVector, ::String) = diff --git a/base/broadcast.jl b/base/broadcast.jl index 4c3f91c50638fc..d7546643220ba3 100644 --- a/base/broadcast.jl +++ b/base/broadcast.jl @@ -699,7 +699,7 @@ Base.RefValue{String}("hello") """ broadcastable(x::Union{Symbol,AbstractString,Function,UndefInitializer,Nothing,RoundingMode,Missing,Val,Ptr,AbstractPattern,Pair}) = Ref(x) broadcastable(::Type{T}) where {T} = Ref{Type{T}}(T) -broadcastable(x::Union{AbstractArray,Number,Ref,Tuple,Broadcasted}) = x +broadcastable(x::Union{AbstractArray,Number,Char,Ref,Tuple,Broadcasted}) = x # Default to collecting iterables — which will error for non-iterables broadcastable(x) = collect(x) broadcastable(::Union{AbstractDict, NamedTuple}) = throw(ArgumentError("broadcasting over dictionaries and `NamedTuple`s is reserved")) @@ -1153,15 +1153,20 @@ broadcasted(::DefaultArrayStyle{1}, ::typeof(-), r::LinRange, x::Number) = LinRa broadcasted(::DefaultArrayStyle{1}, ::typeof(-), x::Number, r::LinRange) = LinRange(x - r.start, x - r.stop, length(r)) broadcasted(::DefaultArrayStyle{1}, ::typeof(-), r1::AbstractRange, r2::AbstractRange) = r1 - r2 -broadcasted(::DefaultArrayStyle{1}, ::typeof(*), x::Number, r::AbstractRange) = range(x*first(r), step=x*step(r), length=length(r)) +# at present Base.range_start_step_length(1,0,5) is an error, so for 0 .* (-2:2) we explicitly construct StepRangeLen: +broadcasted(::DefaultArrayStyle{1}, ::typeof(*), x::Number, r::AbstractRange) = StepRangeLen(x*first(r), x*step(r), length(r)) broadcasted(::DefaultArrayStyle{1}, ::typeof(*), x::Number, r::StepRangeLen{T}) where {T} = StepRangeLen{typeof(x*T(r.ref))}(x*r.ref, x*r.step, length(r), r.offset) broadcasted(::DefaultArrayStyle{1}, ::typeof(*), x::Number, r::LinRange) = LinRange(x * r.start, x * r.stop, r.len) -# separate in case of noncommutative multiplication -broadcasted(::DefaultArrayStyle{1}, ::typeof(*), r::AbstractRange, x::Number) = range(first(r)*x, step=step(r)*x, length=length(r)) +broadcasted(::DefaultArrayStyle{1}, ::typeof(*), x::AbstractFloat, r::OrdinalRange) = + Base.range_start_step_length(x*first(r), x*step(r), length(r)) # 0.2 .* (-2:2) needs TwicePrecision +# separate in case of noncommutative multiplication: +broadcasted(::DefaultArrayStyle{1}, ::typeof(*), r::AbstractRange, x::Number) = StepRangeLen(first(r)*x, step(r)*x, length(r)) broadcasted(::DefaultArrayStyle{1}, ::typeof(*), r::StepRangeLen{T}, x::Number) where {T} = StepRangeLen{typeof(T(r.ref)*x)}(r.ref*x, r.step*x, length(r), r.offset) broadcasted(::DefaultArrayStyle{1}, ::typeof(*), r::LinRange, x::Number) = LinRange(r.start * x, r.stop * x, r.len) +broadcasted(::DefaultArrayStyle{1}, ::typeof(*), r::OrdinalRange, x::AbstractFloat) = + Base.range_start_step_length(first(r)*x, step(r)*x, length(r)) broadcasted(::DefaultArrayStyle{1}, ::typeof(/), r::AbstractRange, x::Number) = range(first(r)/x, step=step(r)/x, length=length(r)) broadcasted(::DefaultArrayStyle{1}, ::typeof(/), r::StepRangeLen{T}, x::Number) where {T} = diff --git a/base/client.jl b/base/client.jl index d9df2f04922dd8..7e5f1ab5c5d58e 100644 --- a/base/client.jl +++ b/base/client.jl @@ -98,13 +98,13 @@ function display_error(io::IO, er, bt) showerror(IOContext(io, :limit => true), er, bt, backtrace = bt!==nothing) println(io) end -function display_error(io::IO, stack::Vector) +function display_error(io::IO, stack::ExceptionStack) printstyled(io, "ERROR: "; bold=true, color=Base.error_color()) bt = Any[ (x[1], scrub_repl_backtrace(x[2])) for x in stack ] show_exception_stack(IOContext(io, :limit => true), bt) println(io) end -display_error(stack::Vector) = display_error(stderr, stack) +display_error(stack::ExceptionStack) = display_error(stderr, stack) display_error(er, bt=nothing) = display_error(stderr, er, bt) function eval_user_input(errio, @nospecialize(ast), show_value::Bool) @@ -143,7 +143,7 @@ function eval_user_input(errio, @nospecialize(ast), show_value::Bool) @error "SYSTEM: display_error(errio, lasterr) caused an error" end errcount += 1 - lasterr = catch_stack() + lasterr = current_exceptions() if errcount > 2 @error "It is likely that something important is broken, and Julia will not be able to continue normally" errcount break @@ -257,7 +257,7 @@ function exec_options(opts) try load_julia_startup() catch - invokelatest(display_error, catch_stack()) + invokelatest(display_error, current_exceptions()) !(repl || is_interactive) && exit(1) end end @@ -291,7 +291,7 @@ function exec_options(opts) try include(Main, PROGRAM_FILE) catch - invokelatest(display_error, catch_stack()) + invokelatest(display_error, current_exceptions()) if !is_interactive::Bool exit(1) end @@ -494,7 +494,7 @@ function _start() try exec_options(JLOptions()) catch - invokelatest(display_error, catch_stack()) + invokelatest(display_error, current_exceptions()) exit(1) end if is_interactive && get(stdout, :color, false) diff --git a/base/cmd.jl b/base/cmd.jl index 0d66cb932a04ae..93138ed6b459b7 100644 --- a/base/cmd.jl +++ b/base/cmd.jl @@ -165,6 +165,7 @@ rawhandle(x::OS_HANDLE) = x if OS_HANDLE !== RawFD rawhandle(x::RawFD) = Libc._get_osfhandle(x) end +setup_stdio(stdio::Union{DevNull,OS_HANDLE,RawFD}, ::Bool) = (stdio, false) const Redirectable = Union{IO, FileRedirect, RawFD, OS_HANDLE} const StdIOSet = NTuple{3, Redirectable} diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 9b7434c0a5a459..465948c610c42d 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -184,7 +184,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), end condval = maybe_extract_const_bool(this_conditional) for i = 1:length(argtypes) - fargs[i] isa Slot || continue + fargs[i] isa SlotNumber || continue if this_conditional isa InterConditional && this_conditional.slot == i vtype = this_conditional.vtype elsetype = this_conditional.elsetype @@ -222,7 +222,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), # find the first argument which supports refinment, # and intersect all equvalent arguments with it arg = fargs[i] - arg isa Slot || continue # can't refine + arg isa SlotNumber || continue # can't refine old = argtypes[i] old isa Type || continue # unlikely to refine id = slot_id(arg) @@ -284,9 +284,6 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), return CallMeta(rettype, info) end -widenwrappedconditional(@nospecialize(typ)) = widenconditional(typ) -widenwrappedconditional(typ::LimitedAccuracy) = LimitedAccuracy(widenconditional(typ.typ), typ.causes) - function add_call_backedges!(interp::AbstractInterpreter, @nospecialize(rettype), edges::Vector{MethodInstance}, @@ -983,10 +980,10 @@ function abstract_call_builtin(interp::AbstractInterpreter, f::Builtin, fargs::U # try to simulate this as a real conditional (`cnd ? x : y`), so that the penalty for using `ifelse` instead isn't too high a = ssa_def_slot(fargs[3], sv) b = ssa_def_slot(fargs[4], sv) - if isa(a, Slot) && slot_id(cnd.var) == slot_id(a) + if isa(a, SlotNumber) && slot_id(cnd.var) == slot_id(a) tx = (cnd.vtype ⊑ tx ? cnd.vtype : tmeet(tx, widenconst(cnd.vtype))) end - if isa(b, Slot) && slot_id(cnd.var) == slot_id(b) + if isa(b, SlotNumber) && slot_id(cnd.var) == slot_id(b) ty = (cnd.elsetype ⊑ ty ? cnd.elsetype : tmeet(ty, widenconst(cnd.elsetype))) end return tmerge(tx, ty) @@ -1007,7 +1004,7 @@ function abstract_call_builtin(interp::AbstractInterpreter, f::Builtin, fargs::U # perform very limited back-propagation of type information for `is` and `isa` if f === isa a = ssa_def_slot(fargs[2], sv) - if isa(a, Slot) + if isa(a, SlotNumber) aty = widenconst(argtypes[2]) if rt === Const(false) return Conditional(a, Union{}, aty) @@ -1030,7 +1027,7 @@ function abstract_call_builtin(interp::AbstractInterpreter, f::Builtin, fargs::U aty = argtypes[2] bty = argtypes[3] # if doing a comparison to a singleton, consider returning a `Conditional` instead - if isa(aty, Const) && isa(b, Slot) + if isa(aty, Const) && isa(b, SlotNumber) if rt === Const(false) aty = Union{} elseif rt === Const(true) @@ -1040,7 +1037,7 @@ function abstract_call_builtin(interp::AbstractInterpreter, f::Builtin, fargs::U end return Conditional(b, aty, bty) end - if isa(bty, Const) && isa(a, Slot) + if isa(bty, Const) && isa(a, SlotNumber) if rt === Const(false) bty = Union{} elseif rt === Const(true) @@ -1051,10 +1048,10 @@ function abstract_call_builtin(interp::AbstractInterpreter, f::Builtin, fargs::U return Conditional(a, bty, aty) end # narrow the lattice slightly (noting the dependency on one of the slots), to promote more effective smerge - if isa(b, Slot) + if isa(b, SlotNumber) return Conditional(b, rt === Const(false) ? Union{} : bty, rt === Const(true) ? Union{} : bty) end - if isa(a, Slot) + if isa(a, SlotNumber) return Conditional(a, rt === Const(false) ? Union{} : aty, rt === Const(true) ? Union{} : aty) end elseif f === Core.Compiler.not_int @@ -1128,7 +1125,7 @@ function abstract_invoke(interp::AbstractInterpreter, argtypes::Vector{Any}, sv: end method, valid_worlds = result update_valid_age!(sv, valid_worlds) - (ti, env) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), nargtype, method.sig)::SimpleVector + (ti, env::SimpleVector) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), nargtype, method.sig)::SimpleVector rt, edge = typeinf_edge(interp, method, ti, env, sv) edge !== nothing && add_backedge!(edge::MethodInstance, sv) return CallMeta(rt, InvokeCallInfo(MethodMatch(ti, env, method, argtype <: method.sig))) @@ -1358,7 +1355,7 @@ function abstract_eval_special_value(interp::AbstractInterpreter, @nospecialize( return Const((e::QuoteNode).value) elseif isa(e, SSAValue) return abstract_eval_ssavalue(e::SSAValue, sv.src) - elseif isa(e, Slot) || isa(e, Argument) + elseif isa(e, SlotNumber) || isa(e, Argument) return (vtypes[slot_id(e)]::VarState).typ elseif isa(e, GlobalRef) return abstract_eval_global(e.mod, e.name) @@ -1410,7 +1407,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), end elseif e.head === :new t = instanceof_tfunc(abstract_eval_value(interp, e.args[1], vtypes, sv))[1] - if isconcretetype(t) && !t.mutable + if isconcretetype(t) && !t.name.mutable args = Vector{Any}(undef, length(e.args)-1) ats = Vector{Any}(undef, length(e.args)-1) anyconst = false @@ -1447,7 +1444,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), end elseif e.head === :splatnew t = instanceof_tfunc(abstract_eval_value(interp, e.args[1], vtypes, sv))[1] - if length(e.args) == 2 && isconcretetype(t) && !t.mutable + if length(e.args) == 2 && isconcretetype(t) && !t.name.mutable at = abstract_eval_value(interp, e.args[2], vtypes, sv) n = fieldcount(t) if isa(at, Const) && isa(at.val, Tuple) && n == length(at.val) && @@ -1502,7 +1499,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), elseif e.head === :isdefined sym = e.args[1] t = Bool - if isa(sym, Slot) + if isa(sym, SlotNumber) vtyp = vtypes[slot_id(sym)] if vtyp.typ === Bottom t = Const(false) # never assigned previously @@ -1634,7 +1631,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) @assert !frame.inferred frame.dont_work_on_me = true # mark that this function is currently on the stack W = frame.ip - s = frame.stmt_types + states = frame.stmt_types n = frame.nstmts nargs = frame.nargs def = frame.linfo.def @@ -1659,7 +1656,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) edges === nothing || empty!(edges) frame.stmt_info[pc] = nothing stmt = frame.src.code[pc] - changes = s[pc]::VarTable + changes = states[pc]::VarTable t = nothing hd = isa(stmt, Expr) ? stmt.head : nothing @@ -1670,13 +1667,17 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) elseif isa(stmt, GotoNode) pc´ = (stmt::GotoNode).label elseif isa(stmt, GotoIfNot) - condt = abstract_eval_value(interp, stmt.cond, changes, frame) + condx = stmt.cond + condt = abstract_eval_value(interp, condx, changes, frame) if condt === Bottom empty!(frame.pclimitations) - end - if condt === Bottom break end + if !(isa(condt, Const) || isa(condt, Conditional)) && isa(condx, SlotNumber) + # if this non-`Conditional` object is a slot, we form and propagate + # the conditional constraint on it + condt = Conditional(condx, Const(true), Const(false)) + end condval = maybe_extract_const_bool(condt) l = stmt.dest::Int if !isempty(frame.pclimitations) @@ -1698,14 +1699,14 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) changes_else = conditional_changes(changes_else, condt.elsetype, condt.var) changes = conditional_changes(changes, condt.vtype, condt.var) end - newstate_else = stupdate!(s[l], changes_else) + newstate_else = stupdate!(states[l], changes_else) if newstate_else !== nothing # add else branch to active IP list if l < frame.pc´´ frame.pc´´ = l end push!(W, l) - s[l] = newstate_else + states[l] = newstate_else end end elseif isa(stmt, ReturnNode) @@ -1753,16 +1754,16 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) l = stmt.args[1]::Int frame.cur_hand = Pair{Any,Any}(l, frame.cur_hand) # propagate type info to exception handler - old = s[l] + old = states[l] newstate_catch = stupdate!(old, changes) if newstate_catch !== nothing if l < frame.pc´´ frame.pc´´ = l end push!(W, l) - s[l] = newstate_catch + states[l] = newstate_catch end - typeassert(s[l], VarTable) + typeassert(states[l], VarTable) frame.handler_at[l] = frame.cur_hand elseif hd === :leave for i = 1:((stmt.args[1])::Int) @@ -1776,12 +1777,12 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) end frame.src.ssavaluetypes[pc] = t lhs = stmt.args[1] - if isa(lhs, Slot) + if isa(lhs, SlotNumber) changes = StateUpdate(lhs, VarState(t, false), changes, false) end elseif hd === :method fname = stmt.args[1] - if isa(fname, Slot) + if isa(fname, SlotNumber) changes = StateUpdate(fname, VarState(Any, false), changes, false) end elseif hd === :inbounds || hd === :meta || hd === :loopinfo || hd === :code_coverage_effect @@ -1802,7 +1803,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) # the handling for Expr(:enter) propagates all changes from before the try/catch # so this only needs to propagate any changes l = frame.cur_hand.first::Int - if stupdate1!(s[l]::VarTable, changes::StateUpdate) !== false + if stupdate1!(states[l]::VarTable, changes::StateUpdate) !== false if l < frame.pc´´ frame.pc´´ = l end @@ -1820,19 +1821,19 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) pc´ > n && break # can't proceed with the fast-path fall-through frame.handler_at[pc´] = frame.cur_hand - newstate = stupdate!(s[pc´], changes) + newstate = stupdate!(states[pc´], changes) if isa(stmt, GotoNode) && frame.pc´´ < pc´ # if we are processing a goto node anyways, # (such as a terminator for a loop, if-else, or try block), # consider whether we should jump to an older backedge first, # to try to traverse the statements in approximate dominator order if newstate !== nothing - s[pc´] = newstate + states[pc´] = newstate end push!(W, pc´) pc = frame.pc´´ elseif newstate !== nothing - s[pc´] = newstate + states[pc´] = newstate pc = pc´ elseif pc´ in W pc = pc´ @@ -1845,8 +1846,13 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) nothing end -function conditional_changes(changes::VarTable, @nospecialize(typ), var::Slot) - if typ ⊑ (changes[slot_id(var)]::VarState).typ +function conditional_changes(changes::VarTable, @nospecialize(typ), var::SlotNumber) + oldtyp = (changes[slot_id(var)]::VarState).typ + # approximate test for `typ ∩ oldtyp` being better than `oldtyp` + # since we probably formed these types with `typesubstract`, the comparison is likely simple + if ignorelimited(typ) ⊑ ignorelimited(oldtyp) + # typ is better unlimited, but we may still need to compute the tmeet with the limit "causes" since we ignored those in the comparison + oldtyp isa LimitedAccuracy && (typ = tmerge(typ, LimitedAccuracy(Bottom, oldtyp.causes))) return StateUpdate(var, VarState(typ, false), changes, true) end return changes diff --git a/base/compiler/ssair/passes.jl b/base/compiler/ssair/passes.jl index f27c71c2bcd6c6..114b8c6033615d 100644 --- a/base/compiler/ssair/passes.jl +++ b/base/compiler/ssair/passes.jl @@ -328,8 +328,8 @@ function lift_leaves(compact::IncrementalCompact, @nospecialize(stmt), if isa(typ, UnionAll) typ = unwrap_unionall(typ) end - (isa(typ, DataType) && (!typ.abstract)) || return nothing - @assert !typ.mutable + (isa(typ, DataType) && (!typ.name.abstract)) || return nothing + @assert !typ.name.mutable if length(def.args) < 1 + field if field > fieldcount(typ) return nothing @@ -625,7 +625,7 @@ function getfield_elim_pass!(ir::IRCode) if isa(typ, UnionAll) typ = unwrap_unionall(typ) end - if typ isa DataType && !typ.mutable + if typ isa DataType && !typ.name.mutable process_immutable_preserve(new_preserves, compact, def) old_preserves[pidx] = nothing continue @@ -662,7 +662,7 @@ function getfield_elim_pass!(ir::IRCode) def, typeconstraint = stmt.args[2], struct_typ - if struct_typ.mutable + if struct_typ.name.mutable isa(def, SSAValue) || continue let intermediaries = IdSet() callback = function(@nospecialize(pi), ssa::AnySSAValue) @@ -775,7 +775,7 @@ function getfield_elim_pass!(ir::IRCode) end # Could still end up here if we tried to setfield! and immutable, which would # error at runtime, but is not illegal to have in the IR. - typ.mutable || continue + typ.name.mutable || continue # Partition defuses by field fielddefuse = SSADefUse[SSADefUse() for _ = 1:fieldcount(typ)] ok = true diff --git a/base/compiler/ssair/show.jl b/base/compiler/ssair/show.jl index 72f17e5505324b..1f1c838c62ae76 100644 --- a/base/compiler/ssair/show.jl +++ b/base/compiler/ssair/show.jl @@ -455,7 +455,7 @@ function DILineInfoPrinter(linetable::Vector, showtypes::Bool=false) if frame.line != typemax(frame.line) && frame.line != 0 print(io, ":", frame.line) end - print(io, " within `", method_name(frame), "'") + print(io, " within `", method_name(frame), "`") if collapse method = method_name(frame) while nctx < nframes @@ -712,48 +712,6 @@ end _strip_color(s::String) = replace(s, r"\e\[\d+m" => "") -# corresponds to `verbose_linetable=true` -function ircode_verbose_linfo_printer(code::IRCode) - stmts = code.stmts - max_depth = maximum(compute_inlining_depth(code.linetable, stmts[i][:line]) for i in 1:length(stmts.line)) - last_stack = Ref(Int[]) - used = stmts_used(code, false) - maxlength_idx = if isempty(used) - 0 - else - maxused = maximum(used) - length(string(maxused)) - end - - function (io::IO, indent::String, idx::Int) - idx == 0 && return "" - cols = (displaysize(io)::Tuple{Int,Int})[2] - stmt = stmts[idx] - - stack = compute_loc_stack(code.linetable, stmt[:line]) - # We need to print any stack frames that did not exist in the last stack - ndepth = max(1, length(stack)) - rail = string(" "^(max_depth+1-ndepth), "│"^ndepth) - start_column = cols - max_depth - 10 - for (i, x) in enumerate(stack) - if i > length(last_stack[]) || last_stack[][i] != x - entry = code.linetable[x] - printstyled(io, "\e[$(start_column)G$(rail)\e[1G", color = :light_black) - print(io, indent) - ssa_guard = " "^(maxlength_idx + 4 + i) - entry_label = "$(ssa_guard)$(method_name(entry)) at $(entry.file):$(entry.line) " - width_hline = start_column - length(entry_label) - length(_strip_color(indent)) + max_depth - i - width_hline = max(width_hline, 0) # don't error on overlong method/file names - hline = string("─"^width_hline, "┐") - printstyled(io, string(entry_label, hline), "\n"; color=:light_black) - end - end - last_stack[] = stack - printstyled(io, "\e[$(start_column)G$(rail)\e[1G", color = :light_black) - return "" - end -end - function statementidx_lineinfo_printer(f, code::IRCode) printer = f(code.linetable) function (io::IO, indent::String, idx::Int) @@ -796,7 +754,7 @@ function stmts_used(code::CodeInfo) end function default_config(code::IRCode; verbose_linetable=false) - return IRShowConfig(verbose_linetable ? ircode_verbose_linfo_printer(code) + return IRShowConfig(verbose_linetable ? statementidx_lineinfo_printer(code) : inline_linfo_printer(code); bb_color=:normal) end diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 214087781a44f4..25631d9594c981 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -28,15 +28,17 @@ const DATATYPE_NAME_FIELDINDEX = fieldindex(DataType, :name) const DATATYPE_PARAMETERS_FIELDINDEX = fieldindex(DataType, :parameters) const DATATYPE_TYPES_FIELDINDEX = fieldindex(DataType, :types) const DATATYPE_SUPER_FIELDINDEX = fieldindex(DataType, :super) -const DATATYPE_MUTABLE_FIELDINDEX = fieldindex(DataType, :mutable) const DATATYPE_INSTANCE_FIELDINDEX = fieldindex(DataType, :instance) -const DATATYPE_ABSTRACT_FIELDINDEX = fieldindex(DataType, :abstract) const DATATYPE_NAMES_FIELDINDEX = fieldindex(DataType, :names) +const DATATYPE_HASH_FIELDINDEX = fieldindex(DataType, :hash) const TYPENAME_NAME_FIELDINDEX = fieldindex(Core.TypeName, :name) const TYPENAME_MODULE_FIELDINDEX = fieldindex(Core.TypeName, :module) const TYPENAME_NAMES_FIELDINDEX = fieldindex(Core.TypeName, :names) const TYPENAME_WRAPPER_FIELDINDEX = fieldindex(Core.TypeName, :wrapper) +const TYPENAME_MUTABLE_FIELDINDEX = fieldindex(Core.TypeName, :mutable) +const TYPENAME_ABSTRACT_FIELDINDEX = fieldindex(Core.TypeName, :abstract) +const TYPENAME_HASH_FIELDINDEX = fieldindex(Core.TypeName, :hash) ########## # tfuncs # @@ -88,7 +90,7 @@ function instanceof_tfunc(@nospecialize(t)) # a real instance must be within the declared bounds of the type, # so we can intersect with the original wrapper. tr = typeintersect(tr, t′′.name.wrapper) - isconcrete = !t′′.abstract + isconcrete = !t′′.name.abstract if tr === Union{} # runtime unreachable (our inference Type{T} where S is # uninhabited with any runtime T that exists) @@ -271,7 +273,7 @@ function isdefined_tfunc(@nospecialize(arg1), @nospecialize(sym)) return Bool end a1 = unwrap_unionall(a1) - if isa(a1, DataType) && !a1.abstract + if isa(a1, DataType) && !a1.name.abstract if a1 === Module Symbol <: widenconst(sym) || return Bottom if isa(sym, Const) && isa(sym.val, Symbol) && isa(arg1, Const) && isdefined(arg1.val, sym.val) @@ -404,7 +406,7 @@ function nfields_tfunc(@nospecialize(x)) isa(x, Conditional) && return Const(0) x = unwrap_unionall(widenconst(x)) isconstType(x) && return Const(nfields(x.parameters[1])) - if isa(x, DataType) && !x.abstract + if isa(x, DataType) && !x.name.abstract if !(x.name === Tuple.name && isvatuple(x)) && !(x.name === _NAMEDTUPLE_NAME && !isconcretetype(x)) return Const(isdefined(x, :types) ? length(x.types) : length(x.name.names)) @@ -529,7 +531,7 @@ function typeof_tfunc(@nospecialize(t)) return typeof_tfunc(t.ub) elseif isa(t, UnionAll) u = unwrap_unionall(t) - if isa(u, DataType) && !u.abstract + if isa(u, DataType) && !u.name.abstract if u.name === Tuple.name uu = typeof_concrete_vararg(u) if uu !== nothing @@ -612,10 +614,9 @@ is_dt_const_field(fld::Int) = ( fld == DATATYPE_PARAMETERS_FIELDINDEX || fld == DATATYPE_TYPES_FIELDINDEX || fld == DATATYPE_SUPER_FIELDINDEX || - fld == DATATYPE_MUTABLE_FIELDINDEX || fld == DATATYPE_INSTANCE_FIELDINDEX || fld == DATATYPE_NAMES_FIELDINDEX || - fld == DATATYPE_ABSTRACT_FIELDINDEX + fld == DATATYPE_HASH_FIELDINDEX ) function const_datatype_getfield_tfunc(@nospecialize(sv), fld::Int) if fld == DATATYPE_INSTANCE_FIELDINDEX @@ -649,7 +650,7 @@ function fieldcount_noerror(@nospecialize t) end abstr = true else - abstr = t.abstract || (t.name === Tuple.name && isvatuple(t)) + abstr = t.name.abstract || (t.name === Tuple.name && isvatuple(t)) end if abstr return nothing @@ -717,7 +718,7 @@ function getfield_nothrow(@nospecialize(s00), @nospecialize(name), @nospecialize getfield_nothrow(rewrap(s.b, s00), name, inbounds) elseif isa(s, DataType) # Can't say anything about abstract types - s.abstract && return false + s.name.abstract && return false # If all fields are always initialized, and bounds check is disabled, we can assume # we don't throw if bounds_check_disabled && !isvatuple(s) && s.name !== NamedTuple.body.body.name && fieldcount(s) == s.ninitialized @@ -775,6 +776,9 @@ function getfield_tfunc(@nospecialize(s00), @nospecialize(name)) if (fld == TYPENAME_NAME_FIELDINDEX || fld == TYPENAME_MODULE_FIELDINDEX || fld == TYPENAME_WRAPPER_FIELDINDEX || + fld == TYPENAME_MUTABLE_FIELDINDEX || + fld == TYPENAME_ABSTRACT_FIELDINDEX || + fld == TYPENAME_HASH_FIELDINDEX || (fld == TYPENAME_NAMES_FIELDINDEX && isdefined(sv, fld))) return Const(getfield(sv, fld)) end @@ -799,7 +803,7 @@ function getfield_tfunc(@nospecialize(s00), @nospecialize(name)) end s = widenconst(s) end - if isType(s) || !isa(s, DataType) || s.abstract + if isType(s) || !isa(s, DataType) || s.name.abstract return Any end s = s::DataType @@ -925,7 +929,7 @@ function _fieldtype_nothrow(@nospecialize(s), exact::Bool, name::Const) return exact ? (a || b) : (a && b) end u isa DataType || return false - u.abstract && return false + u.name.abstract && return false if u.name === _NAMEDTUPLE_NAME && !isconcretetype(u) # TODO: better approximate inference return false @@ -986,7 +990,7 @@ function _fieldtype_tfunc(@nospecialize(s), exact::Bool, @nospecialize(name)) _fieldtype_tfunc(rewrap(u.b, s), exact, name)) end u isa DataType || return Union{Type, TypeVar} - if u.abstract + if u.name.abstract # Abstract types have no fields exact && return Bottom # Type{...} without free typevars has no subtypes, so it is actually diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index a20ef946723a7d..765aaa730ff185 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -428,8 +428,7 @@ function finish(me::InferenceState, interp::AbstractInterpreter) # prepare to run optimization passes on fulltree s_edges = me.stmt_edges[1] if s_edges === nothing - s_edges = [] - me.stmt_edges[1] = s_edges + s_edges = me.stmt_edges[1] = [] end for edges in me.stmt_edges edges === nothing && continue @@ -540,7 +539,7 @@ function annotate_slot_load!(e::Expr, vtypes::VarTable, sv::InferenceState, unde subex = e.args[i] if isa(subex, Expr) annotate_slot_load!(subex, vtypes, sv, undefs) - elseif isa(subex, Slot) + elseif isa(subex, SlotNumber) e.args[i] = visit_slot_load!(subex, vtypes, sv, undefs) end end @@ -549,13 +548,13 @@ end function annotate_slot_load(@nospecialize(e), vtypes::VarTable, sv::InferenceState, undefs::Array{Bool,1}) if isa(e, Expr) annotate_slot_load!(e, vtypes, sv, undefs) - elseif isa(e, Slot) + elseif isa(e, SlotNumber) return visit_slot_load!(e, vtypes, sv, undefs) end return e end -function visit_slot_load!(sl::Slot, vtypes::VarTable, sv::InferenceState, undefs::Array{Bool,1}) +function visit_slot_load!(sl::SlotNumber, vtypes::VarTable, sv::InferenceState, undefs::Array{Bool,1}) id = slot_id(sl) s = vtypes[id] vt = widenconditional(ignorelimited(s.typ)) @@ -584,7 +583,7 @@ function record_slot_assign!(sv::InferenceState) if isa(st_i, VarTable) && isa(expr, Expr) && expr.head === :(=) lhs = expr.args[1] rhs = expr.args[2] - if isa(lhs, Slot) + if isa(lhs, SlotNumber) vt = widenconst(sv.src.ssavaluetypes[i]) if vt !== Bottom id = slot_id(lhs) @@ -660,7 +659,7 @@ function type_annotate!(sv::InferenceState, run_optimizer::Bool) body[i] = ReturnNode(annotate_slot_load(expr.val, st_i, sv, undefs)) elseif isa(expr, GotoIfNot) body[i] = GotoIfNot(annotate_slot_load(expr.cond, st_i, sv, undefs), expr.dest) - elseif isa(expr, Slot) + elseif isa(expr, SlotNumber) body[i] = visit_slot_load!(expr, st_i, sv, undefs) end else diff --git a/base/compiler/typelattice.jl b/base/compiler/typelattice.jl index 0f3dd7b4a84ed3..6391d4029b58e7 100644 --- a/base/compiler/typelattice.jl +++ b/base/compiler/typelattice.jl @@ -33,7 +33,7 @@ import Core: Const, PartialStruct # end # ``` struct Conditional - var::Slot + var::SlotNumber vtype elsetype function Conditional( @@ -84,14 +84,14 @@ end const VarTable = Array{Any,1} struct StateUpdate - var::Union{Slot,SSAValue} + var::SlotNumber vtype::VarState state::VarTable conditional::Bool end # Represent that the type estimate has been approximated, due to "causes" -# (only used in abstractinterpret, doesn't appear in optimize) +# (only used in abstract interpretion, doesn't appear in optimization) # N.B. in the lattice, this is epsilon smaller than `typ` (except Union{}) struct LimitedAccuracy typ @@ -313,28 +313,26 @@ function widenconditional(typ::AnyConditional) end widenconditional(t::LimitedAccuracy) = error("unhandled LimitedAccuracy") +widenwrappedconditional(@nospecialize(typ)) = widenconditional(typ) +widenwrappedconditional(typ::LimitedAccuracy) = LimitedAccuracy(widenconditional(typ.typ), typ.causes) + ignorelimited(@nospecialize typ) = typ ignorelimited(typ::LimitedAccuracy) = typ.typ function stupdate!(state::Nothing, changes::StateUpdate) newst = copy(changes.state) - if isa(changes.var, Slot) - changeid = slot_id(changes.var::Slot) - newst[changeid] = changes.vtype - # remove any Conditional for this Slot from the vtable - # (unless this change is came from the conditional) - if !changes.conditional - for i = 1:length(newst) - newtype = newst[i] - if isa(newtype, VarState) - newtypetyp = ignorelimited(newtype.typ) - if isa(newtypetyp, Conditional) && slot_id(newtypetyp.var) == changeid - newtypetyp = widenconditional(newtypetyp) - if newtype.typ isa LimitedAccuracy - newtypetyp = LimitedAccuracy(newtypetyp, newtype.typ.causes) - end - newst[i] = VarState(newtypetyp, newtype.undef) - end + changeid = slot_id(changes.var) + newst[changeid] = changes.vtype + # remove any Conditional for this slot from the vtable + # (unless this change is came from the conditional) + if !changes.conditional + for i = 1:length(newst) + newtype = newst[i] + if isa(newtype, VarState) + newtypetyp = ignorelimited(newtype.typ) + if isa(newtypetyp, Conditional) && slot_id(newtypetyp.var) == changeid + newtypetyp = widenwrappedconditional(newtype.typ) + newst[i] = VarState(newtypetyp, newtype.undef) end end end @@ -343,11 +341,8 @@ function stupdate!(state::Nothing, changes::StateUpdate) end function stupdate!(state::VarTable, changes::StateUpdate) - if !isa(changes.var, Slot) - return stupdate!(state, changes.state) - end newstate = nothing - changeid = slot_id(changes.var::Slot) + changeid = slot_id(changes.var) for i = 1:length(state) if i == changeid newtype = changes.vtype @@ -355,15 +350,12 @@ function stupdate!(state::VarTable, changes::StateUpdate) newtype = changes.state[i] end oldtype = state[i] - # remove any Conditional for this Slot from the vtable + # remove any Conditional for this slot from the vtable # (unless this change is came from the conditional) if !changes.conditional && isa(newtype, VarState) newtypetyp = ignorelimited(newtype.typ) if isa(newtypetyp, Conditional) && slot_id(newtypetyp.var) == changeid - newtypetyp = widenconditional(newtypetyp) - if newtype.typ isa LimitedAccuracy - newtypetyp = LimitedAccuracy(newtypetyp, newtype.typ.causes) - end + newtypetyp = widenwrappedconditional(newtype.typ) newtype = VarState(newtypetyp, newtype.undef) end end @@ -393,11 +385,8 @@ stupdate!(state::Nothing, changes::VarTable) = copy(changes) stupdate!(state::Nothing, changes::Nothing) = nothing function stupdate1!(state::VarTable, change::StateUpdate) - if !isa(change.var, Slot) - return false - end - changeid = slot_id(change.var::Slot) - # remove any Conditional for this Slot from the catch block vtable + changeid = slot_id(change.var) + # remove any Conditional for this slot from the catch block vtable # (unless this change is came from the conditional) if !change.conditional for i = 1:length(state) diff --git a/base/compiler/typelimits.jl b/base/compiler/typelimits.jl index 2eb2d6f5423776..372989e1140220 100644 --- a/base/compiler/typelimits.jl +++ b/base/compiler/typelimits.jl @@ -256,7 +256,7 @@ function type_more_complex(@nospecialize(t), @nospecialize(c), sources::SimpleVe let tPi = unwrap_unionall(tPi), cPi = unwrap_unionall(cPi) if isa(tPi, DataType) && isa(cPi, DataType) && - !tPi.abstract && !cPi.abstract && + !tPi.name.abstract && !cPi.name.abstract && sym_isless(cPi.name.name, tPi.name.name) # allow collect on (anonymous) Generators to nest, provided that their functions are appropriately ordered # TODO: is there a better way? diff --git a/base/deepcopy.jl b/base/deepcopy.jl index 36c9c399def541..abe8a07fc9a3ee 100644 --- a/base/deepcopy.jl +++ b/base/deepcopy.jl @@ -53,7 +53,7 @@ end function deepcopy_internal(@nospecialize(x), stackdict::IdDict) T = typeof(x)::DataType nf = nfields(x) - if T.mutable + if T.name.mutable if haskey(stackdict, x) return stackdict[x] end @@ -87,7 +87,7 @@ end function deepcopy_internal(x::Array, stackdict::IdDict) if haskey(stackdict, x) - return stackdict[x] + return stackdict[x]::typeof(x) end _deepcopy_array_t(x, eltype(x), stackdict) end diff --git a/base/deprecated.jl b/base/deprecated.jl index 5cd32a16e50e26..d60cc3393662ca 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -250,4 +250,7 @@ cat_shape(dims, shape::Tuple{}) = () # make sure `cat_shape(dims, ())` do not re return getfield(x, s) end +# This function was marked as experimental and not exported. +@deprecate catch_stack(task=current_task(); include_bt=true) current_exceptions(task; backtrace=include_bt) false + # END 1.7 deprecations diff --git a/base/docs/basedocs.jl b/base/docs/basedocs.jl index 5efe97ed9debc0..d45fbd3ee07d27 100644 --- a/base/docs/basedocs.jl +++ b/base/docs/basedocs.jl @@ -2698,4 +2698,46 @@ A quoted piece of code, that does not support interpolation. See the [manual sec """ QuoteNode + +""" + " +`"` Is used to delimit string literals. + +# Examples + +```jldoctest +julia> "Hello World!" +"Hello World!" + +julia> "Hello World!\\n" +"Hello World!\\n" +``` + +See also [`\"""`](@ref \"\"\"). +""" +kw"\"" + +""" + \""" +`\"""` is used to delimit string literals. Strings created by triple quotation marks can contain `"` characters without escaping and are dedented to the level of the least-indented line. This is useful for defining strings within code that is indented. + +# Examples + +```jldoctest +julia> \"""Hello World!\""" +"Hello World!" + +julia> \"""Contains "quote" characters\""" +"Contains \\"quote\\" characters" + +julia> \""" + Hello, + world.\""" +"Hello,\\nworld." +``` + +See also [`"`](@ref \") +""" +kw"\"\"\"" + end diff --git a/base/error.jl b/base/error.jl index 72c13396e3fc47..9116d006189001 100644 --- a/base/error.jl +++ b/base/error.jl @@ -54,7 +54,7 @@ exception will continue propagation as if it had not been caught. the program state at the time of the error so you're encouraged to instead throw a new exception using `throw(e)`. In Julia 1.1 and above, using `throw(e)` will preserve the root cause exception on the stack, as - described in [`catch_stack`](@ref). + described in [`current_exceptions`](@ref). """ rethrow() = ccall(:jl_rethrow, Bottom, ()) rethrow(@nospecialize(e)) = ccall(:jl_rethrow_other, Bottom, (Any,), e) @@ -123,32 +123,38 @@ function catch_backtrace() return _reformat_bt(bt::Vector{Ptr{Cvoid}}, bt2::Vector{Any}) end +struct ExceptionStack <: AbstractArray{Any,1} + stack +end + """ - catch_stack(task=current_task(); [inclue_bt=true]) + current_exceptions(task=current_task(); [inclue_bt=true]) Get the stack of exceptions currently being handled. For nested catch blocks there may be more than one current exception in which case the most recently -thrown exception is last in the stack. The stack is returned as a Vector of -`(exception,backtrace)` pairs, or a Vector of exceptions if `include_bt` is -false. +thrown exception is last in the stack. The stack is returned as an +`ExceptionStack` which is an AbstractVector of named tuples +`(exception,backtrace)`. If `backtrace` is false, the backtrace in each pair +will be set to `nothing`. Explicitly passing `task` will return the current exception stack on an arbitrary task. This is useful for inspecting tasks which have failed due to uncaught exceptions. -!!! compat "Julia 1.1" - This function is experimental in Julia 1.1 and will likely be renamed in a - future release (see https://github.com/JuliaLang/julia/pull/29901). +!!! compat "Julia 1.7" + This function went by the experiemental name `catch_stack()` in Julia + 1.1–1.6, and had a plain Vector-of-tuples as a return type. """ -function catch_stack(task=current_task(); include_bt=true) - raw = ccall(:jl_get_excstack, Any, (Any,Cint,Cint), task, include_bt, typemax(Cint))::Vector{Any} +function current_exceptions(task=current_task(); backtrace=true) + raw = ccall(:jl_get_excstack, Any, (Any,Cint,Cint), task, backtrace, typemax(Cint))::Vector{Any} formatted = Any[] - stride = include_bt ? 3 : 1 + stride = backtrace ? 3 : 1 for i = reverse(1:stride:length(raw)) - e = raw[i] - push!(formatted, include_bt ? (e,Base._reformat_bt(raw[i+1],raw[i+2])) : e) + exc = raw[i] + bt = backtrace ? Base._reformat_bt(raw[i+1],raw[i+2]) : nothing + push!(formatted, (exception=exc,backtrace=bt)) end - formatted + ExceptionStack(formatted) end ## keyword arg lowering generates calls to this ## diff --git a/base/errorshow.jl b/base/errorshow.jl index ceca8b268e42b7..19dc85ea52b814 100644 --- a/base/errorshow.jl +++ b/base/errorshow.jl @@ -242,7 +242,7 @@ function showerror(io::IO, ex::MethodError) if f === Base.convert && length(arg_types_param) == 2 && !is_arg_types f_is_function = true show_convert_error(io, ex, arg_types_param) - elseif isempty(methods(f)) && isa(f, DataType) && f.abstract + elseif isempty(methods(f)) && isa(f, DataType) && f.name.abstract print(io, "no constructors have been defined for ", f) elseif isempty(methods(f)) && !isa(f, Function) && !isa(f, Type) print(io, "objects of type ", ft, " are not callable") @@ -849,7 +849,7 @@ function process_backtrace(t::Vector, limit::Int=typemax(Int); skipC = true) return _simplify_include_frames(ret) end -function show_exception_stack(io::IO, stack::Vector) +function show_exception_stack(io::IO, stack) # Display exception stack with the top of the stack first. This ordering # means that the user doesn't have to scroll up in the REPL to discover the # root cause. @@ -886,3 +886,15 @@ function noncallable_number_hint_handler(io, ex, arg_types, kwargs) end Experimental.register_error_hint(noncallable_number_hint_handler, MethodError) + +# ExceptionStack implementation +size(s::ExceptionStack) = size(s.stack) +getindex(s::ExceptionStack, i::Int) = s.stack[i] + +function show(io::IO, ::MIME"text/plain", stack::ExceptionStack) + nexc = length(stack) + printstyled(io, nexc, "-element ExceptionStack", nexc == 0 ? "" : ":\n") + show_exception_stack(io, stack) +end +show(io::IO, stack::ExceptionStack) = show(io, MIME("text/plain"), stack) + diff --git a/base/exports.jl b/base/exports.jl index 125e38930640d8..36a78c544acaef 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -391,6 +391,7 @@ export first, hcat, hvcat, + hvncat, indexin, argmax, argmin, @@ -716,6 +717,7 @@ export # errors backtrace, catch_backtrace, + current_exceptions, error, rethrow, retry, diff --git a/base/filesystem.jl b/base/filesystem.jl index 191f6537d80418..35703132cae863 100644 --- a/base/filesystem.jl +++ b/base/filesystem.jl @@ -42,7 +42,7 @@ import .Base: IOError, _UVError, _sizeof_uv_fs, check_open, close, eof, eventloop, fd, isopen, bytesavailable, position, read, read!, readavailable, seek, seekend, show, skip, stat, unsafe_read, unsafe_write, write, transcode, uv_error, - rawhandle, OS_HANDLE, INVALID_OS_HANDLE, windowserror, filesize + setup_stdio, rawhandle, OS_HANDLE, INVALID_OS_HANDLE, windowserror, filesize import .Base.RefValue @@ -76,6 +76,7 @@ if OS_HANDLE !== RawFD end rawhandle(file::File) = file.handle +setup_stdio(file::File, ::Bool) = (file, false) # Filesystem.open, not Base.open function open(path::AbstractString, flags::Integer, mode::Integer=0) diff --git a/base/float.jl b/base/float.jl index 560016d9400f57..06603940f8f197 100644 --- a/base/float.jl +++ b/base/float.jl @@ -467,7 +467,7 @@ end # b. unsafe_convert undefined behaviour if fy == Tf(typemax(Ti)) # (but consequently x == fy > y) for Ti in (Int64,UInt64,Int128,UInt128) - for Tf in (Float16,Float32,Float64) + for Tf in (Float32,Float64) @eval begin function ==(x::$Tf, y::$Ti) fy = ($Tf)(y) diff --git a/base/gmp.jl b/base/gmp.jl index 90874b01977c2d..0fa475a2c68014 100644 --- a/base/gmp.jl +++ b/base/gmp.jl @@ -10,7 +10,7 @@ import .Base: *, +, -, /, <, <<, >>, >>>, <=, ==, >, >=, ^, (~), (&), (|), xor, sum, trailing_zeros, trailing_ones, count_ones, tryparse_internal, bin, oct, dec, hex, isequal, invmod, _prevpow2, _nextpow2, ndigits0zpb, widen, signed, unsafe_trunc, trunc, iszero, isone, big, flipsign, signbit, - sign, hastypemax, isodd, digits! + sign, hastypemax, isodd, iseven, digits!, hash, hash_integer if Clong == Int32 const ClongMax = Union{Int8, Int16, Int32} @@ -343,6 +343,7 @@ end rem(x::Integer, ::Type{BigInt}) = BigInt(x) isodd(x::BigInt) = MPZ.tstbit(x, 0) +iseven(x::BigInt) = !isodd(x) function (::Type{T})(x::BigInt) where T<:Base.BitUnsigned if sizeof(T) < sizeof(Limb) @@ -768,8 +769,11 @@ end if Limb === UInt # this condition is true most (all?) of the time, and in this case we can define - # an optimized version of the above hash_integer(::Integer, ::UInt) method for BigInt - # used e.g. for Rational{BigInt} + # an optimized version for BigInt of hash_integer (used e.g. for Rational{BigInt}), + # and of hash + + using .Base: hash_uint + function hash_integer(n::BigInt, h::UInt) GC.@preserve n begin s = n.size @@ -799,7 +803,7 @@ if Limb === UInt limb <= typemin(Int) % UInt && return hash(-(limb % Int), h) end pow = trailing_zeros(x) - nd = ndigits0z(x, 2) + nd = Base.ndigits0z(x, 2) idx = _divLimb(pow) + 1 shift = _modLimb(pow) % UInt upshift = BITS_PER_LIMB - shift diff --git a/base/int.jl b/base/int.jl index 85482f12a5c077..c6b50c3a646bc9 100644 --- a/base/int.jl +++ b/base/int.jl @@ -390,6 +390,9 @@ Number of ones in the binary representation of `x`. ```jldoctest julia> count_ones(7) 3 + +julia> count_ones(Int32(-1)) +32 ``` """ count_ones(x::BitInteger) = (ctpop_int(x) % Int)::Int @@ -429,6 +432,9 @@ Number of zeros in the binary representation of `x`. ```jldoctest julia> count_zeros(Int32(2 ^ 16 - 1)) 16 + +julia> count_zeros(-1) +0 ``` """ count_zeros(x::Integer) = count_ones(~x) diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 7070aa9d13579e..d3ab6f2842386b 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -387,6 +387,8 @@ _prevpow2(x::Integer) = reinterpret(typeof(x),x < 0 ? -_prevpow2(unsigned(-x)) : Test whether `n` is an integer power of two. +See also [`count_ones`](@ref), [`prevpow`](@ref), [`nextpow`](@ref). + # Examples ```jldoctest julia> ispow2(4) @@ -418,6 +420,8 @@ ispow2(x::Integer) = x > 0 && count_ones(x) == 1 The smallest `a^n` not less than `x`, where `n` is a non-negative integer. `a` must be greater than 1, and `x` must be greater than 0. +See also [`prevpow`](@ref). + # Examples ```jldoctest julia> nextpow(2, 7) @@ -432,8 +436,6 @@ julia> nextpow(5, 20) julia> nextpow(4, 16) 16 ``` - -See also [`prevpow`](@ref). """ function nextpow(a::Real, x::Real) x <= 0 && throw(DomainError(x, "`x` must be positive.")) @@ -455,6 +457,8 @@ end The largest `a^n` not greater than `x`, where `n` is a non-negative integer. `a` must be greater than 1, and `x` must not be less than 1. +See also [`nextpow`](@ref), [`isqrt`](@ref). + # Examples ```jldoctest julia> prevpow(2, 7) @@ -469,7 +473,6 @@ julia> prevpow(5, 20) julia> prevpow(4, 16) 16 ``` -See also [`nextpow`](@ref). """ function prevpow(a::Real, x::Real) x < 1 && throw(DomainError(x, "`x` must be ≥ 1.")) @@ -611,6 +614,8 @@ Compute the number of digits in integer `n` written in base `base` (`base` must not be in `[-1, 0, 1]`), optionally padded with zeros to a specified size (the result will never be less than `pad`). +See also [`digits`](@ref), [`count_ones`](@ref). + # Examples ```jldoctest julia> ndigits(12345) @@ -624,6 +629,9 @@ julia> string(1022, base=16) julia> ndigits(123, pad=5) 5 + +julia> ndigits(-123) +3 ``` """ ndigits(x::Integer; base::Integer=10, pad::Integer=1) = max(pad, ndigits0z(x, base)) @@ -748,12 +756,15 @@ split_sign(n::Unsigned) = n, false Convert an integer `n` to a string in the given `base`, optionally specifying a number of digits to pad to. +See also [`digits`](@ref), [`bitstring`](@ref), [`count_zeros`](@ref). + +# Examples ```jldoctest julia> string(5, base = 13, pad = 4) "0005" -julia> string(13, base = 5, pad = 4) -"0023" +julia> string(-13, base = 5, pad = 4) +"-0023" ``` """ function string(n::Integer; base::Integer = 10, pad::Integer = 1) @@ -782,10 +793,12 @@ string(b::Bool) = b ? "true" : "false" A string giving the literal bit representation of a number. +See also [`count_ones`](@ref), [`count_zeros`](@ref), [`digits`](@ref). + # Examples ```jldoctest -julia> bitstring(4) -"0000000000000000000000000000000000000000000000000000000000000100" +julia> bitstring(Int32(4)) +"00000000000000000000000000000100" julia> bitstring(2.2) "0100000000000001100110011001100110011001100110011001100110011010" @@ -806,9 +819,12 @@ Return an array with element type `T` (default `Int`) of the digits of `n` in th base, optionally padded with zeros to a specified size. More significant digits are at higher indices, such that `n == sum(digits[k]*base^(k-1) for k=1:length(digits))`. +See also [`ndigits`](@ref), [`digits!`](@ref), +and for base 2 also [`bitstring`](@ref), [`count_ones`](@ref). + # Examples ```jldoctest -julia> digits(10, base = 10) +julia> digits(10) 2-element Vector{Int64}: 0 1 @@ -820,14 +836,18 @@ julia> digits(10, base = 2) 0 1 -julia> digits(10, base = 2, pad = 6) -6-element Vector{Int64}: - 0 - 1 - 0 - 1 - 0 - 0 +julia> digits(-256, base = 10, pad = 5) +5-element Vector{Int64}: + -6 + -5 + -2 + 0 + 0 + +julia> n = rand(-999:999); + +julia> n == evalpoly(13, digits(n, base = 13)) +true ``` """ digits(n::Integer; base::Integer = 10, pad::Integer = 1) = diff --git a/base/iterators.jl b/base/iterators.jl index dbebe900e06592..2ae6347a4b849c 100644 --- a/base/iterators.jl +++ b/base/iterators.jl @@ -1171,15 +1171,15 @@ function length(itr::PartitionIterator) return cld(l, itr.n) end -function iterate(itr::PartitionIterator{<:AbstractRange}, state=1) - state > length(itr.c) && return nothing - r = min(state + itr.n - 1, length(itr.c)) +function iterate(itr::PartitionIterator{<:AbstractRange}, state = firstindex(itr.c)) + state > lastindex(itr.c) && return nothing + r = min(state + itr.n - 1, lastindex(itr.c)) return @inbounds itr.c[state:r], r + 1 end -function iterate(itr::PartitionIterator{<:AbstractArray}, state=1) - state > length(itr.c) && return nothing - r = min(state + itr.n - 1, length(itr.c)) +function iterate(itr::PartitionIterator{<:AbstractArray}, state = firstindex(itr.c)) + state > lastindex(itr.c) && return nothing + r = min(state + itr.n - 1, lastindex(itr.c)) return @inbounds view(itr.c, state:r), r + 1 end diff --git a/base/loading.jl b/base/loading.jl index ca7ab7cb6b3917..10a59de688b7cd 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -316,16 +316,29 @@ function pathof(m::Module) end """ - pkgdir(m::Module) + pkgdir(m::Module[, paths::String...]) - Return the root directory of the package that imported module `m`, - or `nothing` if `m` was not imported from a package. - """ -function pkgdir(m::Module) +Return the root directory of the package that imported module `m`, +or `nothing` if `m` was not imported from a package. Optionally further +path component strings can be provided to construct a path within the +package root. + +```julia +julia> pkgdir(Foo) +"/path/to/Foo.jl" + +julia> pkgdir(Foo, "src", "file.jl") +"/path/to/Foo.jl/src/file.jl" +``` + +!!! compat "Julia 1.7" + The optional argument `paths` requires at least Julia 1.7. +""" +function pkgdir(m::Module, paths::String...) rootmodule = Base.moduleroot(m) path = pathof(rootmodule) path === nothing && return nothing - return dirname(dirname(path)) + return joinpath(dirname(dirname(path)), paths...) end ## generic project & manifest API ## diff --git a/base/math.jl b/base/math.jl index c08c25d05f1128..003d4e0c8f8317 100644 --- a/base/math.jl +++ b/base/math.jl @@ -495,7 +495,7 @@ log(x::Number) Compute the logarithm of `x` to base 2. Throws [`DomainError`](@ref) for negative [`Real`](@ref) arguments. -See also: [`exp2`](@ref), [`ldexp`](@ref). +See also: [`exp2`](@ref), [`ldexp`](@ref), [`ispow2`](@ref). # Examples ```jldoctest; filter = r"Stacktrace:(\\n \\[[0-9]+\\].*)*" diff --git a/base/methodshow.jl b/base/methodshow.jl index 961328c7c9684f..937ff02a1786da 100644 --- a/base/methodshow.jl +++ b/base/methodshow.jl @@ -295,6 +295,7 @@ function show_method_table(io::IO, ms::MethodList, max::Int=-1, header::Bool=tru end show(io::IO, ms::MethodList) = show_method_table(io, ms) +show(io::IO, ::MIME"text/plain", ms::MethodList) = show_method_table(io, ms) show(io::IO, mt::Core.MethodTable) = show_method_table(io, MethodList(mt)) function inbase(m::Module) diff --git a/base/missing.jl b/base/missing.jl index 1c15786a86a51b..3176c567726027 100644 --- a/base/missing.jl +++ b/base/missing.jl @@ -452,6 +452,9 @@ f(3) ERROR: `b` is still missing [...] ``` + +!!! compat "Julia 1.7" + This macro is available as of Julia 1.7. """ macro coalesce(args...) expr = :(missing) diff --git a/base/multidimensional.jl b/base/multidimensional.jl index bf4e09dd12a492..474e19e7e5f5b2 100644 --- a/base/multidimensional.jl +++ b/base/multidimensional.jl @@ -828,7 +828,7 @@ uncolon(inds::Tuple{}, I::Tuple{Colon, Vararg{Any}}) = Slice(OneTo(1)) uncolon(inds::Tuple, I::Tuple{Colon, Vararg{Any}}) = Slice(inds[1]) ### From abstractarray.jl: Internal multidimensional indexing definitions ### -getindex(x::Number, i::CartesianIndex{0}) = x +getindex(x::Union{Number,Char}, ::CartesianIndex{0}) = x getindex(t::Tuple, i::CartesianIndex{1}) = getindex(t, i.I[1]) # These are not defined on directly on getindex to avoid diff --git a/base/pointer.jl b/base/pointer.jl index 0813d0a0c97350..1739c89f46a0dc 100644 --- a/base/pointer.jl +++ b/base/pointer.jl @@ -143,7 +143,7 @@ See also: [`unsafe_pointer_to_objref`](@ref). """ function pointer_from_objref(@nospecialize(x)) @_inline_meta - typeof(x).mutable || error("pointer_from_objref cannot be used on immutable objects") + typeof(x).name.mutable || error("pointer_from_objref cannot be used on immutable objects") ccall(:jl_value_ptr, Ptr{Cvoid}, (Any,), x) end diff --git a/base/process.jl b/base/process.jl index e7a460b0e8ead5..0a2caccad30d46 100644 --- a/base/process.jl +++ b/base/process.jl @@ -74,26 +74,28 @@ const SpawnIOs = Vector{Any} # convenience name for readability # handle marshalling of `Cmd` arguments from Julia to C @noinline function _spawn_primitive(file, cmd::Cmd, stdio::SpawnIOs) loop = eventloop() - iohandles = Tuple{Cint, UInt}[ # assuming little-endian layout - let h = rawhandle(io) - h === C_NULL ? (0x00, UInt(0)) : - h isa OS_HANDLE ? (0x02, UInt(cconvert(@static(Sys.iswindows() ? Ptr{Cvoid} : Cint), h))) : - h isa Ptr{Cvoid} ? (0x04, UInt(h)) : - error("invalid spawn handle $h from $io") - end - for io in stdio] - handle = Libc.malloc(_sizeof_uv_process) - disassociate_julia_struct(handle) # ensure that data field is set to C_NULL - err = ccall(:jl_spawn, Int32, - (Cstring, Ptr{Cstring}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Tuple{Cint, UInt}}, Int, - UInt32, Ptr{Cstring}, Cstring, Ptr{Cvoid}), - file, cmd.exec, loop, handle, - iohandles, length(iohandles), - cmd.flags, - cmd.env === nothing ? C_NULL : cmd.env, - isempty(cmd.dir) ? C_NULL : cmd.dir, - @cfunction(uv_return_spawn, Cvoid, (Ptr{Cvoid}, Int64, Int32))) + GC.@preserve stdio begin + iohandles = Tuple{Cint, UInt}[ # assuming little-endian layout + let h = rawhandle(io) + h === C_NULL ? (0x00, UInt(0)) : + h isa OS_HANDLE ? (0x02, UInt(cconvert(@static(Sys.iswindows() ? Ptr{Cvoid} : Cint), h))) : + h isa Ptr{Cvoid} ? (0x04, UInt(h)) : + error("invalid spawn handle $h from $io") + end + for io in stdio] + handle = Libc.malloc(_sizeof_uv_process) + disassociate_julia_struct(handle) # ensure that data field is set to C_NULL + err = ccall(:jl_spawn, Int32, + (Cstring, Ptr{Cstring}, Ptr{Cvoid}, Ptr{Cvoid}, + Ptr{Tuple{Cint, UInt}}, Int, + UInt32, Ptr{Cstring}, Cstring, Ptr{Cvoid}), + file, cmd.exec, loop, handle, + iohandles, length(iohandles), + cmd.flags, + cmd.env === nothing ? C_NULL : cmd.env, + isempty(cmd.dir) ? C_NULL : cmd.dir, + @cfunction(uv_return_spawn, Cvoid, (Ptr{Cvoid}, Int64, Int32))) + end if err != 0 ccall(:jl_forceclose_uv, Cvoid, (Ptr{Cvoid},), handle) # will call free on handle eventually throw(_UVError("could not spawn " * repr(cmd), err)) @@ -209,10 +211,10 @@ function setup_stdio(stdio::PipeEndpoint, child_readable::Bool) rd, wr = link_pipe(!child_readable, child_readable) try open_pipe!(stdio, child_readable ? wr : rd) - catch ex + catch close_pipe_sync(rd) close_pipe_sync(wr) - rethrow(ex) + rethrow() end child = child_readable ? rd : wr return (child, true) @@ -251,18 +253,18 @@ function setup_stdio(stdio::FileRedirect, child_readable::Bool) return (io, true) end -# incrementally move data between an IOBuffer and a system Pipe +# incrementally move data between an arbitrary IO and a system Pipe # TODO: probably more efficient (when valid) to use `stdio` directly as the # PipeEndpoint buffer field in some cases -function setup_stdio(stdio::Union{IOBuffer, BufferStream}, child_readable::Bool) +function setup_stdio(stdio::IO, child_readable::Bool) parent = PipeEndpoint() rd, wr = link_pipe(!child_readable, child_readable) try open_pipe!(parent, child_readable ? wr : rd) - catch ex + catch close_pipe_sync(rd) close_pipe_sync(wr) - rethrow(ex) + rethrow() end child = child_readable ? rd : wr try @@ -271,24 +273,18 @@ function setup_stdio(stdio::Union{IOBuffer, BufferStream}, child_readable::Bool) @async try write(in, out) catch ex - @warn "Process error" exception=(ex, catch_backtrace()) + @warn "Process I/O error" exception=(ex, catch_backtrace()) finally close(parent) end end - catch ex + catch close_pipe_sync(child) - rethrow(ex) + rethrow() end return (child, true) end -function setup_stdio(io, child_readable::Bool) - # if there is no specialization, - # assume that rawhandle is defined for it - return (io, false) -end - close_stdio(stdio::OS_HANDLE) = close_pipe_sync(stdio) close_stdio(stdio) = close(stdio) diff --git a/base/range.jl b/base/range.jl index 41120e1bcdaf0d..ca1f577ecf00aa 100644 --- a/base/range.jl +++ b/base/range.jl @@ -927,6 +927,14 @@ end show(io::IO, r::AbstractRange) = print(io, repr(first(r)), ':', repr(step(r)), ':', repr(last(r))) show(io::IO, r::UnitRange) = print(io, repr(first(r)), ':', repr(last(r))) show(io::IO, r::OneTo) = print(io, "Base.OneTo(", r.stop, ")") +function show(io::IO, r::StepRangeLen) + if step(r) != 0 + print(io, repr(first(r)), ':', repr(step(r)), ':', repr(last(r))) + else + # ugly temporary printing, to avoid 0:0:0 etc. + print(io, "StepRangeLen(", repr(first(r)), ", ", repr(step(r)), ", ", repr(length(r)), ")") + end +end function ==(r::T, s::T) where {T<:AbstractRange} isempty(r) && return isempty(s) @@ -1238,7 +1246,7 @@ function _define_range_op(@nospecialize f) r1l = length(r1) (r1l == length(r2) || throw(DimensionMismatch("argument dimensions must match: length of r1 is $r1l, length of r2 is $(length(r2))"))) - range($f(first(r1), first(r2)), step=$f(step(r1), step(r2)), length=r1l) + StepRangeLen($f(first(r1), first(r2)), $f(step(r1), step(r2)), r1l) end function $f(r1::LinRange{T}, r2::LinRange{T}) where T diff --git a/base/reducedim.jl b/base/reducedim.jl index ff2b24db740ef0..5851cfcc0cd1fd 100644 --- a/base/reducedim.jl +++ b/base/reducedim.jl @@ -999,7 +999,7 @@ julia> findmin(A, dims=1) ([1.0 2.0], CartesianIndex{2}[CartesianIndex(1, 1) CartesianIndex(1, 2)]) julia> findmin(A, dims=2) -([1.0; 3.0], CartesianIndex{2}[CartesianIndex(1, 1); CartesianIndex(2, 1)]) +([1.0; 3.0;;], CartesianIndex{2}[CartesianIndex(1, 1); CartesianIndex(2, 1);;]) ``` """ findmin(A::AbstractArray; dims=:) = _findmin(A, dims) @@ -1046,7 +1046,7 @@ julia> findmax(A, dims=1) ([3.0 4.0], CartesianIndex{2}[CartesianIndex(2, 1) CartesianIndex(2, 2)]) julia> findmax(A, dims=2) -([2.0; 4.0], CartesianIndex{2}[CartesianIndex(1, 2); CartesianIndex(2, 2)]) +([2.0; 4.0;;], CartesianIndex{2}[CartesianIndex(1, 2); CartesianIndex(2, 2);;]) ``` """ findmax(A::AbstractArray; dims=:) = _findmax(A, dims) diff --git a/base/reflection.jl b/base/reflection.jl index f1ecab42ef9b7a..33327b64a6a2a1 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -154,7 +154,7 @@ function fieldname(t::DataType, i::Integer) end throw_need_pos_int(i) = throw(ArgumentError("Field numbers must be positive integers. $i is invalid.")) - t.abstract && throw_not_def_field() + t.name.abstract && throw_not_def_field() names = _fieldnames(t) n_fields = length(names)::Int i > n_fields && throw_field_access(t, i, n_fields) @@ -471,7 +471,7 @@ true !!! compat "Julia 1.5" This function requires at least Julia 1.5. """ -ismutable(@nospecialize(x)) = (@_pure_meta; typeof(x).mutable) +ismutable(@nospecialize(x)) = (@_pure_meta; typeof(x).name.mutable) """ @@ -486,7 +486,7 @@ Determine whether type `T` was declared as a mutable type function ismutabletype(@nospecialize(t::Type)) t = unwrap_unionall(t) # TODO: what to do for `Union`? - return isa(t, DataType) && t.mutable + return isa(t, DataType) && t.name.mutable end @@ -502,7 +502,7 @@ function isstructtype(@nospecialize(t::Type)) # TODO: what to do for `Union`? isa(t, DataType) || return false hasfield = !isdefined(t, :types) || !isempty(t.types) - return hasfield || (t.size == 0 && !t.abstract) + return hasfield || (t.size == 0 && !t.name.abstract) end """ @@ -517,7 +517,7 @@ function isprimitivetype(@nospecialize(t::Type)) # TODO: what to do for `Union`? isa(t, DataType) || return false hasfield = !isdefined(t, :types) || !isempty(t.types) - return !hasfield && t.size != 0 && !t.abstract + return !hasfield && t.size != 0 && !t.name.abstract end """ @@ -623,7 +623,7 @@ function isabstracttype(@nospecialize(t)) @_pure_meta t = unwrap_unionall(t) # TODO: what to do for `Union`? - return isa(t, DataType) && t.abstract + return isa(t, DataType) && t.name.abstract end """ @@ -757,7 +757,7 @@ function fieldcount(@nospecialize t) end abstr = true else - abstr = t.abstract || (t.name === Tuple.name && isvatuple(t)) + abstr = t.name.abstract || (t.name === Tuple.name && isvatuple(t)) end if abstr throw(ArgumentError("type does not have a definite number of fields")) @@ -862,7 +862,7 @@ function code_lowered(@nospecialize(f), @nospecialize(t=Tuple); generated::Bool= throw(ArgumentError("'debuginfo' must be either :source or :none")) end return map(method_instances(f, t)) do m - if generated && isgenerated(m) + if generated && hasgenerator(m) if may_invoke_generator(m) return ccall(:jl_code_for_staged, Any, (Any,), m)::CodeInfo else @@ -877,8 +877,8 @@ function code_lowered(@nospecialize(f), @nospecialize(t=Tuple); generated::Bool= end end -isgenerated(m::Method) = isdefined(m, :generator) -isgenerated(m::Core.MethodInstance) = isgenerated(m.def) +hasgenerator(m::Method) = isdefined(m, :generator) +hasgenerator(m::Core.MethodInstance) = hasgenerator(m.def::Method) # low-level method lookup functions used by the compiler @@ -915,15 +915,13 @@ end # high-level, more convenient method lookup functions # type for reflecting and pretty-printing a subset of methods -mutable struct MethodList +mutable struct MethodList <: AbstractArray{Method,1} ms::Array{Method,1} mt::Core.MethodTable end -length(m::MethodList) = length(m.ms) -isempty(m::MethodList) = isempty(m.ms) -iterate(m::MethodList, s...) = iterate(m.ms, s...) -eltype(::Type{MethodList}) = Method +size(m::MethodList) = size(m.ms) +getindex(m::MethodList, i) = m.ms[i] function MethodList(mt::Core.MethodTable) ms = Method[] diff --git a/base/refpointer.jl b/base/refpointer.jl index 67cec0925ff589..725b2d05f95ee4 100644 --- a/base/refpointer.jl +++ b/base/refpointer.jl @@ -117,7 +117,7 @@ convert(::Type{Ref{T}}, x::AbstractArray{T}) where {T} = RefArray(x, 1) function unsafe_convert(P::Union{Type{Ptr{T}},Type{Ptr{Cvoid}}}, b::RefArray{T})::P where T if allocatedinline(T) p = pointer(b.x, b.i) - elseif isconcretetype(T) && T.mutable + elseif isconcretetype(T) && T.name.mutable p = pointer_from_objref(b.x[b.i]) else # see comment on equivalent branch for RefValue diff --git a/base/refvalue.jl b/base/refvalue.jl index cf5f4e6b74d6fd..69d9a310617247 100644 --- a/base/refvalue.jl +++ b/base/refvalue.jl @@ -38,7 +38,7 @@ isassigned(x::RefValue) = isdefined(x, :x) function unsafe_convert(P::Union{Type{Ptr{T}},Type{Ptr{Cvoid}}}, b::RefValue{T})::P where T if allocatedinline(T) p = pointer_from_objref(b) - elseif isconcretetype(T) && T.mutable + elseif isconcretetype(T) && T.name.mutable p = pointer_from_objref(b.x) else # If the slot is not leaf type, it could be either immutable or not. diff --git a/base/show.jl b/base/show.jl index 595af52a5fc1cf..ca92c349db8094 100644 --- a/base/show.jl +++ b/base/show.jl @@ -2616,7 +2616,7 @@ function dump(io::IOContext, x::DataType, n::Int, indent) if x !== Any print(io, " <: ", supertype(x)) end - if n > 0 && !(x <: Tuple) && !x.abstract + if n > 0 && !(x <: Tuple) && !x.name.abstract tvar_io::IOContext = io for tparam in x.parameters # approximately recapture the list of tvar parameterization diff --git a/base/some.jl b/base/some.jl index f762f7f9aa4d1f..58280fe7273524 100644 --- a/base/some.jl +++ b/base/some.jl @@ -131,6 +131,9 @@ f(3) julia> b === nothing true ``` + +!!! compat "Julia 1.7" + This macro is available as of Julia 1.7. """ macro something(args...) expr = :(nothing) diff --git a/base/special/exp.jl b/base/special/exp.jl index c9d53ed8aa6958..09f4b211d40dcc 100644 --- a/base/special/exp.jl +++ b/base/special/exp.jl @@ -387,7 +387,7 @@ end return fma(x, p2[1], x*p2[2]) end -@inline function expm1(x::Float64) +function expm1(x::Float64) T = Float64 if -0.2876820724517809 <= x <= 0.22314355131420976 return expm1_small(x) @@ -413,7 +413,7 @@ end return twopk*((jU-twopnk) + fma(jU, p, jL)) end -@inline function expm1(x::Float32) +function expm1(x::Float32) if -0.2876821f0 <=x <= 0.22314355f0 return expm1_small(x) end diff --git a/base/special/trig.jl b/base/special/trig.jl index e7b9e2085bb981..363bec0e62c8cd 100644 --- a/base/special/trig.jl +++ b/base/special/trig.jl @@ -1269,22 +1269,30 @@ end sincosd(::Missing) = (missing, missing) for (fd, f, fn) in ((:sind, :sin, "sine"), (:cosd, :cos, "cosine"), (:tand, :tan, "tangent")) - name = string(fd) - @eval begin - @doc """ - $($name)(x) - Compute $($fn) of `x`, where `x` is in degrees. """ ($fd)(z) = ($f)(deg2rad(z)) + for (fu, un) in ((:deg2rad, "degrees"),) + name = string(fd) + @eval begin + @doc """ + $($name)(x) + + Compute $($fn) of `x`, where `x` is in $($un). + If `x` is a matrix, `x` needs to be a square matrix. """ ($fd)(x) = ($f)(($fu).(x)) + end end end for (fd, f, fn) in ((:asind, :asin, "sine"), (:acosd, :acos, "cosine"), (:asecd, :asec, "secant"), (:acscd, :acsc, "cosecant"), (:acotd, :acot, "cotangent")) - name = string(fd) - @eval begin - @doc """ - $($name)(x) - Compute the inverse $($fn) of `x`, where the output is in degrees. """ ($fd)(y) = rad2deg(($f)(y)) + for (fu, un) in ((:rad2deg, "degrees"),) + name = string(fd) + @eval begin + @doc """ + $($name)(x) + + Compute the inverse $($fn) of `x`, where the output is in $($un). + If `x` is a matrix, `x` needs to be a square matrix. """ ($fd)(x) = ($fu).(($f)(x)) + end end end @@ -1294,5 +1302,5 @@ end Compute the inverse tangent of `y` or `y/x`, respectively, where the output is in degrees. """ -atand(y) = rad2deg(atan(y)) -atand(y, x) = rad2deg(atan(y,x)) +atand(y) = rad2deg.(atan(y)) +atand(y, x) = rad2deg.(atan(y,x)) diff --git a/base/stream.jl b/base/stream.jl index 509bc9953add60..2a23e97b4652c9 100644 --- a/base/stream.jl +++ b/base/stream.jl @@ -282,6 +282,7 @@ end lock(s::LibuvStream) = lock(s.lock) unlock(s::LibuvStream) = unlock(s.lock) +setup_stdio(stream::LibuvStream) = (stream, false) rawhandle(stream::LibuvStream) = stream.handle unsafe_convert(::Type{Ptr{Cvoid}}, s::Union{LibuvStream, LibuvServer}) = s.handle diff --git a/base/strings/io.jl b/base/strings/io.jl index 0f877275ed7595..8b6bc21723ced9 100644 --- a/base/strings/io.jl +++ b/base/strings/io.jl @@ -301,15 +301,12 @@ IOBuffer(s::SubString{String}) = IOBuffer(view(unsafe_wrap(Vector{UInt8}, s.stri # join is implemented using IO """ - join([io::IO,] strings [, delim [, last]]) + join([io::IO,] iterator [, delim [, last]]) -Join an array of `strings` into a single string, inserting the given delimiter (if any) between -adjacent strings. If `last` is given, it will be used instead of `delim` between the last -two strings. If `io` is given, the result is written to `io` rather than returned -as a `String`. - -`strings` can be any iterable over elements `x` which are convertible to strings -via `print(io::IOBuffer, x)`. `strings` will be printed to `io`. +Join any `iterator` into a single string, inserting the given delimiter (if any) between +adjacent items. If `last` is given, it will be used instead of `delim` between the last +two items. Each item of `iterator` is converted to a string via `print(io::IOBuffer, x)`. +If `io` is given, the result is written to `io` rather than returned as a `String`. # Examples ```jldoctest @@ -320,15 +317,15 @@ julia> join([1,2,3,4,5]) "12345" ``` """ -function join(io::IO, strings, delim, last) +function join(io::IO, iterator, delim, last) first = true local prev - for str in strings + for item in iterator if @isdefined prev first ? (first = false) : print(io, delim) print(io, prev) end - prev = str + prev = item end if @isdefined prev first || print(io, last) @@ -336,19 +333,19 @@ function join(io::IO, strings, delim, last) end nothing end -function join(io::IO, strings, delim="") +function join(io::IO, iterator, delim="") # Specialization of the above code when delim==last, # which lets us emit (compile) less code first = true - for str in strings + for item in iterator first ? (first = false) : print(io, delim) - print(io, str) + print(io, item) end end -join(strings) = sprint(join, strings) -join(strings, delim) = sprint(join, strings, delim) -join(strings, delim, last) = sprint(join, strings, delim, last) +join(iterator) = sprint(join, iterator) +join(iterator, delim) = sprint(join, iterator, delim) +join(iterator, delim, last) = sprint(join, iterator, delim, last) ## string escaping & unescaping ## diff --git a/base/task.jl b/base/task.jl index d6eca501cf079e..1ed68f70f7ab76 100644 --- a/base/task.jl +++ b/base/task.jl @@ -77,7 +77,7 @@ function showerror(io::IO, ex::TaskFailedException, bt = nothing; backtrace=true end function show_task_exception(io::IO, t::Task; indent = true) - stack = catch_stack(t) + stack = current_exceptions(t) b = IOBuffer() if isempty(stack) # exception stack buffer not available; probably a serialized task @@ -162,7 +162,7 @@ end end elseif field === :backtrace # TODO: this field name should be deprecated in 2.0 - return catch_stack(t)[end][2] + return current_exceptions(t)[end][2] elseif field === :exception # TODO: this field name should be deprecated in 2.0 return t._isexception ? t.result : nothing @@ -434,18 +434,18 @@ function errormonitor(t::Task) try # try to display the failure atomically errio = IOContext(PipeBuffer(), errs::IO) emphasize(errio, "Unhandled Task ") - display_error(errio, catch_stack(t)) + display_error(errio, current_exceptions(t)) write(errs, errio) catch try # try to display the secondary error atomically errio = IOContext(PipeBuffer(), errs::IO) print(errio, "\nSYSTEM: caught exception while trying to print a failed Task notice: ") - display_error(errio, catch_stack()) + display_error(errio, current_exceptions()) write(errs, errio) flush(errs) # and then the actual error, as best we can Core.print(Core.stderr, "while handling: ") - Core.println(Core.stderr, catch_stack(t)[end][1]) + Core.println(Core.stderr, current_exceptions(t)[end][1]) catch e # give up Core.print(Core.stderr, "\nSYSTEM: caught exception of type ", typeof(e).name.name, diff --git a/base/uuid.jl b/base/uuid.jl index 16ffdcefccc8d2..ff4df68ddb7c8c 100644 --- a/base/uuid.jl +++ b/base/uuid.jl @@ -31,6 +31,11 @@ end UInt128(u::UUID) = u.value +let + uuid_hash_seed = UInt === UInt64 ? 0xd06fa04f86f11b53 : 0x96a1f36d + Base.hash(uuid::UUID, h::UInt) = hash(uuid_hash_seed, hash(convert(NTuple{2, UInt64}, uuid), h)) +end + let @inline function uuid_kernel(s, i, u) _c = UInt32(@inbounds codeunit(s, i)) diff --git a/contrib/refresh_checksums.mk b/contrib/refresh_checksums.mk index c6c358daa699e7..b1921488dd98f0 100644 --- a/contrib/refresh_checksums.mk +++ b/contrib/refresh_checksums.mk @@ -19,7 +19,7 @@ CLANG_TRIPLETS=$(filter %-darwin %-freebsd,$(TRIPLETS)) NON_CLANG_TRIPLETS=$(filter-out %-darwin %-freebsd,$(TRIPLETS)) # These are the projects currently using BinaryBuilder; both GCC-expanded and non-GCC-expanded: -BB_PROJECTS=mbedtls libssh2 nghttp2 mpfr curl libgit2 pcre libuv unwind llvmunwind dsfmt objconv p7zip zlib suitesparse openlibm blastrampoline +BB_PROJECTS=mbedtls libssh2 nghttp2 mpfr curl libgit2 pcre libuv unwind llvmunwind dsfmt objconv p7zip zlib libsuitesparse openlibm blastrampoline BB_GCC_EXPANDED_PROJECTS=openblas csl BB_CXX_EXPANDED_PROJECTS=gmp llvm clang llvm-tools # These are non-BB source-only deps diff --git a/deps/Makefile b/deps/Makefile index 3a1099df4d2e96..35c30d5930bd11 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -24,7 +24,7 @@ BUILDDIR := $(BUILDDIR)$(MAYBE_HOST) # if you are adding a new target, it can help to copy an similar, existing target # # autoconf configure-driven scripts: pcre unwind gmp mpfr patchelf libuv curl -# custom Makefile rules: openlibm dsfmt suitesparse-wrapper suitesparse lapack blastrampoline openblas utf8proc objconv libwhich +# custom Makefile rules: openlibm dsfmt libsuitesparse-wrapper libsuitesparse lapack blastrampoline openblas utf8proc objconv libwhich # CMake libs: llvm llvmunwind libgit2 libssh2 mbedtls # # downloadable via git: llvm-svn, libuv, libopenlibm, utf8proc, libgit2, libssh2 @@ -47,7 +47,7 @@ DEP_LIBS += csl endif ifeq ($(USE_GPL_LIBS), 1) -DEP_LIBS += suitesparse-wrapper +DEP_LIBS += libsuitesparse-wrapper endif ifeq ($(USE_SYSTEM_LIBUV), 0) @@ -134,8 +134,8 @@ DEP_LIBS += mpfr endif ifeq ($(USE_GPL_LIBS), 1) -ifeq ($(USE_SYSTEM_SUITESPARSE), 0) -DEP_LIBS += suitesparse +ifeq ($(USE_SYSTEM_LIBSUITESPARSE), 0) +DEP_LIBS += libsuitesparse endif endif @@ -166,13 +166,13 @@ ifneq ($(OS), WINNT) DEP_LIBS += libwhich endif -DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper,$(DEP_LIBS)) +DEP_LIBS_STAGED := $(filter-out libsuitesparse-wrapper,$(DEP_LIBS)) # list all targets DEP_LIBS_STAGED_ALL := llvm llvm-tools clang llvmunwind unwind libuv pcre \ openlibm dsfmt blastrampoline openblas lapack gmp mpfr patchelf utf8proc \ objconv mbedtls libssh2 nghttp2 curl libgit2 libwhich zlib p7zip csl \ - suitesparse suitesparse-wrapper + libsuitesparse libsuitesparse-wrapper DEP_LIBS_ALL := $(DEP_LIBS_STAGED_ALL) ifneq ($(USE_BINARYBUILDER_OPENBLAS),0) @@ -183,8 +183,8 @@ ifeq ($(USE_BINARYBUILDER_LLVM),0) DEP_LIBS_ALL := $(filter-out clang llvm-tools,$(DEP_LIBS_ALL)) endif -ifeq ($(USE_BINARYBUILDER_SUITESPARSE),0) -DEP_LIBS_STAGED := $(filter-out suitesparse,$(DEP_LIBS_STAGED)) +ifeq ($(USE_BINARYBUILDER_LIBSUITESPARSE),0) +DEP_LIBS_STAGED := $(filter-out libsuitesparse,$(DEP_LIBS_STAGED)) endif ## Common build target prefixes @@ -216,7 +216,7 @@ include $(SRCDIR)/objconv.mk include $(SRCDIR)/blastrampoline.mk include $(SRCDIR)/openblas.mk include $(SRCDIR)/utf8proc.mk -include $(SRCDIR)/suitesparse.mk +include $(SRCDIR)/libsuitesparse.mk include $(SRCDIR)/unwind.mk include $(SRCDIR)/gmp.mk include $(SRCDIR)/mpfr.mk diff --git a/deps/Versions.make b/deps/Versions.make index 93d7be4a932ece..56014d8b052b0e 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -15,7 +15,7 @@ CSL_JLL_NAME := CompilerSupportLibraries # Clang (paired with LLVM, only here as a JLL download) CLANG_JLL_NAME := Clang -CLANG_JLL_VER := 11.0.1+3 +CLANG_JLL_VER := 12.0.0+0 # DSFMT DSFMT_VER := 2.2.4 @@ -44,14 +44,14 @@ LIBUV_VER := 2 LIBUV_JLL_NAME := LibUV # LLVM -LLVM_VER := 11.0.1 -LLVM_ASSERT_JLL_VER := 11.0.1+3 +LLVM_VER := 12.0.0 +LLVM_ASSERT_JLL_VER := 12.0.0+0 LLVM_JLL_NAME := libLLVM # LLVM_tools (downloads LLVM_jll to get things like `lit` and `opt`) LLVM_TOOLS_JLL_NAME := LLVM -LLVM_TOOLS_JLL_VER := 11.0.1+3 -LLVM_TOOLS_ASSERT_JLL_VER := 11.0.1+3 +LLVM_TOOLS_JLL_VER := 12.0.0+0 +LLVM_TOOLS_ASSERT_JLL_VER := 12.0.0+0 # LLVM libunwind LLVMUNWIND_VER := 11.0.1 @@ -98,8 +98,8 @@ PCRE_VER := 10.36 PCRE_JLL_NAME := PCRE2 # SuiteSparse -SUITESPARSE_VER := 5.8.1 -SUITESPARSE_JLL_NAME := SuiteSparse +LIBSUITESPARSE_VER := 5.8.1 +LIBSUITESPARSE_JLL_NAME := SuiteSparse # unwind UNWIND_VER := 1.3.2 diff --git a/deps/checksums/Pkg-1a47f445f92053edc83a9528ed849ca404b4a2af.tar.gz/md5 b/deps/checksums/Pkg-1a47f445f92053edc83a9528ed849ca404b4a2af.tar.gz/md5 deleted file mode 100644 index 063360a77aea12..00000000000000 --- a/deps/checksums/Pkg-1a47f445f92053edc83a9528ed849ca404b4a2af.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -e5cb2763c4abd84522a0706584d2a733 diff --git a/deps/checksums/Pkg-1a47f445f92053edc83a9528ed849ca404b4a2af.tar.gz/sha512 b/deps/checksums/Pkg-1a47f445f92053edc83a9528ed849ca404b4a2af.tar.gz/sha512 deleted file mode 100644 index 06705d8278f467..00000000000000 --- a/deps/checksums/Pkg-1a47f445f92053edc83a9528ed849ca404b4a2af.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -e3007f929abdbfa574b72dad24e0ab954fb7469bcfb0786545e109c1122bff65b1d41065c289ae18d8a50130ae09c0700101d4e83d1c023deb5c759eb4f2484d diff --git a/deps/checksums/Pkg-9f67253529c72753cbfbb0078a80717f6c9bd90f.tar.gz/md5 b/deps/checksums/Pkg-9f67253529c72753cbfbb0078a80717f6c9bd90f.tar.gz/md5 new file mode 100644 index 00000000000000..79e70ab448180f --- /dev/null +++ b/deps/checksums/Pkg-9f67253529c72753cbfbb0078a80717f6c9bd90f.tar.gz/md5 @@ -0,0 +1 @@ +1e1bd065364becaf2ca4e4015a770a61 diff --git a/deps/checksums/Pkg-9f67253529c72753cbfbb0078a80717f6c9bd90f.tar.gz/sha512 b/deps/checksums/Pkg-9f67253529c72753cbfbb0078a80717f6c9bd90f.tar.gz/sha512 new file mode 100644 index 00000000000000..59744b851b27f9 --- /dev/null +++ b/deps/checksums/Pkg-9f67253529c72753cbfbb0078a80717f6c9bd90f.tar.gz/sha512 @@ -0,0 +1 @@ +33df67087d1f9423aedf6c5c0b79b78b6bdffae1caf39cdd7f0d07e24097054fced547f284f34b8210d3726a7f964a906113dcee7062703f1dadfe6da2a3640d diff --git a/deps/checksums/SuiteSparse-ec4b40ad9c0490ebf0969a41d4f880620db3f6f9.tar.gz/md5 b/deps/checksums/SuiteSparse-ec4b40ad9c0490ebf0969a41d4f880620db3f6f9.tar.gz/md5 new file mode 100644 index 00000000000000..234424096e008b --- /dev/null +++ b/deps/checksums/SuiteSparse-ec4b40ad9c0490ebf0969a41d4f880620db3f6f9.tar.gz/md5 @@ -0,0 +1 @@ +62c5d890b62dc8825ff449dd229452b2 diff --git a/deps/checksums/SuiteSparse-ec4b40ad9c0490ebf0969a41d4f880620db3f6f9.tar.gz/sha512 b/deps/checksums/SuiteSparse-ec4b40ad9c0490ebf0969a41d4f880620db3f6f9.tar.gz/sha512 new file mode 100644 index 00000000000000..7833dea8238d1c --- /dev/null +++ b/deps/checksums/SuiteSparse-ec4b40ad9c0490ebf0969a41d4f880620db3f6f9.tar.gz/sha512 @@ -0,0 +1 @@ +b822f84edaab9dce301803510ac6e597fd135620685544aa9e8fbc0bbb140784fb00012e5ccfe4836b4dc39bd75f8be54c4e1fffc29696991e3d78855bc7617c diff --git a/deps/checksums/clang b/deps/checksums/clang index 8d0505b5103d74..7dec72fad1db5e 100644 --- a/deps/checksums/clang +++ b/deps/checksums/clang @@ -1,60 +1,58 @@ -clang-11.0.1.src.tar.xz/md5/b4cb0b74b1f3292a89c9720f3e1e2934 -clang-11.0.1.src.tar.xz/sha512/bb98ffb0a992c9907795f7bb7492196f7195fdb5e292e8a764a7a1a8cc078dcf60bebf26ed3db116f78b7022a600c996fd2645e5f6e5d24e4ed99392e1f08df3 -Clang.v11.0.1+3.aarch64-apple-darwin.tar.gz/md5/55c50726cd43c1b49a222ec92ea05431 -Clang.v11.0.1+3.aarch64-apple-darwin.tar.gz/sha512/009b29068af7d8a008e34853faa3ce1e20817d3a7975fe4ca5657d1303e546410c903af345356fb94c88f8e95474895e68414a5a04096b2e9bdeed732780637e -Clang.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/e5d8d1d5364dba4c5891c9a127ee358d -Clang.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/a5efd0a4c0b05ab6ac55081a28cace0cffcd3eefeaa872d239711f667425808f29939c90a327bbf8664d2d065d1b807ed802c161599b7fbda29f554ba9148b48 -Clang.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/67716fd169ad7cb464a576cc10d42ad0 -Clang.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/5780d34b24fc786406f4f4f814ee6b8bf6366964d7252b61ea7dd3a09283ffb266270d76c2580ca1285a753d68922cd42d2d75b9527d331747325c22224536b7 -Clang.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/77e3d4ff674493fda7958b9ad950e934 -Clang.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/813a0cac9ae4972fe426451b9fa0d640f25ff5edfe22624a621cbbe737f7977259d062710f44475139c8298265336fcc67fc28dc7eeddd95039bef44dc080ac4 -Clang.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/e53b1db80024cc3a1152d7694291cbbd -Clang.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/f6b9c15655ca8bb54cd568728fe5ac33df62abbf07029816e892b0483afbb5adc69fde1789b90687137be491fa0351fa5806cf6d869232b3cbb4b42e1f7a5a64 -Clang.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/7ae72cb4b33be0250402f29217e32c53 -Clang.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/1b85e78a78c2bd437c3b21855bb36f8200543d0daa3c2d7be68d5c75ee06a74534e9b8b80ac6048fe05c426e441af3ff019076bf2d045152eb142d7d5769b525 -Clang.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/b83a93c3da36d8eb469f5fd39e8bcb9d -Clang.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/9aab7d5f9be0ce1580ed9d3b3c4da0bff1fff7094794d58620e1fb646ac7733708162f69ad281cd441c4cbbec8985c9906887f4979e5a5ebec8a05c6be06c91e -Clang.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/ea570204363ae3b62965a000e6a3948e -Clang.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/21c9a1418029d5ca0d3d16e943914d8a4932bdbaee1152f74af681349abaebfe4d87a2f51ff06196cea59363b3bec706c629d61f5a37cf0e75cd645fed2ae835 -Clang.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/63130e9a585a747e8f8e31a1b71a27b8 -Clang.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/27f3f72afa62b4f6c8e80d5934cc17119336c65ee070f05d98182e7e83fd02f0ab439a924165c7e6a414409eb2d2044ddf778c0e3e7a6994643b5d0d8b3e2ab9 -Clang.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/0d85a6ace70f1295202ba1c50c5948f4 -Clang.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/574c289c06283e8c2530e64bafb5ff606c27e76a2577acf84112e1ee9b8a3b299abde1e68dfd92700fa472dd6032af02399cca8b436136a5642ce545272398f2 -Clang.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/595279b252dbab5d6411db0d6a514985 -Clang.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/6a1e55e09cfc2325772f11a67f3e7e43872ce07fcceea6852649635778bd472e3e9e6cd0e7e2bf5dbefa1bf0862bae478329b8aedb48b4d7d8cf6ea074e98ce8 -Clang.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/6f973ced20fd2dabf60b12b5ff3b0cb7 -Clang.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/dfc77ef9b13111d5b2d6cdd4d27b0df086ee7a79b535bfc2dcbcc5d9014d0cb0f583c792f812100d64eeadf938645ebe3af72d2df45b396b15b3bc54a0dc3d40 -Clang.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/f96d5a441a56ee914372249fa0cb83e7 -Clang.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/dc2f4afbad26afe4eb43054c70674674a1258f6a1bb17ebd989179336e3de119b976c3429880b3e614668ec5da6c9401346c0fdb8fb45311e818a948c5a2e851 -Clang.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/7f18573c99258f1887aba30228bab25e -Clang.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/6fa4296f59515ca058d2012ab200e65d4c1f130f40b7a3796d4237f6bf9a72f0a3872bbf83ef1865e7c1cdb75de9c5dd3385a64c55be6741fdb91bd5ef00c6de -Clang.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/dd8333ce489719b53cf4f83300ec5c91 -Clang.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/356497a88871fa9a725d0206b09462cf4af96cb866724e7c9ca7a7060bea62a6b39426cb2a17d000d17b04052cc78893008c78b1a1c3cf30d6f84f10cda73fd6 -Clang.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/f82aa0d21872e9b50ef238d004ff28d3 -Clang.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/a2c216727acf6a42c5b914321541a752cdc3cc0b64ae39d1ede1588935ef9d8a4678e5d6f61b2bc1df96a1b4d63812c14e5e6adec7f2babc3175ebfb72421334 -Clang.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/3317c99fba259bddb9f351e79564c831 -Clang.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/bda2aa0decf76b787986a9a308a3832856cce9545b2c75da49193f23e64ac00dd839d243aa85737f28288c284b9770c1f5408deb4e5440293262d14df2ec759c -Clang.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/826749b99dc7b5f24bac5d0531e84468 -Clang.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/e15ba270c2ad915be5d0072830b97e4d66daa2e18b3ba4db8f9687633c3ef0dfc1ee312f4fbdd1c921374709f68cb1b4bc9e58b9ffcbdd200c1eb665fa9a595b -Clang.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/2f217eae89b066e190243b1c120cc46a -Clang.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/526846408cced1707b85f1e40796eb1607d47fb1509435fe7e28368a74e84fa56276aaf9fcab47664615cfe4349c7af3b1ad9995126e888e9002e1a4d20cb1cd -Clang.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/6b6472551ff2e00249fb39ce80df330d -Clang.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/1d2780eb20c2f43659ab2502ff88334a7bf827bb533d37de058e524e9fee9a8ace431761495e93dc9564c80e94aa569066c235bc958cf893c4de5249c4a12676 -Clang.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/74cdafebc133bc54bffabb40547622db -Clang.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/afcad373d30eb465964e17e70b66fd3ea72c1565b1bceb811d82188368a788fdf6a18e388be6d329d9a632f68890d26b878ac0e107ec975b93fc1aec81bab89e -Clang.v11.0.1+3.x86_64-apple-darwin.tar.gz/md5/a4cb1dfe2b86f24b52d730835f8ee31c -Clang.v11.0.1+3.x86_64-apple-darwin.tar.gz/sha512/4526942c33bb4789d3b5975023abdff81d747ecc26b9863c7ea61f87550506d2102a8f83e21085ebbc743ba2be8ddb2b6d4e12a65c9a58e02f6254a335d934f2 -Clang.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/b9bd14c451a9e8efd28c916a85cdb442 -Clang.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/7cf7ba37c600669f12a74e6760ee5b166b6de4f7e817b9ddf133275a242335ed9a460c226a3f4102cec47bb552d8258b34cf3cedd35b16756f1efb5a3608250e -Clang.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/9e930813e07758c80ca7a1575886afc7 -Clang.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/e0dce74b7377256fa65f1e6ce461ef5a6424b6ddb157be36393cd8038153afbecf460c966979e267d1de5cb0ed4509a093ed58210eb3cb69391d16b938a4e7a4 -Clang.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/6e345f292464e430d3408826d0ce9573 -Clang.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/f802e46a46a2946641f07b8b2ef41fee8efbe98e13d23a8ee01047831992b6f115d157520e44879978e27e994da4b63c1a09e6ace63b7c1a1f6351ec04c4885d -Clang.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/ec61190097b601446985c96ca3ffc58e -Clang.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/00de2b64bda05e27f5129d5702894823517f5da01a42892ee20f69e55b6004b0c1020ecb941330243a565048ed249d827612dc3ce69687401c731ac168566049 -Clang.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/dac3f7585db42a3e8eae4d563abc5d68 -Clang.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/082ff3234db9b36346553b5c97d5b7dd55f7458aa4f1f1d358e4d4ee2c7805525514c18c35d319a22c56e6c3bfdd4160ff0a2157f24e1123c5879d167f1a2d13 -Clang.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/81aa45c118d96afe17accb9a0e02ea49 -Clang.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/240979d6e958ad75b6100b5a4fe650c21076dd06b8c9ff13fa397b34bf9816d2d8b8c3ed6040235ef82d11d885cfbda20e5500af3ba3034442744d201264acb0 -Clang.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/b1695d5e231249c07b5cd9d868b6434d -Clang.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/24a33877f7b97a67cd8acc21ce23d31802bea13f416b5bbf28c262277f4a9e8f6a2cdee642d4d49b7d9b7948bc538f3b1bacb259ab0298e58db910044ebcceaf +Clang.v12.0.0+0.aarch64-apple-darwin.tar.gz/md5/980c74812ecb2910ce5ff89f50adeb4e +Clang.v12.0.0+0.aarch64-apple-darwin.tar.gz/sha512/3d732de9268f4ee3550cb8cd25547025f0c3c2b42733da68570ba40906aac590c51de8819f1643d40f3c2310f666eb1d5adff6beaf1a811e1358f71a2b2e693e +Clang.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/md5/4cb0061a62021a9f2e8c4c38cc116a32 +Clang.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/628844979ab97b7e95578cc6a2f01be4853e2e451321baa209d8ef80a3a77f58403f8c905e89ac48570daeae72b10a5dd21de948cc3e886918eec67f87168d2c +Clang.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/md5/98216114af0c5080f2054012986df84a +Clang.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/8f615879985a7840b0c1dec53aaa4f77025464cc32594e3dfd7148ce36201cf0221641fc6de867f605b784d98a2ab360c1aabf1bb98d77363e35d6225f4bce17 +Clang.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/md5/f9ac91da205acb64c95dace753035a45 +Clang.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/sha512/91739206d79d6c75586289205a40c71b922cd42c96564c174b0707a7cc136e77cfbeadbee820ec7ab0e0bfc36f481b88818d3579a205b2d6ae65d7701eb817e6 +Clang.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/md5/7679a6f941daada0225667c017fe50c6 +Clang.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/sha512/aa1532188095bb73dfcea86dc5965302b6a3099c4c95787c0b3ab01ca5c53c7a533325308af6c109d1aa50f69153c57fd5e502f41f2af41dbcf3b039d5f1defa +Clang.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/01056c4c0a86f8684643a06fefa92f27 +Clang.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/bff88b75e7214135cd6c9e797c47cc5dc2d3f2b9bd8e3cf9f1c7ade3bcb205ca916b63b5c6f2067f4de306dddc4efef36c9089a49562c8d656b95d45c957cfd9 +Clang.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/88e9b5fde388021ef88896d39968b3fe +Clang.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/aa5ab4375f532629b22a81d927a23bab60c819ae16982a1dc797a043fd3622d2b5a9c0e4f3195d2974df3383438a844c276efe3a60fee1c99ec7d3a10064cd45 +Clang.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/4415d5e19f1e4bf2719b4851ca428ea1 +Clang.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/200d43017d05ca59374950b557eadb5f2630bf70378a2970dbac4da2ada8e2428c786b9f3c1a2774ed863baf34d8ac667c294c2bb46e51125c40a3aa0125b596 +Clang.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/c8b618d1fb0685f0023c3440918923a0 +Clang.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/4b85961d98cd47105cb88a187ac52072af7af27c81defa35b2bbf36a0841c0d7745a294373fde503989bfc22245ba45a1c9d253e7bda5a28381dd6ab9b677238 +Clang.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/d6d6a8fb56ca4e44304310f5ce7e14cd +Clang.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/dd3a039d3a3099fd8e0f135443ed9145891179437dcc1cd851da3b54d4815058190e2f6ede97d2f0357629e0d173395a86537732b0354bc87ae5815638d402ca +Clang.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/f0431cd3ad402d8faec1efcddd7f7fef +Clang.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/0d5e7b96a15db5bd09457aa27aefd05b8f530ff348956ce1699503a03adfd6abec84fee080aa5cac54a7d4eca42730f7f9cd6b13c23e3b13f4d2392f08fcf688 +Clang.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/1579ee70c12a5c38f84e9c52610b196b +Clang.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/91841937b8c1e3dc4c223a4dae48e7d4fa307df2cc692e512c469994bfabcba897078bc95c4141e5384f53be31d160ee750b60382005d7e5acf99532f47b4566 +Clang.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/75aaeadab3001679561ebd56193cd90c +Clang.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/7096f0bdb478c2cd76cee8f3ea47ecf8565af0702901f5c6351233458d2c66d3ea61e3f065ae9e90960dc7e0bd6fa1a0c6d160934fe409a663e4eefa23e6c5d6 +Clang.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/md5/987c4b1b50d9bb56e598839e383f79b9 +Clang.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/sha512/e3b827ce6f250a2264700991720585b154bba9c6713da7fa619a5e9e0829c7b02b909e3f73ab9149f58de2e27566a7d47723043d6de5fd027b1233452bd1d2f9 +Clang.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/md5/e8297a60b87199cab225418ec49503ae +Clang.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/sha512/9b341cdd57982d269df2d8158a5101f451f09031e1e784b593c78aa272c392eb7328b1c328a2f29d494b5ad4ef1e1ef96d01772f176be6395a8503f983e18d56 +Clang.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/md5/46f27859be1f7e162499e846d9532a37 +Clang.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/sha512/5173beba0ba2423c978cc3663e3b6673752efaef34547efe1e1015a18bc5cb1129ebdec3dacbe9894832601d87efffbebb263790d88ae198cd985636cba3fdfe +Clang.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/md5/00ef76971a4783c7e63a86ccae8b15b3 +Clang.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/sha512/f5e5f89f541df4b1da164392da0ea5397be62138e203f321b0b771942646530acdc621ca36a6e6c15df32c0d722fe9b0b5845c7ac58bf24966ae503979a6e8c8 +Clang.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/md5/8761cdd4810ffe1b3eb3537fb3e03218 +Clang.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/sha512/e5f011a2f74a032ef0ac429acc615b02d3d6bc07271acf2279afd947c1151914533456cf5b111ae7f4c868f7ee739ccd9623ce3ca2850b3cda3db53bfddc8aac +Clang.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/md5/0048f8c3014f9baf26e9d4e10ea2a893 +Clang.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/sha512/9ac2b0e47d86877bb47f5ff1bb7cfef3c0dcbeb813c770c29e2fac232cab0c06f39b5b2fad15d975d50a9590e9cce3c251e3a3c6ebd87b0656c93ed14a08c901 +Clang.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/b5833c865313b442da0b8bbe47a7ec51 +Clang.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/ef2c7cef9703248a0d09ae0a2b1d09496575411d6a846557a47628c9471824ec6f8b9ec361bb0c6bfe1ad5c27c1160900638b185cd46f21ad0eaf341e9caf600 +Clang.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/e76c4776341d23d2f87d87f2f9b32acd +Clang.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/e855521dfa1fb07fdbfb3afec0bf27d346bcf316c68dd0b3898ecee9d2e79f02d7bae9763e1c046b9ef6730458b40bdf35f737d0bece9a965c68223c6e1ada96 +Clang.v12.0.0+0.x86_64-apple-darwin.tar.gz/md5/d2522f901fe5fc2f1dc4c9d3c0a82e29 +Clang.v12.0.0+0.x86_64-apple-darwin.tar.gz/sha512/3efb4423573861ecdeaf0a82e7c15c1cc767016ceb9e9a5132a7ecdc2075bc0d8e8326d6bf9e02b649b6c324319fcea471d0e1727e595515488be7b39cfd07d1 +Clang.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/md5/88488b8e890dc41c7c6ac19d1b405a6f +Clang.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/dff87a31cc19147c9105ecff15cc0cc671a0f683b6dd3d86446b6a53c745256ebd1a951d0b83e26ad2e29aef6bb044b6c00d30c4647a3eaa0cad45fc1fb70f20 +Clang.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/md5/1b5bde42bd922cbcc06ffaa5c96f3664 +Clang.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/af499fc2aa6b35cb67414782a9cdb9e21dfafb2d5678c7ba9f95bbd92650c8b7f90879f86ba55b445ce4a42947ec495c1a6fdd6e768742bf8c3cba7552e2bd4e +Clang.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/md5/a3922ad0741b490daa6e21b91056324f +Clang.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/sha512/257732327901f32d3baa7e1fc202f266e578b5bb9d929949a900505b664213c9c8c132b109ee93f96c37bde3c4d2c7b806a45f44e93f55af1973fbe45c47c621 +Clang.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/md5/42a813253b2f820bfc4328c55687b096 +Clang.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/sha512/ab4843e2d252f1ad6435d506483c29c752573b6be70c363a3207e8a45d09850f2cec5381ac5491694e69ede5cf0b102f61e5f54d7bce81b049bfce9b6552e194 +Clang.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/md5/b17ec22a9dbb88dcf956ccfbb62f6609 +Clang.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/sha512/d885e4a50e6f57b8314752a590d5ae72b78eec3feb838ad1a66116cc2fb1b4254b77ab36bb86de416ad93e58dc2d60086eaed27ed29399f200355191daf43123 +Clang.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/819b09f861dde64cde72c061feeb1baf +Clang.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/4f2e8c402e2a184f115311f129fe731b6445422cfcf7ffb9b1ae577e9588f5d0de040ba6c3eac3263fd3d51cbf10ab822bed24be0a3d8766084adc23c04b082b +Clang.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/080587a6f5a463efc06362d40730334e +Clang.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/46e47a06c996094b385b5939e73ac831a0c08da7e113683433e0e559a5627c43242311be0d6f2ba992d65bc3b5edfab3045b1d06ef26f6b87045c14111845260 diff --git a/deps/checksums/compilersupportlibraries b/deps/checksums/compilersupportlibraries index 87a5d98c832f49..deacc52a102a3b 100644 --- a/deps/checksums/compilersupportlibraries +++ b/deps/checksums/compilersupportlibraries @@ -1,92 +1,92 @@ -CompilerSupportLibraries.v0.4.2+1.aarch64-apple-darwin-libgfortran5.tar.gz/md5/da6b125a14c8afc701510ef495ec48a4 -CompilerSupportLibraries.v0.4.2+1.aarch64-apple-darwin-libgfortran5.tar.gz/sha512/607fe8dd0e18301c4ae39b3dc4a53a3f5e262ef5e1dca85c57bf621bba0458839abb4dc8a35468ba4f30e199a2430c79f74836649ee1de33d5017e33266ed531 -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-gnu-libgfortran3.tar.gz/md5/d99a6e58fa807d660d6c05ce9ed0302c -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-gnu-libgfortran3.tar.gz/sha512/b2d23ed345f42a3f6704cc075b86bf9d0cd0e471b538337ddb6c696ac1f25fcb809f52a01beab807e44e5bb57a4b2c790931bb251d29795e74046a69149f3eba -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-gnu-libgfortran4.tar.gz/md5/92d99e83e51b7d74a7c757897af218ac -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-gnu-libgfortran4.tar.gz/sha512/1e0caa6ac57def1ea2fb15cdee2617227e9610ec285254c2882064fc876b35a1ec07ffaad469ad75e86141dfa45ffee63d130183f2b7ace331ff96917641d68f -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-gnu-libgfortran5.tar.gz/md5/d850abc973fc99cc9d814e2a9d634b62 -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-gnu-libgfortran5.tar.gz/sha512/1150fec9b23e7d33963e3f48837fcbe3bc57ce75defb8820d40fe841a96b92bb2ae2f8bfd68a236bf2644e827d97770a3f82cfa847a2eee393fbca20ac7eb1e0 -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-musl-libgfortran3.tar.gz/md5/4a46df38821119323610dc3a3de89991 -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-musl-libgfortran3.tar.gz/sha512/4e6879736bd642fefe7b15e53130ecfad0555d06a7bc65c8f9f2b406853945b0683986e04da110b2bf936beb0ecc686ac7bc85248d121e2ebf8925973c62583f -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-musl-libgfortran4.tar.gz/md5/e2426e6e1bb801b49805f44f890b6769 -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-musl-libgfortran4.tar.gz/sha512/b7cb4adf76d34543c468f42a84f421db7a3ddfa9ad6b677705b010e7cd14d44a454b6e91e2f748b8d7d862b32be17732d88c2c15d3d4c43be12f9a798cf17d63 -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-musl-libgfortran5.tar.gz/md5/89f6ca21d2208dfaa7137511dd5a3a4a -CompilerSupportLibraries.v0.4.2+1.aarch64-linux-musl-libgfortran5.tar.gz/sha512/7a4f861ffb066b1644ba18d86f744f6b9d546a35e89d4ee31d3515e164df313c17fc7894dbcd36fa29541cb85a0063cd405da84d5c00401c4047407568a746f2 -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-gnueabihf-libgfortran3.tar.gz/md5/3c6aa40c3103cf4421ce31da6436731a -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-gnueabihf-libgfortran3.tar.gz/sha512/d6df143490d601023fbd81b9eee671f22857d3a8da34cf4ddef7d81a75c65c5a28b8be957f0ecfa78da5ddc119b419a9a313fdb9f76ad15ceffd07d29d03f17e -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-gnueabihf-libgfortran4.tar.gz/md5/0e61fe0790e4bef56def41808370285c -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-gnueabihf-libgfortran4.tar.gz/sha512/3a4b3d7e4f0fde8c5ca82145d0b5b534c852b9db3fa3414f5eafa8969636ecbe46623fc7047ef1832de4314c188513b6014ca22dabef39f94773e4e8525e9133 -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-gnueabihf-libgfortran5.tar.gz/md5/fd4de3c2926f16ba1ad522b6fbbd82aa -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-gnueabihf-libgfortran5.tar.gz/sha512/f4557719615d12034ca66c55521366c34f555bf69da87263c12e137f2778a17861cf980c3c2c51bbb07cc7873a04aa14b4fc0b3452ddd7d84efbe51d74f68ff6 -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-musleabihf-libgfortran3.tar.gz/md5/abe8c779a1ee2eaf15a5f0e1a3435b88 -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-musleabihf-libgfortran3.tar.gz/sha512/50b9531bed2a137f06d1b8a08ce24404bd2e9c0438eeec1e6805dc1dfeb47e26193f6bd32e125e17a1f5390c44da08c75414029aac6b723b68d57ffee8f2d7e6 -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-musleabihf-libgfortran4.tar.gz/md5/295ff16df4d4f1d95e4b34a7c15ea3aa -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-musleabihf-libgfortran4.tar.gz/sha512/036a985fd449f37cd9c7e9977d13c176b039276b0a23867084582970d85aa6692fc33a7512b2ff77add180ca7ecca7fa99dfcd251fb57972967cfd7c1dac0c35 -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-musleabihf-libgfortran5.tar.gz/md5/cd4c4db7896d087bdccf17db917d654f -CompilerSupportLibraries.v0.4.2+1.armv6l-linux-musleabihf-libgfortran5.tar.gz/sha512/eba18b632136f95dc17c07d9fdf926251cdc17d963993516e439ad6a65187f976a28c0fa53e2a6aad7158e817f6b262b6786d8a483a0a575aa8efc3019dfe1fe -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-gnueabihf-libgfortran3.tar.gz/md5/53cf17a61872002baf4978f6ff2cf799 -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-gnueabihf-libgfortran3.tar.gz/sha512/ed13268cdfce6c37c55637cdf534092ce9b0309e4f998627a65e37238c17c1c6fb031e74f10865b5355172a1624debf1cec1b6c6487ae1c9a6f29e06b98194e4 -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-gnueabihf-libgfortran4.tar.gz/md5/88cfbbae6d8d694e1174aad15e06fd9f -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-gnueabihf-libgfortran4.tar.gz/sha512/f4cd5d4e46cbcc28fab7ad853c03b3bc1c71bcb2cb7e295f183311e1bc4c3790ba8cb8cc50c3ba8751ffde92e7d23d66a119b62cf110ae3ee2f59c162dc09de8 -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-gnueabihf-libgfortran5.tar.gz/md5/a97498d00965c13d69ae9b0ef6af6e92 -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-gnueabihf-libgfortran5.tar.gz/sha512/fa6b0a05b507ffbb67f2b247512b38523f9454c12755a26b18f80d5868e3a09f139943dde08e1c658fc6ad63986713281cc523ab677fffe1d48c0af9121c8cf0 -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-musleabihf-libgfortran3.tar.gz/md5/9b7f2c17daff254f4492ed6c94af2de7 -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-musleabihf-libgfortran3.tar.gz/sha512/e42789807f2a17783fcfdfe08c80939f233db696ec03c6fe2f73ed113257bc2977cac84c5b731c6e4f18c52bafe0b85348a99720dd2815e5697903ab4f16d968 -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-musleabihf-libgfortran4.tar.gz/md5/5df4ba6a775a231d3067dc5126222b9b -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-musleabihf-libgfortran4.tar.gz/sha512/a89af0d35943e79b7588ca4794384680939182d413997dfe5642a672efb13622560a5c36a0eeafee1dbab3eebfa69a5dadaa2e93370bc14a9767f9b4abb0584f -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-musleabihf-libgfortran5.tar.gz/md5/342270a5bb44984aea91e857ce7b4379 -CompilerSupportLibraries.v0.4.2+1.armv7l-linux-musleabihf-libgfortran5.tar.gz/sha512/14a60f0173bb10215463fd9a88f310bcd0a9c5d411fd72d5aa3ff0bf6c6ecc9590e0e51471088d907e0f22291920cff570f2b2da5e64f790ff1d1ff4824ae935 -CompilerSupportLibraries.v0.4.2+1.i686-linux-gnu-libgfortran3.tar.gz/md5/6f71074bfbaea42e65b8d54a03485f7d -CompilerSupportLibraries.v0.4.2+1.i686-linux-gnu-libgfortran3.tar.gz/sha512/33dd5656ca6bc78c2c151e593c3fc63b2962d4776f0f3bd18de988931dc386caa3e3c248ca913fcb249d938423fc32a7f7364ab21b936674a772b264f8c4eee7 -CompilerSupportLibraries.v0.4.2+1.i686-linux-gnu-libgfortran4.tar.gz/md5/a0d6b7c929cad48710f431458e9fd906 -CompilerSupportLibraries.v0.4.2+1.i686-linux-gnu-libgfortran4.tar.gz/sha512/0ac88f8f9158822f41761cd59e406d9d978d6b6e6858dc7e3b57484200dca5b2f8cca7dd2521e0ea1ebf3f781b04f31848fc124a96eea0e7f37f59d03732bade -CompilerSupportLibraries.v0.4.2+1.i686-linux-gnu-libgfortran5.tar.gz/md5/980fac5e2db2401e5a83d3e09bdcf90b -CompilerSupportLibraries.v0.4.2+1.i686-linux-gnu-libgfortran5.tar.gz/sha512/b7ffa357ac8deb9c1458526473e1878e9668ad7ae0ce984b0fa3c42acddda126cb7c1e0d3a1bf84e845f94daa9432d8fe989d51617ce9fb8e66e13e59022e27a -CompilerSupportLibraries.v0.4.2+1.i686-linux-musl-libgfortran3.tar.gz/md5/4076ddcfa6c2f23c301666e26f36174a -CompilerSupportLibraries.v0.4.2+1.i686-linux-musl-libgfortran3.tar.gz/sha512/18cdb52d8e99bfd7f81700dee3c7a1752d4cc097ee00c640cd378fe6621c32b4bad9da81e159432079525c54370518feacf74e9338ee32af4bc04908b7664585 -CompilerSupportLibraries.v0.4.2+1.i686-linux-musl-libgfortran4.tar.gz/md5/df0d1c7c9cae6416d4eb55af9af2dd1f -CompilerSupportLibraries.v0.4.2+1.i686-linux-musl-libgfortran4.tar.gz/sha512/6cf9bb0318270448074abc4edb0a373ea4ab17a4e363006f70477e4a9e3f847608344fa23ed9205adafa0c754daccd5d4c4b7628322351727900f12835b7e619 -CompilerSupportLibraries.v0.4.2+1.i686-linux-musl-libgfortran5.tar.gz/md5/6451c7b007ee4914fa96e152132dd6e5 -CompilerSupportLibraries.v0.4.2+1.i686-linux-musl-libgfortran5.tar.gz/sha512/ce15a66f47704cc1a7e002b89c74580a2cf6e7ed391ac0bcb56e6a913c6abdfd1f2e61721fe25c871fd7543a3a466f030647c8867786c53f39fdc14c17f398a5 -CompilerSupportLibraries.v0.4.2+1.i686-w64-mingw32-libgfortran3.tar.gz/md5/0db39343cff6f5a3e62535f914937c8e -CompilerSupportLibraries.v0.4.2+1.i686-w64-mingw32-libgfortran3.tar.gz/sha512/5499161fb358af90fe0287226ef1e11a72b64d412f5c89e38da2c367270bef520d0ea0622c37088a4a729093a5b6601a808f54dfdc6f64b6f24c3c1e05f81297 -CompilerSupportLibraries.v0.4.2+1.i686-w64-mingw32-libgfortran4.tar.gz/md5/4ce35cb3838e32862d21a528b3850279 -CompilerSupportLibraries.v0.4.2+1.i686-w64-mingw32-libgfortran4.tar.gz/sha512/601b569aa569dc68f7e4a4509ae233bd88b461da373e127b459768f6c22100b7cb5905c0025a3d32919854ac02b9d3073952bc1d68a1dd1b973978682cb70c52 -CompilerSupportLibraries.v0.4.2+1.i686-w64-mingw32-libgfortran5.tar.gz/md5/e8d6ff85569ce872142e55d6fff97309 -CompilerSupportLibraries.v0.4.2+1.i686-w64-mingw32-libgfortran5.tar.gz/sha512/894c4fc5e57bcd59958b536566ba04b27204fe31c854e7d8f82fd7b59eda84792d86379e1f994f6574c8120bf85c6608f69083c660180064ba1148928914e6ae -CompilerSupportLibraries.v0.4.2+1.powerpc64le-linux-gnu-libgfortran3.tar.gz/md5/b9ba022254d0945179b89fe214897312 -CompilerSupportLibraries.v0.4.2+1.powerpc64le-linux-gnu-libgfortran3.tar.gz/sha512/e141b870f3fd2bb69a2a5227aad3987a32caaa2280e3d59e70e3a1498a0e71eb30f454aaa1c2a5df0d72f18876ec8a336494707d04fa817eec3a8dc8f5dedf9f -CompilerSupportLibraries.v0.4.2+1.powerpc64le-linux-gnu-libgfortran4.tar.gz/md5/352054f4b9be20ae4e7bb8f41e3ea547 -CompilerSupportLibraries.v0.4.2+1.powerpc64le-linux-gnu-libgfortran4.tar.gz/sha512/7fab7e059ff57e1c76a919cf52dd6849850d918f8859208658f6b85bbbcef04567a576b4d824264d0743895391e1bb3a33c385cc196bb98081699a6b0c5e3420 -CompilerSupportLibraries.v0.4.2+1.powerpc64le-linux-gnu-libgfortran5.tar.gz/md5/c28cf8dddf0208fdb7bf981f3539413a -CompilerSupportLibraries.v0.4.2+1.powerpc64le-linux-gnu-libgfortran5.tar.gz/sha512/dbf6ffbbab2569dee117ed8d249c510fba31d0738dea173e7fa146f56a0a8602112467cbac3f83aef1743737aa63bc2f2ab40b9393dbe0a2efbe6a031c152a97 -CompilerSupportLibraries.v0.4.2+1.x86_64-apple-darwin-libgfortran3.tar.gz/md5/3a3b0b2d283ed9bc502c58c07a9c7ad3 -CompilerSupportLibraries.v0.4.2+1.x86_64-apple-darwin-libgfortran3.tar.gz/sha512/072e743b89a8609d0651b9d1ed2880d7a804bd1c6a13e5ac3d23e0212e721adceb764678a22af715e5f35a74434bdfdbb87c9370c282f3f8193a0bd354a03d91 -CompilerSupportLibraries.v0.4.2+1.x86_64-apple-darwin-libgfortran4.tar.gz/md5/1531545b7c2234be3e6c24a9e3dc7fd5 -CompilerSupportLibraries.v0.4.2+1.x86_64-apple-darwin-libgfortran4.tar.gz/sha512/51c3892be0adbea098daf66ee3afff6da2172f65af63cce24bf968c8e237409b0ad3a3ca89abce5c4b27ec96d89f347b45f4fb26f50d84e23835da3963ab1d86 -CompilerSupportLibraries.v0.4.2+1.x86_64-apple-darwin-libgfortran5.tar.gz/md5/3529a60ccc713a9a825fad7d2f3d07e8 -CompilerSupportLibraries.v0.4.2+1.x86_64-apple-darwin-libgfortran5.tar.gz/sha512/6e5fae2d39569634d7b9d583d6a8d785e5689a65e30adb0ecded87a3235586dc4fe210e76153e26e9ef2a583183834a312e84991134949000516a2accb3dee4c -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-gnu-libgfortran3.tar.gz/md5/ea74cd089e94203a6ef33754388c786a -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-gnu-libgfortran3.tar.gz/sha512/30a72e2a50ff152ceb4e9764c60bcc5113845a918eb69a08b8a70e54e9df6b7923f697f39c2e576c553108dfff2cc14a27078c698cc325fc69736ebd67d403ab -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-gnu-libgfortran4.tar.gz/md5/68075a244cb9f2c055a4b7b2ec6fab27 -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-gnu-libgfortran4.tar.gz/sha512/b49c77dfd2bf54587023eadc8cb64e2600fa826c99fb49c74325f1a631b2edf845870715bbd7a8bd4fe94233c78df632f9a8e433650c9a168c8fbc4894b6532a -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-gnu-libgfortran5.tar.gz/md5/b2751b7c72c0ba52d8a252e2d1f01dd1 -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-gnu-libgfortran5.tar.gz/sha512/454fc2ab7bb604e2a424507ff35f213414f286382963e0dd29443c0bf21772a9a5923bd81c77317977ca0cec826ee46408b079aedad8ade87db3f35353125c20 -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-musl-libgfortran3.tar.gz/md5/e691c3d13d5cd7265bbc830a28adaf14 -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-musl-libgfortran3.tar.gz/sha512/62d5e3928bcc00e2741705403d39c96236b7e578b63256f67b5e36d9a60c960007c18c499e33487559e1b677b01445af0541a1ac6236bc724809aa757eb55f61 -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-musl-libgfortran4.tar.gz/md5/0a1a41e1591bcb654a60fee50c041236 -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-musl-libgfortran4.tar.gz/sha512/ef4ce20e72418e72293b5a6836b90dac4a8975c50db4204eef6e6c6660588a8c5769998462f758232c54ba4067ca4d0a1172bee3460f92cb41bb75a75d76f96d -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-musl-libgfortran5.tar.gz/md5/2ceecbfa72398c12532403fbf731f108 -CompilerSupportLibraries.v0.4.2+1.x86_64-linux-musl-libgfortran5.tar.gz/sha512/ff15be3083eb86159cbc5df969305e7990fa2f22f86f73a090db6ff25ab1671288ac37d8b54ae95acaca0f281dfda48de702c87cd0126114626a954f7b0516a2 -CompilerSupportLibraries.v0.4.2+1.x86_64-unknown-freebsd-libgfortran3.tar.gz/md5/49dcf29be7810799c2d36e1f89e97ca7 -CompilerSupportLibraries.v0.4.2+1.x86_64-unknown-freebsd-libgfortran3.tar.gz/sha512/daf2fc70f8bace0b83b0317ada7444b6ef6188105fee403f76ddb043f2aee4c1f4bc04787d6a920abd583eaf32a078dcf680cae09e6f751b43a64567af4e7672 -CompilerSupportLibraries.v0.4.2+1.x86_64-unknown-freebsd-libgfortran4.tar.gz/md5/b446db483a6aa734c0dffe1f7f1f5c65 -CompilerSupportLibraries.v0.4.2+1.x86_64-unknown-freebsd-libgfortran4.tar.gz/sha512/d707d5af3c5407ae47d1d55745259855ba899dfbebf71e528fcade4830fbdbf0e8d215c41c745594b9db3dc1bc846e46222571dcf8eea8639a6037510e3bef06 -CompilerSupportLibraries.v0.4.2+1.x86_64-unknown-freebsd-libgfortran5.tar.gz/md5/2ae1eac30f638c88eef1fc6621740069 -CompilerSupportLibraries.v0.4.2+1.x86_64-unknown-freebsd-libgfortran5.tar.gz/sha512/c6585232b6adadc5b78c870f516a3ed1381b421fa58735b74e096afc69b6d08a169bd06662eeac70f63a52ea6b9f1f94d96aa86eee8b026419a59a231317637b -CompilerSupportLibraries.v0.4.2+1.x86_64-w64-mingw32-libgfortran3.tar.gz/md5/1cffa4d37629e62c17ae78f88b3ba3ed -CompilerSupportLibraries.v0.4.2+1.x86_64-w64-mingw32-libgfortran3.tar.gz/sha512/164aff25e92fab85a4df4ae43b0dcc628e4e8ff0afe59721a98ab9dfff01edbaf93370d8c3079f4c9cbbb3ffdd9050f85a53cd336f9947f19cf4a3b3ff8b4394 -CompilerSupportLibraries.v0.4.2+1.x86_64-w64-mingw32-libgfortran4.tar.gz/md5/0511722afd53392fcafe72932b7d1bc9 -CompilerSupportLibraries.v0.4.2+1.x86_64-w64-mingw32-libgfortran4.tar.gz/sha512/4edc52b6e15f19896019e0227b3c95c73b50cc16544c70d7506e05b1a20ba2a694ae8cfb460df453d062939bef3b09693d209922247a585c48043f269c40e8d7 -CompilerSupportLibraries.v0.4.2+1.x86_64-w64-mingw32-libgfortran5.tar.gz/md5/42fe08fa435e5e0bc71bd3135fa23d6e -CompilerSupportLibraries.v0.4.2+1.x86_64-w64-mingw32-libgfortran5.tar.gz/sha512/051c20c7f6c7c6f22fb467786b031c43c53ff17d67a87d82e2f0c01c7623a1787afa3bc46eb347cc2eecee199953976b6f7119f371ba8d05d1a8d4e11161cdae +CompilerSupportLibraries.v0.4.3+0.aarch64-apple-darwin-libgfortran5.tar.gz/md5/36348c1087386681380589f7fdbd383a +CompilerSupportLibraries.v0.4.3+0.aarch64-apple-darwin-libgfortran5.tar.gz/sha512/e3dd3c93a855a85f02190659fdc9f41e96332b74577c67a149f78c35ebc2bb193bb4c156104d4bf24ca278f5b8621e944807a554153721bb5d0f22b8e9069fc1 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-gnu-libgfortran3.tar.gz/md5/b9d432c6639d30f1c63e9a234c1f10b7 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-gnu-libgfortran3.tar.gz/sha512/f208fb24fb34e82a60fc37ae3acfca6a1cac7201b8b8daf29c3ac98e607d9eb94a51fe92c54fde287359a7398b4646e8df98bf359f7acd1eacf25b1b5ea16456 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-gnu-libgfortran4.tar.gz/md5/37ccf8848bdee5445d002b889e54bca5 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-gnu-libgfortran4.tar.gz/sha512/0b29ef79bf8b238d9778d72f0e404145536933d9f9185f2cc1e917b3ec7cb8cfaa33ff664837e9e8e6ec28a3612ebd9cb226c0938954594849b4267514b27be3 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-gnu-libgfortran5.tar.gz/md5/bde8da82e00ed6375716bbcba6b04c3b +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-gnu-libgfortran5.tar.gz/sha512/7d50d91d4b6430154ae037fe54eb8b321e57c4ef1f7740ce0633416d8e39e133d3049a36481fba8ea689fdbf8ee8750c99578f7ef287736476bd39e5b05793e9 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-musl-libgfortran3.tar.gz/md5/b58108feab2a1d546fc2c3184233da69 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-musl-libgfortran3.tar.gz/sha512/4079e9a5548426863bf610a1287f4e0c41fb701af95be66db12a805686cc89b6d3baf9ab203dd6ac7429bff8d1352bcd80dde7adf22bfae20688fd8a17dfe457 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-musl-libgfortran4.tar.gz/md5/00ab7379109240a211f492dbae4d31c8 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-musl-libgfortran4.tar.gz/sha512/d2d5e7165566fcaf38f97fedd78cb7c6df475a01dec262643c79a0d310ebde4b64f670ad92104ae5e7bb8b1004d211c8f7d2bd4df05b87ddd188db62b11325c4 +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-musl-libgfortran5.tar.gz/md5/ee7881127866d50c9d1fc76ef0ac50be +CompilerSupportLibraries.v0.4.3+0.aarch64-linux-musl-libgfortran5.tar.gz/sha512/8f622cbac6777cf14d98a6cfcea38d42296f9f93b7202eee501c9fcf02f112ca2833dc9c034beb0b79aacc85bef9d57a26ee672716ca50b8353e3d17da298ecb +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-gnueabihf-libgfortran3.tar.gz/md5/fe4c403eedb9dca880961501834bdc8f +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-gnueabihf-libgfortran3.tar.gz/sha512/de829db62f7e28b425ac04d883db62e45f346e2e115d364a6f9ace29681a73422109bab7239014b51e6174cbd6141902ee65868a5cd2c6836d2db43b07c7ec3f +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-gnueabihf-libgfortran4.tar.gz/md5/670dbd3088ccb46830d80edd4c64143e +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-gnueabihf-libgfortran4.tar.gz/sha512/43a419548597d2624c68504c405da1104007b80f49189dddef5f2abb0a7cbe404af80172d69d7b8b2dea516fa4bf429a73068de2959266f1bc796868ac926682 +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-gnueabihf-libgfortran5.tar.gz/md5/00a9ea852c32c503e405389cb322827b +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-gnueabihf-libgfortran5.tar.gz/sha512/741c34b253f4c785b1092333d9060aea71b73879bed96da0f964dda1d1367032f133abde335cc7917c2e04c8cae4c3e110a249518d5305d8a4752cdea7d3aada +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-musleabihf-libgfortran3.tar.gz/md5/7b4528e842d27c849b6bc0443255f974 +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-musleabihf-libgfortran3.tar.gz/sha512/8dc362faaded886ca1bf7c48f43847cdc4f6685e29b0468809d254ff44121061c49d962a33e37acde9ab00b258636a77213ded1f8570ad2543dfb0097f3a7cc7 +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-musleabihf-libgfortran4.tar.gz/md5/a8d66ecf146c17a5af2f7a6c4c75dc9c +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-musleabihf-libgfortran4.tar.gz/sha512/4fc7590050d18a3cff6cad29bdaed3ae1aad72a7bed3e69a14b726309cdd5631ba903998ae042a488c815f9668567cbbb2e779eb44c13fca1aee47f93bbaaad0 +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-musleabihf-libgfortran5.tar.gz/md5/4405f621357e9bc3178ceb24337385b6 +CompilerSupportLibraries.v0.4.3+0.armv6l-linux-musleabihf-libgfortran5.tar.gz/sha512/0c8eeda7d94c551e90cefc6ef5c41fa1d79776abd87f1e739e17b8507ae966c0a6aed10bf466f37c34e29e38fe5bd25d542829e25269adf971c0e8a9d640dfb0 +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-gnueabihf-libgfortran3.tar.gz/md5/2a37fb150af0438cbe768e8c479ff893 +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-gnueabihf-libgfortran3.tar.gz/sha512/d0f577f4bfa76c349f188e4573644a82a749f9e5c3293246de0347fda866c9a1610fe9f3383ef54ac1bcee774f2a557aa1c67cbfe76580313cd5f9a231df05fd +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-gnueabihf-libgfortran4.tar.gz/md5/f7bc21abc374654421385f27d653f3e6 +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-gnueabihf-libgfortran4.tar.gz/sha512/fe55de45a99817cbd7a4ac69b87744acd9804d159b9b9144ce24d401742c87b9621a388614da32dac00f6b5e78037cef88d37c2b14308b6c94f951aacb176e94 +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-gnueabihf-libgfortran5.tar.gz/md5/022cb4d36156bf257fc57a50124cdfcd +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-gnueabihf-libgfortran5.tar.gz/sha512/f12af33831b91fff66e5ab2964aa4fe520e3063e148a794d9840ed4f526e6741555350e5d6dffe7857c733d2f405e1db81949d1e24a42425c521b1dd71539ec3 +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-musleabihf-libgfortran3.tar.gz/md5/b99d07c03c91c9d2186999bc924eb4d3 +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-musleabihf-libgfortran3.tar.gz/sha512/6ded3253561e5fa0c93712a2a86efbc5b1bbdca26f2170876e855400978674910c43dba6dfe992537ce90db66e40b618a7fdc3753abae67940ac46175bbbf9b7 +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-musleabihf-libgfortran4.tar.gz/md5/c1d701eee76fd974ece928cb3e1a85f2 +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-musleabihf-libgfortran4.tar.gz/sha512/ad338863ddbe47ec579636dc6ce155b47b701b9d47c8f0bca93918af18e8df6da6ddf65a2e2042fb79b335d1df07549addb2e794cf1e8f41d6fb518259a6dcd9 +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-musleabihf-libgfortran5.tar.gz/md5/0fa43aa26c3f5a717945659ad00ad96a +CompilerSupportLibraries.v0.4.3+0.armv7l-linux-musleabihf-libgfortran5.tar.gz/sha512/387a676e4e79a5f783c3797dab0ab4a9ba3b469b66d008bbe3262751e94316b0f7ae6987db212f763be47e9cb5202b1a6740b3f419818b30c2f1251bf0b305fa +CompilerSupportLibraries.v0.4.3+0.i686-linux-gnu-libgfortran3.tar.gz/md5/e8360ca87e6f9d7e512d20fd0669ea70 +CompilerSupportLibraries.v0.4.3+0.i686-linux-gnu-libgfortran3.tar.gz/sha512/6441bfbd93ae4edad1cc1e7d8adedeff85bc7749bf68b802f4316117e81938fdec35620264627fca367ff2182b503dd97235f7871dc79e70cdb0b86712d570e8 +CompilerSupportLibraries.v0.4.3+0.i686-linux-gnu-libgfortran4.tar.gz/md5/088a85ce5999f373ead5f43e7bece97a +CompilerSupportLibraries.v0.4.3+0.i686-linux-gnu-libgfortran4.tar.gz/sha512/c3d75384c93afabb2eff3f84a13df8b7ecf535e8f786c5fcea78ee1902fb052854acbfdf9fda5d558ca19f285883836e6827acdb042a9d50ca65d5d0823e44e5 +CompilerSupportLibraries.v0.4.3+0.i686-linux-gnu-libgfortran5.tar.gz/md5/97ddfc865ec5218c7d2d092f65de71b1 +CompilerSupportLibraries.v0.4.3+0.i686-linux-gnu-libgfortran5.tar.gz/sha512/2328f3fd706078125badd6294159d860b2349203b85d77f2ecae914f3a41a99951021ab1124a40c358ea82352f6778a87f8094b039679356965fc4c8bb48beb4 +CompilerSupportLibraries.v0.4.3+0.i686-linux-musl-libgfortran3.tar.gz/md5/479a7a80865c38795cc4454dacebead6 +CompilerSupportLibraries.v0.4.3+0.i686-linux-musl-libgfortran3.tar.gz/sha512/cb4c79f6e5e9129b3d99f3f0ac17f395d696b9f354df966faebc27f6ea120a8592548a59e5f7a7ad124583d23c93d621f00069a4af07a4b41a4a1f474bded4e0 +CompilerSupportLibraries.v0.4.3+0.i686-linux-musl-libgfortran4.tar.gz/md5/03e4d7d3189be081e4b56cdfcd439b5f +CompilerSupportLibraries.v0.4.3+0.i686-linux-musl-libgfortran4.tar.gz/sha512/6c3f3b9fcad535a5e071853540b4b8689cde976a375b9406c93734e37d412f86069c8133ef85898efedd3b8fab0477d51f9ae681dabb00a66ec3f213e042bf82 +CompilerSupportLibraries.v0.4.3+0.i686-linux-musl-libgfortran5.tar.gz/md5/6b20e61bf6eef2bd8587d93bcbdf8ac2 +CompilerSupportLibraries.v0.4.3+0.i686-linux-musl-libgfortran5.tar.gz/sha512/2f7b0c63773f7c5e8bad43041ec30e727dffb665f4371c7ec5619648644c9ecc085674a15f0df20e5399d25d84bc8e49ce0cd29a5a438e7a828000395e0928eb +CompilerSupportLibraries.v0.4.3+0.i686-w64-mingw32-libgfortran3.tar.gz/md5/185a1f5582eede2e71bc6664294fe368 +CompilerSupportLibraries.v0.4.3+0.i686-w64-mingw32-libgfortran3.tar.gz/sha512/cc54dc1e1fe10374fd62d7e3a6159024dbb9638b90014e9cf6168ed63ee1b64f7a52f8c851315a340e5327513dfe939b3b04035631cdb251ec2232f8ba381d8a +CompilerSupportLibraries.v0.4.3+0.i686-w64-mingw32-libgfortran4.tar.gz/md5/ec4d496e9c5f3e806d78c30bb92f4324 +CompilerSupportLibraries.v0.4.3+0.i686-w64-mingw32-libgfortran4.tar.gz/sha512/4917f4755c3ccf223491d75baf729677d51abae00a66f7a66439b45169283aa86070bb314ae9256525de4b422b7213de9d087d0dba9a821caa71ec346f1138ed +CompilerSupportLibraries.v0.4.3+0.i686-w64-mingw32-libgfortran5.tar.gz/md5/4080d550f9a31d084c59195a98b6ed7b +CompilerSupportLibraries.v0.4.3+0.i686-w64-mingw32-libgfortran5.tar.gz/sha512/6048b61a476905469e46c4e15a7067f0f39451c7374e981212cc9d2a66bdcbd7f0503d9eef731bfbe10b174d76937d7fa349f079a652587fecdfb2c6d59a1a1e +CompilerSupportLibraries.v0.4.3+0.powerpc64le-linux-gnu-libgfortran3.tar.gz/md5/30bd967c069fbc73dc653f2ac9d55b6c +CompilerSupportLibraries.v0.4.3+0.powerpc64le-linux-gnu-libgfortran3.tar.gz/sha512/e16e77c72e3dd3399240bfcd72123da4540016eb91f10bd6015f0e6e58b397677b685c143527f5827423e7abb15abf5e461e3b74fccdb07dfdece2f0cb361912 +CompilerSupportLibraries.v0.4.3+0.powerpc64le-linux-gnu-libgfortran4.tar.gz/md5/073a8be233fae3c6b453684de7e51ea7 +CompilerSupportLibraries.v0.4.3+0.powerpc64le-linux-gnu-libgfortran4.tar.gz/sha512/3fda4c515131c75181c662fa4d5fd538a0c8e257673edca7f94c46509c641d4720c130cffa37512bea0a215b6a9952735acbe359fb38e8e341822545021d88dc +CompilerSupportLibraries.v0.4.3+0.powerpc64le-linux-gnu-libgfortran5.tar.gz/md5/4853c451821303959723f541434a7d1c +CompilerSupportLibraries.v0.4.3+0.powerpc64le-linux-gnu-libgfortran5.tar.gz/sha512/539a6b7626883d54b7661db6fcad1b7390ce37ab406a88065b8c24786353725f8cd972cbc29d07e71c9fefcb126239c8a63583626a0b8298c04b34de47bb9248 +CompilerSupportLibraries.v0.4.3+0.x86_64-apple-darwin-libgfortran3.tar.gz/md5/889855efa0450aa975166803fa775686 +CompilerSupportLibraries.v0.4.3+0.x86_64-apple-darwin-libgfortran3.tar.gz/sha512/8162aebac8f13264cebdbc8359f4823f25cd28c76812df8687b5801b6e133206b514cbad5d5ff0d6fbb584eecd82038049c5a965637b43a5d12f77ad386addc8 +CompilerSupportLibraries.v0.4.3+0.x86_64-apple-darwin-libgfortran4.tar.gz/md5/ed9f7aee0565904a8cbd5cc26df37a9d +CompilerSupportLibraries.v0.4.3+0.x86_64-apple-darwin-libgfortran4.tar.gz/sha512/e93bd2a9e4e2c358f46f756f15d9765ef5aef44e5ee2adbfb23e971f380052f4ad5e4569fc5932b6250a40e204253e70966a6554c30c0251f1d5406babdac837 +CompilerSupportLibraries.v0.4.3+0.x86_64-apple-darwin-libgfortran5.tar.gz/md5/6757ed75b520bfd1f6edf55f01f7d1af +CompilerSupportLibraries.v0.4.3+0.x86_64-apple-darwin-libgfortran5.tar.gz/sha512/5f50c9df89ebd5a8b2c6a97e99b8340b0e63e4f689e3062a32474fdd6dd33f160647ae1a2ba96a30abac1bfbbd730be9824dcf4b05a4c327c0ad60c9b96f889f +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-gnu-libgfortran3.tar.gz/md5/954ffb60eb3cba5d7d02d3cf31fc3c75 +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-gnu-libgfortran3.tar.gz/sha512/199738c5e226565230368e38183de6af66ac1decc880cb28e072aeba097b8c060a6ee51d755072d66fe955a6621d183f28de364f7d57f372c8ad7585e30cded9 +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-gnu-libgfortran4.tar.gz/md5/02c5342c240220803dea5edaa6aa03c0 +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-gnu-libgfortran4.tar.gz/sha512/c752b742d7aa39b7ac2297c8f4bae066c6c8217cb717cb7f913aa045b402350325e8ac96b0656404e39a891c825c57e18e5dc9325a954c7e64d98ece776293cd +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-gnu-libgfortran5.tar.gz/md5/5b2ca9ee08026e2ab9d24d18bb631ede +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-gnu-libgfortran5.tar.gz/sha512/f98aed5aec767e1145b4f19515c99927e30790f577494e6d439c7f1a24f7e8e2acb977945f616abeceb614776e329f1a1f852edc1ade9de78a0c94f619046e40 +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-musl-libgfortran3.tar.gz/md5/6e5a0d8521b560e79cb5d5caffa4c675 +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-musl-libgfortran3.tar.gz/sha512/7079605d315f45ebbd2a517b2aad38b226b574ee3f892a20efe02b8336654c84139a810820734456fcf6bb5bcc8fdd9408e783d1dfa2aa25168ec3e9b3e57785 +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-musl-libgfortran4.tar.gz/md5/dde75524ca38581b671d21c7ccc12c6d +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-musl-libgfortran4.tar.gz/sha512/ae229ccbb704da44f911704ee0700fe3e01730c9a5e7519dbf41c9e1aaf6d3f594678055845430e9c9d9b3ea974d1437fe2d84ae89f2886512c4569b9659a5dd +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-musl-libgfortran5.tar.gz/md5/1d13546f090e9e068540d5ca42f193f2 +CompilerSupportLibraries.v0.4.3+0.x86_64-linux-musl-libgfortran5.tar.gz/sha512/cd8a4a83a2f09f9b18baa719b0ed13e9eefbee765bce326854e29ca76075e18401b9052d70b13461f16b08219707237aba7e7857aec28d417bd5dddf4eea9dda +CompilerSupportLibraries.v0.4.3+0.x86_64-unknown-freebsd-libgfortran3.tar.gz/md5/6987269d8385d6b5716f075ab51ad5a9 +CompilerSupportLibraries.v0.4.3+0.x86_64-unknown-freebsd-libgfortran3.tar.gz/sha512/0b5efa2c22c9be737a1396d10779fbbb91acd8662a6d419ba76d98b380b5c9cef977ac2d60e27c844d3c5f083fe4b59a6419675d09b8bd3e5b2fefc74ac09e0e +CompilerSupportLibraries.v0.4.3+0.x86_64-unknown-freebsd-libgfortran4.tar.gz/md5/d430f7c46b66121833622ed58694368f +CompilerSupportLibraries.v0.4.3+0.x86_64-unknown-freebsd-libgfortran4.tar.gz/sha512/fc3c7bbf2c3730b68780950e4055491639d8874dc4b8509898722a4e7a06341cc43dbd7ed371e89f2a0cd11b515b0901a803f93349039b2c21aff6e453bca669 +CompilerSupportLibraries.v0.4.3+0.x86_64-unknown-freebsd-libgfortran5.tar.gz/md5/557985cb8720a3995482e13c319678fc +CompilerSupportLibraries.v0.4.3+0.x86_64-unknown-freebsd-libgfortran5.tar.gz/sha512/4d2b6b4431456e8067fd09b092617887277b4da3dc6e030d8091e7a9331c5fa73483f72626f6f06b3a749804b8060fc6ec8e592ecf87a3b1fcef96f5fc267c7d +CompilerSupportLibraries.v0.4.3+0.x86_64-w64-mingw32-libgfortran3.tar.gz/md5/aa27b022d98f489fb21c6d9a05b913a0 +CompilerSupportLibraries.v0.4.3+0.x86_64-w64-mingw32-libgfortran3.tar.gz/sha512/13d0f7e243674034b1d41a7020db58df6932a9a3d9a9ba450e1b673f5e56ff984ab68af8a3bf5a14590bfa43661a20d88a781d67009e3af9f60c15bf32e56196 +CompilerSupportLibraries.v0.4.3+0.x86_64-w64-mingw32-libgfortran4.tar.gz/md5/7b381af909065da2da0e8eb035fffb47 +CompilerSupportLibraries.v0.4.3+0.x86_64-w64-mingw32-libgfortran4.tar.gz/sha512/c35170eea5174360ebe795ccb79fe4d6c9dca288d8f751e731dcaaf26866172372b5919393a965e18ba1aa553b6f420ca8d8db32b8d38aebd226906e18b7a4d9 +CompilerSupportLibraries.v0.4.3+0.x86_64-w64-mingw32-libgfortran5.tar.gz/md5/8b4d1ee5add108fc05879fd0102cf34b +CompilerSupportLibraries.v0.4.3+0.x86_64-w64-mingw32-libgfortran5.tar.gz/sha512/23c7bd53523d8380491b97cd57083956b55273b8d6aebef2e1b5c80ce8593cfe3eab5ff50b6a417b974996673fdfb810ed2fc28798bba42ce59cfe6284b1ef8f diff --git a/deps/checksums/csl b/deps/checksums/csl deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/deps/checksums/llvm b/deps/checksums/llvm index 296796224f288d..aa0124f257b446 100644 --- a/deps/checksums/llvm +++ b/deps/checksums/llvm @@ -1,234 +1,234 @@ -LLVM.v11.0.1+3.aarch64-apple-darwin.tar.gz/md5/181e555215a01db6017bef6b75b857f6 -LLVM.v11.0.1+3.aarch64-apple-darwin.tar.gz/sha512/7940b4494e5806319d013feb42771884c320b964fc674abfd8979169fe32bfbfa03558195e520a108fd645a4c7a06ef918d59cd411dbd086b6a46f80e5ff2c9c -LLVM.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/b02bb670ea84bcca20f318ffb26a79fd -LLVM.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/f05004c2fd6fbfdfe502e4f83babb7c29f9863e900e711c86023e878808eb1a31ff0285c3288a616a2dbecd7dfe3036fdf4465a64633af723f10c2fce68aa84d -LLVM.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/9aae2250dca2c2e8aa305d0175596fbd -LLVM.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/0ca30244061b3bd6f0b0a6bbbf61fc40b02db00b3e9bca4aa79013ac12137aa7e872ba7113c6bad3ca08225431a9d9a4d2267852606e8360b866e5752f027965 -LLVM.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/f3c3b9667ec2ab3dd9f3663859a0a736 -LLVM.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/5b1abc1967009154a71fc43813a80d37e1c8531575938b2682212478b51591def16a7141292844568ce65f76bc686a7e9f7a4d77b9311a57226ccd43d8494d48 -LLVM.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/98505793b877160dfc7466284fea9e71 -LLVM.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/90a0b9d8da40eaf29d9d7448a3611ee264eb90cd947fa68a6e5e2757d580e82bfbe8ffe3d31c2c2f1eade66d2d4b69a7dd79830b813b62ac7bba289281325559 -LLVM.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/fdc1abc12cf08fae3d4e110976e5967e -LLVM.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/6157dec83258fff29d54fe2f3783a7975a4487a5bc1b98f8355054970ad958eb26ee11f7a2f60c5ab8ae5c8e799275fc712051b00039a14febd0db66520d29b8 -LLVM.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/2c492cfd7cac00863fe373f8d91ce84c -LLVM.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/654e9842373cb52114407340f8cf4c5954966ba677cae9aa085e22a3ed167bb1670286f3f3dcb6798913fee45937da0327817a97f48db021d997c22862b039ef -LLVM.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/81b6c3bcb6b5e595f5fc12aee8596bfb -LLVM.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/8360352c772c69f9cd9469b41ee7494534248ae0480f7661f9303747cb3a87e26d5659fbf32d7dd11ba70b4f24812cf94dacd7565b92b42c9d63da388b8e93e0 -LLVM.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/c9559f735a8419e77a874dd75451d726 -LLVM.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/64cb59c966a1f42d1f31e32cf584602cd1a6a3bb5c3d805197c8e3cd96ebfc1ad3959bf52be2767d88110fe0025307f1e1982e9029630dd5438e94886da21366 -LLVM.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/bacdfbffc987ab1e4e0a023c4f1cb636 -LLVM.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/d9f772a958ff3621f10bc562833a7121a4b3c3aec8d8d03694554714dd54537aa89af0e080f16ffdcf965ae33bd1bb05d9659beeaa86ffb7e553a4202b924a0f -LLVM.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/018802fd42e68b24459c4040df0019cc -LLVM.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/ddcf9f104f47485cea67d0e5862393c2161e6aaf2e1cced1b0600b5b2dfb3c35895d00e47349de298cc9164665cc8cc8af3249997b716872fe23bb58bb1ea370 -LLVM.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/dc1ccc83441df682b09624bf7047aaf9 -LLVM.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/b717137c831f698cd9b3339e5beb0a2e9d6fd8c59961f91d70b8e76d8b1ef7bd9ef610a49d02d45bd6e7130262f37601a780e33509b78e2b1caafd40eeead7d1 -LLVM.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/74749fde3378518041fcae2e447370ea -LLVM.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/b60715831b4583679455ceffe82acc19ef6c7fe3798b02f3df8a08a129a4f80fbfd7ab59c663db4f4418285dc3551e536c3edda2e24310d10cecdd89596588fd -LLVM.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/0d403181fae7d966c536ee0cd6e39c12 -LLVM.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/71728fdc4b559df058d9ddc6dcd1dfae4d2dc854e2038ba14baef62e1cba7f3e2c7565fd2942b069690497989e846d0b5a572e0bbea8de7873752e43bc6827c5 -LLVM.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/791e288d0acc976ddf18776540b21ca2 -LLVM.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/49dc3c9a2952f928d51c0af64c9f87b441c05a3f7c497be7564052936bb44c4e5dbc05dca3b69d9123d784647f6ca1c528ece5bc11ad39059fb8d465582ff394 -LLVM.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/da303f41ec8ad7329e826a5e94af8889 -LLVM.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/39deaf22f9e5c2422eefaea6d64c8d78d3235385edb43ce050f8f34c5c9d128c7b155adb2af5c1f0653f92932324f9a8a564df6dc97009402842e98b4b9a17de -LLVM.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/3c5c77b8534eb0756c112193e4028838 -LLVM.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/9b00f22b169f17f1766e40da5a7aee602cf0b1f34ae97cdd02f59f3f7613f192dfa6a0235764a175efe4cf1ddcc1850d37052ea45e16947f0d1ad79deb6812d9 -LLVM.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/757aab5c47122ed033f987847a95ec0c -LLVM.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/de54c3f21959ebcb081601deb01bbbafe415b05cc7240fce230483b2901d77f89575a74384fb55c919bfe25a8ca8cde2f2e0c6f4f6a809fc73499f4752f2043a -LLVM.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/c7f3d289428d68802eaea4cae65e043c -LLVM.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/54fcb15fd2019dc0f5c3db10c24c9d21d8159e923b215dd000d6107a136b69ff240bc447b2a280a023f25e98880a86ea89cd42e1e3caacabeb59a4ba18b96d32 -LLVM.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/a3032d9310fdfcea2c0e6aa2cc27fe49 -LLVM.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/a8f8c4739b17f902f08307dc2f154ebe90a229299d476d8723cffe504cdfa91a8c36aadab4c12c1db4ea8cc056de17b66e68e1f086ad5d30d5f2edcc53da2337 -LLVM.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/ba581dd66006b02e1e7643b93af14499 -LLVM.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/8037109625c8cab5e310ff95aa852bd792b35f04b6830870962add89caaf0efbe001d08d6f870044e998a7b14216700a806eb132daadc5c4accd77baeebfb15e -LLVM.v11.0.1+3.x86_64-apple-darwin.tar.gz/md5/9d9c737b6e98a41086a1802283730757 -LLVM.v11.0.1+3.x86_64-apple-darwin.tar.gz/sha512/b24025364052233f977c17bb5f9675b4404fb4b197f35752a8a2591ac9786eb8aa5b4053ca4269e6c4de9daf401f88b0361880c3b3201be2db91626f9cad9030 -LLVM.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/ef4535f1aaa5867e9dc4401e894086eb -LLVM.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/a1d7e4bdc72f33ec669023c89d4dcba8bd4b644e7c38e27784ab0f052e8efc08cb0cb89c38d5ee471961c8c8bfd6eaecc89898e70093a494f6cc53b9a36652eb -LLVM.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/bcae5538b46ba7241b429dd568faa1b7 -LLVM.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/f336e5d7d007298027efe39a9b50afb32376d1361622097fac6a0530ce8a834f0cfb6d8abf05cf964bb5159b0864bedac978fb95031cb84672e0bc0b037d03aa -LLVM.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/353ba4a877af02d2a986cb4917fc6cbc -LLVM.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/ea038f9a12a84df32e62d877320eb041d2363b1714ded05508b1fdfb2a874a6964114833a7435feaad1040fd31a533acd29e48731f49e8df3b60fcea04f565fc -LLVM.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/81d43dea36a9e2ba628263b1af36461b -LLVM.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/a99b2dbdaf55cd36e8ead346fc7fae4ecd430cb98895343d6a409d0ea95406836048638dd5ab73129a2b2a637abd1e997515d8de1e9e5e8449e0f9d747773d4c -LLVM.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/0f83ccf57dcb7814976a57c42c91c454 -LLVM.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/06c3a97b6ec4f9095e8e978ccab0e65e03d26f99d90485c7893b6a41a53a4e5a8e8e531592e20f9d73a1100fe87f7fad793dc6cd19b09ae0bdaec5c362b7b4ac -LLVM.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/8db6882c343f0ff1ed3137c1a17a1676 -LLVM.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/a3fbc239389eaae152f4a21e5b50b6afd09adeb75d8e32754dfba5da3815991dd05ef5c403ef9539bdd47cad3f9b2c7066a61e3f40243f7bd237a7480172be86 -LLVM.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/bee41a179343b54359aba1b159110a39 -LLVM.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/3db19d091bd52cfc2018a25f28bf7714f6337bd93b24349ad90d2954f60317189e5e65241ff114c9f7cd15933b685f0a4a193d45daf21af593fe2890ab98843e -LLVM_assert.v11.0.1+3.aarch64-apple-darwin.tar.gz/md5/574a70c914cfd54913a1d530f26a3961 -LLVM_assert.v11.0.1+3.aarch64-apple-darwin.tar.gz/sha512/d7774e12566563905079699b28e056f403dde49078fe49b5e0cf4dc56ef1db457ffcc45bb0fba380e0768c9a5e5eddfe88fb1021205f6ad6565b3c6dd2e07dfc -LLVM_assert.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/6a6866d3f5dd438410465ca3c75b0af0 -LLVM_assert.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/ebf55880264d68876df2a82e3e105d13834fe379942270c5b054c50f7eb3c8f4b821ac171a7081bb378b178ca386c608c1340db6d693885bd79d53f958c9e601 -LLVM_assert.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/a5623a828b84769cac493494c9c6d3d0 -LLVM_assert.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/410ed00c107a6e05f322d4ea6eca9f16f7e4e986c335201e4a7092cfb20d7638fd9166176414dee782d0e656ee4b2252eea7055dcc526cecf6136ff47033dcf8 -LLVM_assert.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/bf3323c7d6480fcfd75834e3240e7582 -LLVM_assert.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/6fcdafe8de348020c4ecd75fe3ab0a7fca833b97545a4711c74a0f7646a64f302577c5d4bb55a77fb65b4d78dcabee670ea6c01f88c8730a7b9cc4fdae824557 -LLVM_assert.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/fdc19a6e662037860b0a17d9b6c3a57e -LLVM_assert.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/c30e08f6f2b926716e4e8594cabe66ef555eaa1f0cfa2ff578bc7fc550facd7a4c72eb3315dc68b11a4a76c62032bd7d6ca42ef472bafec76e1354d51276ac94 -LLVM_assert.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/a570eb7a0a54a2175e8d65ba4d575bcc -LLVM_assert.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/4944957b89ae0b61cded44f2fae879449a3d0bded0f4f515f0d1cdf6cac8bf834f5665b8d734e56e4818b07c639cd2617e033042fd358888a4bf808be1984f43 -LLVM_assert.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/f5adea7936399d7ab1eaa8b71735e1c6 -LLVM_assert.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/40daec8c3dc618e54032d645ab7d5914d1be4d02e16e5368b68826bb0c34461c767240535f757cf83afedb36b117cc809a371d7ef1e7d369d3d9ab19ba293f52 -LLVM_assert.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/7b4759412d408ffc5d65295f2f6c31b0 -LLVM_assert.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/f074208696be67c8107c8a9d188923642dcb839db82a871c5ee9778295ec5b18f7a7135fc65e4a0ac51cf20254bf1902f83b347fd10fa4e9c618acc9b52cb1fa -LLVM_assert.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/d0aae4b55b3940727c4f88f7003e83bc -LLVM_assert.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/ed62c5f919dbe72991f8466ba35ccf4be70e9deb4fcde47674acff75a7db7e5c4c4864dc3bb8869185e607d6e7be318b6f164465cb36b24f09426348701f51d6 -LLVM_assert.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/f213dd3241c44763703a140528a05005 -LLVM_assert.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/b2b56174fe9c5d6b8be0b111e0326c5916b6c7b97b8fa1c488ac5135a27d522d2422ed833436f49a76effdf575b8709025cab73a9487e895e3833d98f0d7c164 -LLVM_assert.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/84f215e794678522449f8a8de56d9372 -LLVM_assert.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/9d2ce1d97c9323481b6a6a13c8b3866772d3e9047b4969e3715867de903308887ebcf7fbe9c417f5a8f21e9fa3e5d6b0bc72dde94b441074d0e05aebc5962d5e -LLVM_assert.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/9b65ba3b076d4d1d4ba9ee6eb332350d -LLVM_assert.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/cf952eaf6bfc00e346985ff17165349309e9602edf2f44991897cdba4f1ed59429792bf7fe1d32e27674f7ec65926cd6ba070d62f35c812876ab685b517e0b49 -LLVM_assert.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/95986e68c2d10a6231520d727cae100c -LLVM_assert.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/065c99fcb52ed9e0f750715412f7ed80ba994dab3d6618da768b65ece144b6a17d4032604b47436f02f69c0f98b628245324af37c06a85166baa673bce2732f5 -LLVM_assert.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/9388137e938f1e87ec0f7004989e29c4 -LLVM_assert.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/5391a1e53c24456d9062a87c1cc7213a3042e56d9e97a2b775e77af8596c1acc4b1fa0ae860db834ed8b2033257222b7993b2edede59ceac2dc468a3bb590b20 -LLVM_assert.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/ec4c8597ab5a356e53d405e2d2b2af00 -LLVM_assert.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/0b088ea2a639d17945c7bbc52505c108d12d9ce3c22b4083c98ba47ce4450d90dba025491a3fbebc6a1ce7a8098b3655f9cbaa828e9159996a8f735359fa5efd -LLVM_assert.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/51270032209dbca8cab5e083fc1bdd74 -LLVM_assert.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/7eac24bb3aabfbe3bb64c4a28f4f8939bbc6677eeb27ed377d69ecdcff8e7e8cafd792181db41873b09ede991b0b5e02d3bbab5d21da120d2cb573fdd4849bff -LLVM_assert.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/323faee592864ff277b73ba03227d5bc -LLVM_assert.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/a45f96554b234ea03560338ac4d94af292af9731bf9022a30dacaf6ffbab293d599787f8aaaadb95de2364379037953ae13864b6fd4baf4281cb565589aefb8d -LLVM_assert.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/6fa5b4a5c945d91edd07ac663a7c9b32 -LLVM_assert.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/0e1782adbfc5d27c3bac951580a8bcc0683963fda9f9ea5b98d50bef11e5b4d61d59216a24006e23c467ed46b7f0e7bd4223bd9732642e729615dcb23910126b -LLVM_assert.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/7d17ae9f78a02936d4c5f4d764940444 -LLVM_assert.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/bed864a3b8fbc6a178be479bb4ffb5c2fe8d24059e08a626dfc6b8bd75f8b7e7bb7758e38aa5da98e4dd1ab6e3179b3a968fcaf309a06b4d663d0d0819053241 -LLVM_assert.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/4e774c9ecedb46eb3ef189bff2bfed8c -LLVM_assert.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/de1220a01bda6065cc125bb968de7d7b1c4f54ede47e3b411dad02eab38d620ef2016ae4a71034ce7c4d9996b615e190c6ad373b31d045d3e3e78f6d19d9dc52 -LLVM_assert.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/2559547bb81c94199e3f165983be91cb -LLVM_assert.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/deba81e6bd36e0bea4a5627570807d9942adb578f79a7a0bb32f5e489219d1d0483ccd6e5ffec5315b1582fdb50f67a985af6f738199118fe6aa7da6d4838f63 -LLVM_assert.v11.0.1+3.x86_64-apple-darwin.tar.gz/md5/8618c79f170124dd5e585995fe028d45 -LLVM_assert.v11.0.1+3.x86_64-apple-darwin.tar.gz/sha512/68fd57412805f12c81525fb4ff5d9a3223b3fd435f7828d47f914dd5af7d6ed546d0b37b94bcdeb57fd0aad7ab672353f547a62af0b2da5f941b5ad03b65a00f -LLVM_assert.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/825d637c6c1010431f567505b1639766 -LLVM_assert.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/42bb554cc858b8af03f7f3b8d99ba017a5948951e1b653478e52477eba8a93e9d7a2dd9e50cdbc3ed6563483b01b12b5142a7aaae3534f4e5bc88b5e9298b3f2 -LLVM_assert.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/dbf66bbc19a9c4331820e570e70456dc -LLVM_assert.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/914e4831cb6873555739a300454cc6123634232a4bcee2bfad6e405e4af8e55f36b05ea4d164803b1b46ab6efaf2e38e6f1322962d044a21a070b53b4fc749e1 -LLVM_assert.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/9ac711e2feba8e641601dfa934499478 -LLVM_assert.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/f6cd0b432e4b19b2e5d6ac48aa2173d606a1126067cdf8d35b32dcf0cf8cb032a9ad537256fc7e16fab3173147240589969799c70822b7bd126c60b66566c519 -LLVM_assert.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/e0262bcc1991c3d2818e0ab2cb06cd5f -LLVM_assert.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/cbe609b686ae5a09fa54878a8557e294331e3c384a7d4a6385c9feb66f0087208399a0f7b55adb267a38704c4fa3850e7254dd8454f78933a1bf24fd15dd1f40 -LLVM_assert.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/5b63bc9dbb26c2c707391a0a245e9f7f -LLVM_assert.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/6dec55c91ae2c2384eb1915ed1377bd987baa82dbe6dd2382ea866f2c02a8415a0b0d511c1ef21dc034b199801523d4cc9c0e4b58c6c590489f375b8be845794 -LLVM_assert.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/1d14014582c5fc00067a9c7383c9cf63 -LLVM_assert.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/c304544b642a715f99d0b5f50e8ad55b8acf79af64169b7f1a6e3ae75d61317991afa352b5d078845cef20a800eee36fc0b21340c6616c21b9706f704b8ad7cd -LLVM_assert.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/1e7dd492c73e042da4ab0b15f885add1 -LLVM_assert.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/94cce6053b3d8cbafb98d7f737e51f04c044376c3203c236d228ed61d0a65cb136d0dd355609fbc5d4746794610d18ac3aad8168a61809e4ae4316dd51147587 -libLLVM.v11.0.1+3.aarch64-apple-darwin.tar.gz/md5/7b2400d9ae3ed7a9091011b7951c8ce7 -libLLVM.v11.0.1+3.aarch64-apple-darwin.tar.gz/sha512/9078fc8c24d1749b303f5c7843bbb6b5322080e4adfca0b96d7757454783617253dfcee07f24d1adaf3768563d298029a69bb75d39dc0701d024c27c66e50fd3 -libLLVM.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/712ea06bba40025d5ad86229585e1eb9 -libLLVM.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/6260d68dd30f8950370db956dc85ad9ba1e474e9c27781ca2640d8d669d3fe34fdf2e020922e4f11d88c4394bb1e72f81f211e656684682207418b954f78102b -libLLVM.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/941dc9c8a4d11cd7cc0bf5edb47ae822 -libLLVM.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/0ae65d99a49713aaace58e31f539c07727c34f30e089134c64b96b35dd061f44fd9889372364b1c9a36fe295a005160210cdfdf937c23e834ffa1b4260c6705b -libLLVM.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/1bf46309788bf2827e337376a7a7355a -libLLVM.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/86dcde04d89730219b22dd67ee113942ef689125cfa6d3c5294387561b7771caf948e889a0cc93128159427704500c793b62e6a6cd39a372ff6be735fbb0fdf6 -libLLVM.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/09e727bddee3132c944ed1404c421c2c -libLLVM.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/00a5f853557ca1f65fc807d3109357b211ba1935de66e2d3b59c8e00b4837c04b2ea72d6c6417a8fd788835938abaa8a4fed9e36d3f9cc009260150417465d72 -libLLVM.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/46e656d8225b534bfcc01f7ceb8592cd -libLLVM.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/325f4d521fed87fa75b296dfc8ea83e4fe5b04e8902f66d15d2f020b5b32236184a7b31a92eb5e0acc9597b1a21f94e6b4101f9844615767b03e6c2782c08760 -libLLVM.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/26c52c856334ed443dadb7874a808946 -libLLVM.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/e1bc796fcaa258e8c650c83c0b533f95bfc932c389d0ea507fbfecfd1d8829e746d53377508f909971d83b4247a0b31c31d2d1106cedc84234536ac19d2dc37e -libLLVM.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/c223e17dc0eb63e02625ed269b5c4064 -libLLVM.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/90d29712769299ff526c7c7a4307bff6e519e1e5d991b4bf4279f5231263eae6103f0887ed2310c45052c904cb05d5b059ecc3ae0d124540fb0886f8c9cbf61c -libLLVM.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/54def908d9d9d93e0c16770344761dc3 -libLLVM.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/d89b9ef23fd2bc0f974e343cf4254747a4ca2918bdcd9080846a56f2580626b80c7fe326488083e57330d857227e7bdd43455fd5f6c9dc90fdd0f9eda3c751c0 -libLLVM.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/c927115d9435d5712dfd6aec848404b6 -libLLVM.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/53050300ce37e79900677b3a447570b19518bc3ab0d13958274544686bba378742d7c6ad87b850a63f825a5fbeca0287f8b67332adc81962911e43cf952c9806 -libLLVM.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/3dcfb85331c0bb7184bc10403a22447d -libLLVM.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/9615b09038238a1cdabe1638a5550feb8498c9889cd805c5876350d7d5185a4ba467f2a97d2c4e192adfb59cfea76afb109e3c9687de183951a535b6b8271d5f -libLLVM.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/8b918180fafba11ae565771ed6839d6b -libLLVM.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/29bf5de468872c0eb90603d2981e891536da58d60bfb2d0c095dbd9ad7c3390276117164077bb89f95ed3cb21a03c0e1245c4a92cd46bc9ed25e4204fdc69e8d -libLLVM.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/3f7054e973baa77535629c08f7b22cab -libLLVM.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/e10819701d77d14bf28bae2fbd69ea03007ee6cce1d6c54e9dbbbcc5dca8d6c2351ee21007ba19da827c445626f5b4bb7e345d54971ba1a35e04278ed9d9b83c -libLLVM.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/16c1530e3df1d137674503bf02423ffd -libLLVM.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/8284f5a7cf1f0fa8664031e16ebc12b7d5131de8efc7bc9e77fdf33a084294e40917f723ba9b9f56384f527ffb7bf4c7f04a2dff8953d25a2f473c90322f61d2 -libLLVM.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/81670b1d368e9791705b71ae56373952 -libLLVM.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/dc0525dd275492ccd24533b89aa91a85660cb30cc3eb22f3c6fb10c854c890b5103048c802e06566aaf60d70bb00806ccd0552945573b78cc797295918968fca -libLLVM.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/827cfc808c50b301c1645a21327692bf -libLLVM.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/dc504771c7cb465e40e4f6ce4b62b1f5114018209010e7bb199c2753438c1c78534d1aae39246d06fdca96f799b20c89e20a51cbf06a9ba318d0ff827d3a8519 -libLLVM.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/fdb9e3d33d3b0e2051548d6a55d03daf -libLLVM.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/2cdf2fd7706c4e4ad80b12f6fc77a0389d4d015e3550c346f17fa0905dea058eccdd8e5b167477ff8ffb74cd1fe673af5c7ae5a13404da0b59232cb0e66669b7 -libLLVM.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/f486dfa62a336cd7d9e1b00602fc1177 -libLLVM.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/8264c0cbd63fc4dc17472526723ce6ce4072b276d06a95156a259f8f2b2524e1ac6c5ca768a974f8f1b65bd0674336f7922225d4be5edb90680e549774f7d05e -libLLVM.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/fbf1949afaa7e4d14722fc21c3dc7892 -libLLVM.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/3c897e31218f1975456d2769678f99c14b6308a464beea2fa6a4f534f355b5e9a7ef51c3f5fb0f44123ccb3c4854b906b96bb35a9ec01e1a1f39df903fadb30f -libLLVM.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/2e82ea13c59bf22f085768766d6dd8a4 -libLLVM.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/664323d8461e5c64e26d8fb84d3d4bc68a8bc2020b3b397545aa651bfdc0539b83ca2c9bec80314322ce821ff225ae48e96521e23b159a684e74a244bb02bb72 -libLLVM.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/04f3934d4421e452673e015dbbe052e7 -libLLVM.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/b8a0a8b6c56dc0ad4b6e179efc8461e69e01e69de8dc02b46644f74dcb859a5d6ae293b38b2091298e5024b7bbef041cb5332b095e6a3be9e44fcb8c21b54353 -libLLVM.v11.0.1+3.x86_64-apple-darwin.tar.gz/md5/487f852d540a46d03a804318067cab8b -libLLVM.v11.0.1+3.x86_64-apple-darwin.tar.gz/sha512/9158b5c8cfcc3dd75d835d6fae6b026bd57aaa60e8685d0777de8b31c5b644b40ac470a38632f6b0aa5eed85e1d001d3789a7f2989530f03f5e8dd95b947223e -libLLVM.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/6f73bcabc8c748b997ce2d9433e7c910 -libLLVM.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/3152c54501343e575dccb928e55f2624340cf53e84dd67cc606e8a6ec18bd3b8c4121089962fd99af54acaab70279172b65aa35fb7ee50b53cc83db188febc07 -libLLVM.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/4036faca6177ec29d38ae3d93e0a757a -libLLVM.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/0875703148d4f3056731247a6395c268e7a34edb5b25c9e1cddf507c13afd2f03d261088129fe822028a02e34842e41c48eda20b572b33d714d17b5b7c6f549b -libLLVM.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/b1aa10a625f7e069023e10fed0ce6ff9 -libLLVM.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/b196521d0fcb830f137d4d67526a3fb46ae0f7591f290e3e0e45c7d2d412518d6b29e005edb38fc5d56b987f5f47f7bd272addfe0cfb1a9e41752f028bd0750f -libLLVM.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/154eb676aa0b1fefe0f4bc2418deedc7 -libLLVM.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/91a79167fd025092a8f36cc37909a2b3f2591cb2f00809a6846e7abb8a41aa1c2f0f0c1e29d4365266c79c3cbacdce2325b58d09b1250806ea8f9e031a7b4c75 -libLLVM.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/1a566cbd9e79eacfc7a76ac3defc4b6e -libLLVM.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/535a4e7c665d34e59b5490066373ce21c400001ed86e38b4f5ec7de9ea758b91fc58dadadb239213c4e27185eff33a29466250d978d3dbfa08e794f50ca6c3d7 -libLLVM.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/97e8cfab218937f77421285f0dab30ad -libLLVM.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/cd514c19006f4f997b8530109a8b2f0099df1e0af7c0e5fe85dea65b01056cfd2b959190e17a3da8a3a223c59859aadd7486d1b6a71ab3207242e9bea891d546 -libLLVM.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/f4ab87e307e014acf4600dc0a1d8120f -libLLVM.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/a44840a51cad8a7d0db296a3f3613372562c3c5464bb2f1a8e0352d9e521bcaa83053a70d0e369d75718cdd142584f24bd727b6717401174a270835ab40205a1 -libLLVM_assert.v11.0.1+3.aarch64-apple-darwin.tar.gz/md5/1468270825363bffb3d99d3ca9216d7d -libLLVM_assert.v11.0.1+3.aarch64-apple-darwin.tar.gz/sha512/b94c1273553204440b5f51a3b1fa8c96ad8eae2090e50c3cf10fed44f960e5d0a6c95d967b7e006f842d550cc59b06ed8585962399772e1c2d6d1e6cf7686567 -libLLVM_assert.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/5ea96996524ebc1c69794d7e9ba2b252 -libLLVM_assert.v11.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/8fd7d5debae5277a5d099c24c195ed1c110f95169bc05ebe42fbb697683f2012a95507b682dd978a25918582dcfd548233d26a3e74a3098e85758dd63b5ba98e -libLLVM_assert.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/49e5dedbdcad40a5966aca51c8913d3b -libLLVM_assert.v11.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/107a57a298416760c2f806901080963c2b1b3d09f16bef698db6e28b084c36f86796956deff096b4e014a61b29319e1fe1ed95f6a807ab3f1a6350288f85160a -libLLVM_assert.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/7d594f4af283181513816fe50d299861 -libLLVM_assert.v11.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/f074bca4a57c827c16558783b7efe8d31f12d4a0500a374ed9303a4beba2e848343d9d66da4bd0643c8df10004a6b7a9074a0f99bdba6e2b7eae939a892c7a0f -libLLVM_assert.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/1328f6c829ddc5361e5217aa9d2ba1f0 -libLLVM_assert.v11.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/238fc6e8eeed72f6fc23b9ea5e9083b8812447799fbb73ba13b2613c6ae0d35cdd8835276e8c9e34450d8c682121cf28601dbc6ce6c160ccabe7c36043441d78 -libLLVM_assert.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/f863e9b6afea27c93b04575194bd83b7 -libLLVM_assert.v11.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/deb3d89d5cdfdeee2a8665d79e2cf77dca693c66bdfd5e10fdba9cb54cefce27a85aed76804ade511a65aff5e1a99f66748b827253ffdaca6c5c55c5947e4d5d -libLLVM_assert.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/0fc8a804ddcb6bebc2ca285697427a60 -libLLVM_assert.v11.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/8cc0f98bc20bcaa47a6c6e28a559018b572b27c2c3507554abd2d5a09ecc36219881ab391625f47a581cf7a569534b693760abbe3b31a31b111c3a751051bc55 -libLLVM_assert.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/eaf1aa0154ba5906a48848b1fd4770da -libLLVM_assert.v11.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/e4531b5eb09be3ac6440e32dcface0360cc75595da00fa1bd178306e9780bd26eb7413a705d4b49d3d7eafd8f403a448bad9aae40bad56fb40bbea8db75e5f06 -libLLVM_assert.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/57307cc154a85a84297f94f71593829d -libLLVM_assert.v11.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/c8c8d35982a7df99ec468b688dee8ccf627512c6f009aea27cbd7fc8d350bcb915136753c18fc1a0ebcf621d9540d1995fae3f7532c31dfe70f1b3ea07275695 -libLLVM_assert.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/701b49c22b69b6e4a91cc1559b3b2622 -libLLVM_assert.v11.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/1173b249d04df31a3d17e120666953654ce3274b749e137a24e137faa28b424a3a60bff9bf3c23f8299cdcb6b77fcf883b60654abced4b854e6080788a4093ea -libLLVM_assert.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/e781f504156bdf748cbebbae86173fcf -libLLVM_assert.v11.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/572d0eadc5f3c495aef529d03fe3a3f890cac655fb7b8fc7dba92943023355a4494f72a2de5bb302756d5bbc36658b32babe4efdeca2f85f0b9f244f3c5e650e -libLLVM_assert.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/b460698fc6f652366a0b869bfb2b1646 -libLLVM_assert.v11.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/00f3caefa2885be6550f20a86048057b6beb17044ea822ffa9fb9df65c848eb7ffafbac4f6546ca16a1dfc344cfb851b7d42cc3a7f3f8a2b19a5044748a6f64e -libLLVM_assert.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/b4f0efa367651e7e37976cb7052eda02 -libLLVM_assert.v11.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/5af81df4c76dad4ab5387e3006f350f9387dbda5b131adb2b75669dde284a281af34f041dd00a0e8b6e0e8e92e7e4138fec5f83a6e2fc82fca8c3c6a637900a1 -libLLVM_assert.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/ee47fdaec1107506ace19f70d090622f -libLLVM_assert.v11.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/32c7702bc599f06be6c5403574b1cece6d07b2c9787bd3b08e73a3746a187956609f2b7cdf0c673fbdd3105030138cf0c622a08e59f4180cea5109cc486fc570 -libLLVM_assert.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/d6a47e2c969aed82c377f42248b54b75 -libLLVM_assert.v11.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/c95f7e895832deed7d99155ada1df46e1dd1e43dd24fb8aaf94e4109f301b8163b8c8f83f3a2fd65d7b445e4d194f456e2cdd93ba36ed70ac4131c805a0c89e0 -libLLVM_assert.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/158ce4bcdb7cdf26faad269a6133e2eb -libLLVM_assert.v11.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/f19f556f25e602da754e666476686411d484297cbe1d51f8d21e167feb241c44e1b94d502b4984649340c515dcf38a53be9d949805c29ca0e959101900f68fc7 -libLLVM_assert.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/fe72914bc292072e1f474ffb41e01a99 -libLLVM_assert.v11.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/87a300e6928b69a4ddc59a375a9c172cbef82dd14ee101ac97ea1a652e1e4cb69d8c1ba61f4e4c2889884c58a571a257cd3390a504ceb88b0cb4a514143541b8 -libLLVM_assert.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/309fdd429e740941e0deab08f1043c5b -libLLVM_assert.v11.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/b01bcb83a6ef208692bd26899e7e75177f6bd619afeae0dc46217ece0f79bd81d2f07fedf70084478fe1f8abcc2d031a0ea06b55ac55a34f3facabb38a2a993f -libLLVM_assert.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/a9ee212809e891f147916cb6568f8b0e -libLLVM_assert.v11.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/927a010c326dac7faa4ce822b7ed01048b825a8050ae03d11963a864bf8f70b810e58985d37ec04cb69e7ca5c8a4956438f8c5f50dc8af90dc00bb10c0b6dd28 -libLLVM_assert.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/6a2f2cd6cad70e27029f4a7c78196589 -libLLVM_assert.v11.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/77bee805988a0df69cda34c5196f29234d5e4c7cf55da2154fd5a4f431123cfa3ef870a7ee10dd773eeb446647f500edca844cc89d1fc39d04caea6be58ce6a1 -libLLVM_assert.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/f780073977fddf46200103b476ba4176 -libLLVM_assert.v11.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/40107288f36fe50e8f60fcd7b18a9058f36a6794cf8e8f06328437fb77f0890e1b890aba7f931329d98219faaf922dc14474f66340e6a70b8309f171e2bbc901 -libLLVM_assert.v11.0.1+3.x86_64-apple-darwin.tar.gz/md5/db4d528b06836c46d46755fc93cceaea -libLLVM_assert.v11.0.1+3.x86_64-apple-darwin.tar.gz/sha512/cb62a0db35f0f1cc4723c2313eed265c4e11dc6b225d5b30afd7e2aae0c79b0dc23558640a409862a31ccbe337e4c6e4c1a35f3c93251a1c714dedf5f4637716 -libLLVM_assert.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/b00cef3645e589cb217d8df10173124c -libLLVM_assert.v11.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/4de8fd6f90a5f85278c1045731e71855969b615e228a6b63bf53c84b145c3d8db4a7fc236301249e6ac195ee13fe62b0c23dee1c50c968ba74a1f9857e5ae3d8 -libLLVM_assert.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/d326d3cd8918ef4abf4aa26a93f77310 -libLLVM_assert.v11.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/ae49a764b848d179d8799793a79ba3cf03ece82d84e4d26b1f48256ce159984b1c54439db1f7b928f0526a85fb3b11021e9620104ae0404b7b85824aeb59d42f -libLLVM_assert.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/10f34bf03747a92e6cdb6ed206b21724 -libLLVM_assert.v11.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/ed06c31ae0024e60f7ac3a77dcde37e8aa545b280e0aef669edd6cf3f060b6acb90072c488f91a44bab6e573a3e50576a4b0a11f12596a63729a46547a7276af -libLLVM_assert.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/55ad55e3e093d1a3c32775036c68f629 -libLLVM_assert.v11.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/d1a30dd14b64c49397c45b2e53aa6099585ef22014fd9091dda39a7ccf03c78b85b018f3844c90c56aff47c6725bc5dfd73b5e6402ea13f73109aea6debaa276 -libLLVM_assert.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/7d88bc9491b83793e39f494f45b7e636 -libLLVM_assert.v11.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/c6065593e89f861661ec9c1fb35e416496e79e9e0f56e5ed4b7ba9fbf8b236716ff7733bb60b5de8942b6f9aca5705e0236e7fcbedb24109767fc12c29542d01 -libLLVM_assert.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/a012e6c9829ec51f260bbdedb20a2863 -libLLVM_assert.v11.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/24dc81297cab5d7eafa47de5d0ab5ca0b3da3ffd032de94488c81556d5ebaec850884dd561e14de98fa7dc0104d45acdd0298e0b0339dbb7351a9dbaa32320f5 -libLLVM_assert.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/bc0f8437c9f2aba1a7e696cafd3b4618 -libLLVM_assert.v11.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/ac640918e72b169fffd4a43f1453965ea0ba734c582c3f6b04cd6f020b032b4745ed79208a43ba1c1f700f0122596466da4ed881a89a67f6df3a62141dab9f04 -llvm-11.0.1.src.tar.xz/md5/6ec7ae9fd43da9b87cda15b3ab9cc7af -llvm-11.0.1.src.tar.xz/sha512/b42c67ef88e09dd94171f85cdf49a421a15cfc82ff715c7ce6de22f98cefbe6c7cdf6bf4af7ca017d56ecf6aa3e36df3d823a78cf2dd5312de4301b54b43dbe8 +libLLVM_assert.v12.0.0+0.aarch64-apple-darwin.tar.gz/md5/1e5a6d26e657b2900c9c3914dfbad9e9 +libLLVM_assert.v12.0.0+0.aarch64-apple-darwin.tar.gz/sha512/e2846fa7e2503309dfb57159acbf8ca5836fffb1a2a81fc60e88743d13eb67491c5a8977bc3dce7d75de799ff9bb963029abb23dec5450085e480940bd3f4bbb +libLLVM_assert.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/md5/9b6a0cf448686b657caffe308a8512fa +libLLVM_assert.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/151f3c29ea0f21f6a4d4be8b127aad2cdfd0b97ed3f8cf8d518be28f2b3fdaaff29eac04b57b5a5ce0aa3ce137e1afc2fec2e619ea2dd119520ae815e0e064c1 +libLLVM_assert.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/md5/8b4eab1d6ec21bf412a3ca8eaba04f3d +libLLVM_assert.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/13009a160683ab073a0a3e089f17d006b1d74273a65b51d16f4e731b47352c972ea0487a79e02084c4f4f72f61bbd1f169b7bbdacb6974e5fa53944d444ec290 +libLLVM_assert.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/md5/d1e35884644357a76dd4fa6f7429bccf +libLLVM_assert.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/sha512/d0918e7886c9ff6771d3ff809a25a56a7a2154b4713ed2f47f3e0b75748524f5465fa742c771e1fb954e3757a3341ca3f5e8f659225e0edb49f0c50b9dec995f +libLLVM_assert.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/md5/ab814bef54de513926548605795ee56b +libLLVM_assert.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/sha512/18aa8f235963f24ff15854708418640eae32c061b663574391d8c70880926a9ea6038cd2d875ee616fc5b247aae6503c6bbe09738d5fd0b65ca92e976057c8f6 +libLLVM_assert.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/6fd292d8e348f895efc567a566a36a98 +libLLVM_assert.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/1b03e5de348c9f563fc31c2325817380df6b995a5f352effd434f786f760612ea53efbae2ddc37251b3dcef73eea88c71869a197006ecd0ec6f860ffdacca5ec +libLLVM_assert.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/7377e0370c12506893231c4d8e1a28bd +libLLVM_assert.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/c91aa4226f065c62cf16f9815b0cd34548dfff38cb1a05e0e122ff659c3db2ad6d28d83d9d7ec4d28227b2a5de1d2b48812e50f6af838e69eedbbd8cc153f131 +libLLVM_assert.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/faa491409f4e9d822e9e34f6f2db36ad +libLLVM_assert.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/a07245c310755567e9e33b26c0f0282eae40abf1a1a1c22a77b6412709b191433ec497e16662f229558e49089d68a1c904cd282c548c02370ed902f544eb5cd5 +libLLVM_assert.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/b42b08d46b64df98e3ab493341ac015a +libLLVM_assert.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/da2bd53fab48f8b46971639d6ed81b9e57467a6c4a7a3a63984c08f1b799f7352352ba28892a7789811879e3740073487b885d9974b6285fd03da16edca24f2b +libLLVM_assert.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/52e678465021c06611f86411a8f41e9e +libLLVM_assert.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/01964e97bb231899b6064734f756d8099bf141674ed6d231108dbb6c901f3079444cd620493b0ea7e8bf1fbd2899f288ed02df3c855e5af87d7db93a9fd60108 +libLLVM_assert.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/c5a5977de4429a0a38e4cf025d57660a +libLLVM_assert.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/a5e4aed882ca2cbf0a8a8ff5b0c8e4eaadeaf7491ea1887ee5fae628a5d46906e7d480b784b1d1fd190c921cecebcaa243ff39df5a1776a82abcfe4095bf3d07 +libLLVM_assert.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/bb83098ced1081fa0c06ddb84b6cf0fa +libLLVM_assert.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/e217bb8fe434954191b2b2f0a00d6e32e39557b9ff95a2417a13f3a6a25f2266c180e66c98495b1946171d1652ca62689140814d5337e0e00b4abc15179f2879 +libLLVM_assert.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/77161f57a346fc7f6b9aa1d36db55879 +libLLVM_assert.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/e53440cacd74eb6eb48e4de0b720df177bb9b8c90e682685efcf65f98bc4bc6f990c60ccdb426e85a80db8005dbad1efa5be69e2dc326953d1c0177734f6a84b +libLLVM_assert.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/md5/33deaff11953a1f1f78658461010b258 +libLLVM_assert.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/sha512/61383ed8e872e21c3419d64928e29c3f1e074c03973ee456062ef774b71cb27785afa47c641ce9db14a144fb66a7f8c53215448721c49ebf3b37674ed04a75e7 +libLLVM_assert.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/md5/65f47baee13c6e2cd9f0f3cd95bd724d +libLLVM_assert.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/sha512/6f814647393445c5a6ec05cd8c89a3ad106bde4a2197ee0a8bd8e64f1575245d695a01bcfb02861ad452f7d881114a5fb4ab145aa2211b42fc34b07ffec2ccbe +libLLVM_assert.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/md5/107c0e969aac6bc376588481f3ab4748 +libLLVM_assert.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/sha512/aaf8677bdf4fdf5751a0133c00dfefb28cdf5076d62d749d9bb81f29af2a3f35438b3c4c0aa71fc87214670bb63a2428712a1c07fc46dae217cdef27b9b0c550 +libLLVM_assert.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/md5/b6f7084de25b6b49631a2f2aba8da96e +libLLVM_assert.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/sha512/75f91fd66da8d1e041c9ed0e8fd69ece5601d909caf10eaf30992b6eb5b743653d97648766fe0782862dc0891a234f3aef05df3b6c04848d4371addbae8bb419 +libLLVM_assert.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/md5/c36270a831b06d5b3654ec7a9fd35b09 +libLLVM_assert.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/sha512/25a095c12ac43dc36fd32b0ceacf9bc10b240a360a45fa0b0fdde367a40dc22a83bb3a6267426c0c02f14f221046c0b453417eae4cc0539ca116149f8ea480ef +libLLVM_assert.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/md5/8f0c51901b55ff5374c25a0e9bdeae99 +libLLVM_assert.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/sha512/a1387d07d63d0e33632bf77702271bf624fa29bd8e689054d3f71734451d39ef09abb9fb63f78cb6aa1f6f5bbe54737f72740aeb63a94fc6876a600ede5ed159 +libLLVM_assert.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/9a456e2d31115b296b212305988cbf0a +libLLVM_assert.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/9c93bbdf9b9d11654aa134cdd7b50198a7b49e86148ba3257cf6cb1003fe9d22f568e45ed5b26f4e0db7fb3128f57dadbef9f4494827c66b2957988305aa9b20 +libLLVM_assert.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/efe3eec267a6224e5e8f1458be4fcda6 +libLLVM_assert.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/d5e90b29242b6aeab8b4ec6d37938a5ab15e1b1546f87f795d45b8f9a1520d24408e8b2c3a26cfb4b61c6d3228f98d490e2a0abf375b8afec0fd0e866a833197 +libLLVM_assert.v12.0.0+0.x86_64-apple-darwin.tar.gz/md5/475530f8b87ac033069c4073ba25f62c +libLLVM_assert.v12.0.0+0.x86_64-apple-darwin.tar.gz/sha512/ae46db3687de3bca657968624d95ec3afed99fc3d07271681ae9cc587baed2b391c17b4b0905cb4da3727a44c7698b248dced4b44c688242042c096f9b2c2a46 +libLLVM_assert.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/md5/888d7bd8ceb30a482438d0fa7526d6a5 +libLLVM_assert.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/b494736aa3c4378bccc5f72db20fdbc488bb383ec4f569be18848fe1aa712aa6dcd00df1a8c651ed266981e70f4f1e9ba2bf04cc410ef02140f988c21dc9730c +libLLVM_assert.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/md5/7fb8dee0396a2ef772612de81c4ce222 +libLLVM_assert.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/ce1bcc5465e61944c4720f615de3bc234d2d2a3d8fed986aa919ba1840c0fa9a8ff4b7e5fd1f8e063bbd153ca1977718a91ac2e1ab2623a4b744d8ca98c3191a +libLLVM_assert.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/md5/ae631966f7a9f28ff105ae2c5c9b45e2 +libLLVM_assert.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/sha512/da3c1b1335f891b1121fa5f1f8fa4d9705c2bfcc3d98f80ef86f453e4db2d7e4c391b462ff471a87a01403558f81241aff7fbb8f7a05d815b5e15099877f9f3c +libLLVM_assert.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/md5/a4f21af04ce1407eb8d16e9b4704bfd5 +libLLVM_assert.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/sha512/bc6ada66aecb448f28f61f261d0e7cc009643ec0582c46ab7756e09bb4ba2ffecea8883213e6605144084abbeb1e12ccaf6e2a15b1797151a6aa0522453c0af5 +libLLVM_assert.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/md5/0fee3ab691bab69b30f3ce5721c871db +libLLVM_assert.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/sha512/4b9adee9596d37b336434a74e3aa007f83afeeeccbeaa16c942dc117f2990d1485887860eae7eee74aec2b4bea0f674aa3c6abbe621ddc26a76697e7ab1be986 +libLLVM_assert.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/2dcc9f9c8e8ea1c96b19d48e9c4da039 +libLLVM_assert.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/86a518a72558cae62e2b393503bf34e768d5999d2b773b22ae5cffdd6a413780fd8afcb88d8862a62529f3f3238eb50dd5d1210814d417beb01814bbdc029540 +libLLVM_assert.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/0392a6e2b4d2ea9177d57ed1c6758344 +libLLVM_assert.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/e0306b68650e758121a577133321d07fe42d6e1ff5a1b4fa5ae91d522e0a196f63d0a8465005e8d49a39c3182c1f86be8f79ae3c5da1943b1c5ad3b45dbb90a7 +libLLVM.v12.0.0+0.aarch64-apple-darwin.tar.gz/md5/758342103dc72bef1e97045b61326c12 +libLLVM.v12.0.0+0.aarch64-apple-darwin.tar.gz/sha512/38632deb61b0bdcc509b6781ee8981697e2ed68ddf9c874328b8de613621fbdc04dcd8e8f7e839812ff3b553c8ace00c32bf391b1cd7bd01359df0223400b49f +libLLVM.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/md5/e46e23c1cb0116a64d4c6c362f36c273 +libLLVM.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/2f3a8870ccc0a2b9f8a0a1a46a1e3add68e412ca63b5dd2f3179d5c3f20c1c387d93493b4e3523fa1ecfaf676ec13fe8b97908e26d079ee140e24a03ae4138e3 +libLLVM.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/md5/6b29c384991d030f0192cc21d8ba6b07 +libLLVM.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/c4f90df89d6315b93f574f0149c8b66185252770d7580a96728dabf9b4a3a66abf6f534b528540ddde791e6719e97857069c8b5154bcb134369253be3d51c052 +libLLVM.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/md5/d00dd86e4a94b22976c8674d42eb9830 +libLLVM.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/sha512/7bc5e67ddc45a481ed3349098e581eb8db65b4408478db44b053850b9e534b9ffde27674ec22f3600a794a7a5d334d649907205d58016e6984ae2b8ec675959c +libLLVM.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/md5/f44c529d8c9afb2c6a5c555bb6a38177 +libLLVM.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/sha512/1c6c7320495d822f4e9ef209f726ef9793d130b28416b8ca7b60d124e5ea54d6a92d73596ae33078b00e863026196177f9ae291a338d00378169f4f0199f8fb3 +libLLVM.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/a49912cfcf61750103f740d60de921bc +libLLVM.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/3f4d803d5eb62ec23558c739d3afa8bcaa7cf371171019950548d46a07e2e9be771ed1a135995960d7e8b344cd149abe4f50b547889a5b7d30a5fc97a80e6f33 +libLLVM.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/18b0841f11b5d3b8bd30c6a6711f3e84 +libLLVM.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/e891c7d7188593b1c99b8e84ed8b0d9430367886eb1e06923675f666bb206649f570b818080598cca21603693241b8f8474e268a3ddbc5e85cf2640a7648a57a +libLLVM.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/d0f7682d75992f21e9f4583632af01e5 +libLLVM.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/8f14d78b55a923e497fc72866850ec227ced1f600eae5b1f8060adf25dcc8382ebb4992474a1557b411f010e2fcd356168f2ada79b867ed5afeb82ec4a3fc30e +libLLVM.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/4b4030175961593cea3d63219cb2a5bc +libLLVM.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/d3348b34db7e51c66c29e7ec835c5b8287a7f6f4abed97cbd2cae0b9ce6f975aee1e1eadea7e281cb6ac180de209deee277e1b7c2553b67dbf3faf5b0c00d96e +libLLVM.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/25a752523cef3c8a0630ca80bc612251 +libLLVM.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/ea8257ca590509ff1fe3c1b8379305be067c257e812269ee4af5df35cca1176400e85502b17cedab20e879e082f4bdfb8fe1dd34d83e786afe1c9914931c61df +libLLVM.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/09971322fd89c0b1102fdfffaec53721 +libLLVM.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/6b5b7169c96e7b7510a6b084af0d36b893a46a1c2c4a966e89f23878ac2e9eafbe3c21c062eed818f200c9eb2083261ba4ee76786af5ceb5f05621f79548ee7d +libLLVM.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/a7dd5765f7e530a40b72f44b5dfb8b38 +libLLVM.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/c4b119dd79a810001b81b4eb103013b8d7fb8443c060becc3900e6f7379b91e38b70aedeab980062ee53ddec04592aa6790c62bfc59c556423edf9b94218d060 +libLLVM.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/f61a1d6e04a4c5c00bb0d31e997184bf +libLLVM.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/831dbd3e5e16d4fe6c38fef6f2656f54b3532fac1c1c05121d0d35d6c9de328cd06329ab85f100975097211586bd1fcc3249f8e77661941c9746843d2adb0a6b +libLLVM.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/md5/4e368d4b4901825f115a3e58483036e1 +libLLVM.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/sha512/0211a7213e1d5dddc64be17c39b330b12d7361613e0a798d007bde9d3f4f3fb7259df8212c1809a45759118ab36af4bae0c1f35a66e88a4195c899a6341c21ba +libLLVM.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/md5/cacce4ec7289a2a86e9bcc91580a4a5f +libLLVM.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/sha512/04d71994344fdbf60f01128e8c8fe3c5f940ea3bd72a5eff154d913298893bb73b399eeef1240bab779ba477a02b8ddb647068c76946fcb35f9a530d7fecccea +libLLVM.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/md5/c242c47e4047bad01c15142eb6623fa6 +libLLVM.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/sha512/225b9ea08454ebd5b24ac1d4442023d21f4727072baa16730b23d71d0dfd1be713bb992868038f8e982af590f499bf6d2b4e64bd3cbff537fa41c1f8d271eb32 +libLLVM.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/md5/7843fcb202beb55d6aa87600a6d60342 +libLLVM.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/sha512/d8c9f6f865e2f1058bd0d3f5b04a799483f1a94336ec82161a8c26e8bf5070b714663cf5d62733c9d4006b9a6e145873a31198e780632f039dc43a980216407e +libLLVM.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/md5/ea045ca69935f5035071be6ae719ee7d +libLLVM.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/sha512/06a9b4f762bc08c827ec2d8bc6ff26ebe7af6c8d049bd1015f5d006d7927f7c6ec5d1310b0e74da59994b10c866d2e3358717e36d398d3c01a53455f5f94eaee +libLLVM.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/md5/cbb10916045594f8c509d158bc9eba2d +libLLVM.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/sha512/7ae2b3dc6e54bff8db71ab3208cf7d28a4c35819528d6cde17530e8a5509501d7aff18a75e851d93cb2682b0996d78f00e09db6ac11c2bd9bd57d349af8a3c14 +libLLVM.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/f59fa032a3f5d8fda741a7fb2c7908ea +libLLVM.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/bac6f46e34660cf8b231a1d68eeaedc82f77518296cad4aa6d54ed3661c45c02b3d442e30c37c8b4b8cd0e0701a5ba49b080ffc842e6b58f6f19375250978231 +libLLVM.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/92f7fc40a1ffb473046d5493b329fa69 +libLLVM.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/1f0256620164ee67b6936fc2005a66dba889dae4c0f92b16fa33fc6a3b4146ad1b119db8569a50b1716e2464b0e4def09cc68cb81aff96c234717e507d64b3ac +libLLVM.v12.0.0+0.x86_64-apple-darwin.tar.gz/md5/de7a0f428a9d6c53feb42cf1224744d1 +libLLVM.v12.0.0+0.x86_64-apple-darwin.tar.gz/sha512/f9f7adb7e80d2192692fae80909bd2a87d5a471cfbcab6e335750011b77abae89dbb2b5a81151bbc34739ee3828e3e84a844b46fbc63c279710f3e12c0369642 +libLLVM.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/md5/38dec37c1b969bd38739dcc88c795ede +libLLVM.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/9b0afbe6119925a6a2d7f03208ef4676209e6c6532c78f0badd87564636bc417058097c2038108d6aecf399ae5ed3a8629d75a00f36277a7e97483da92a5c963 +libLLVM.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/md5/68ef2be45e6228a974215cf76c630a8f +libLLVM.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/a8e48578b6ccdce02b3e03d7c20de8df90ab40ac99a029169c8dd15907e41b917579bcb0f677dafcf039f95c9be0395b2ee5503ac6e20d9ef62517b5a213f521 +libLLVM.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/md5/8422319066043fc91f69795c10e085ac +libLLVM.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/sha512/e072e786f4ed2a891b251e43f6b62f6916c3f2d88afdde12a132a468f77281fe6b52438862cec25726a501ae76ee5d9e920fd5a2a8c2ede91999958c157134b8 +libLLVM.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/md5/1251650b38740bcf2203ef52a9dc07fe +libLLVM.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/sha512/afa9b543a1930440b7e82aec6ff82549de6e1fcf88fa24c20e541ca66843bbf471f30fecc6af5e4e514cf383e91834c0cbbf231f0d97f2af9a99122ba13a6477 +libLLVM.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/md5/673870380f49f24097e9aa040bbae2b2 +libLLVM.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/sha512/88ba49a5063fe67bc91906d2b7d2044238faaa7a1ff52e10625f49d79a9d986de3b3a09b32e76f38f8bdeefadadab233ad8510881ed6ea7c4925b5d6c7396ed1 +libLLVM.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/6ff0f20bad03e04ea511fbe99a4a8c87 +libLLVM.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/b0496090fe91b7d8485883b3643f170c4a5533bd6bd388ddbb04e189d0073e44ccb31caa2cdbdff49f430c1180dd8c0d1fbffdd2fee83e5be52aaf362c0cd178 +libLLVM.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/1de026b6896ee464493d0b760c938faf +libLLVM.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/113ff6c2a706bbd334fd6882f56d1238fe0decd3e80b528166500ac5f831bb321d078b48ebb1883ed0ca5ea22516a9b3ca49fb32cc21b03fa985ddf69208deaa +llvm-12.0.0.src.tar.xz/md5/ceab21c9081e122a88d82216a80d0dc0 +llvm-12.0.0.src.tar.xz/sha512/ec17153ef774a1e08085763bda7d0dfce6802fbaa17e89831695ce1b2eb015a6c2aebfaa9fe7985a83b9c51bd75d40bb4f1fc706dc16d4c0dc2b2722a1d8a24e +LLVM_assert.v12.0.0+0.aarch64-apple-darwin.tar.gz/md5/9c1db1cec729fc7f9b65a135290ba820 +LLVM_assert.v12.0.0+0.aarch64-apple-darwin.tar.gz/sha512/684f8fb95bb99fc672d9ecbac831f3d6a68e906c8f0050bdeaac522f8b3ccedf8e54dd23667de3fd0c03f241471df221cd0a965036411b523b0e4016be89e896 +LLVM_assert.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/md5/1e84cba3d675739d2064ace317e8852a +LLVM_assert.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/2bd3cac963c0b54d23b1471f26b892c95400c2adea45be4a40dace6a0a456297c44c5edc2aba7d977c6afee1b8ca41c43171b8d99e04fa223ba9df877b8ec614 +LLVM_assert.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/md5/16a1d1b3006b5181e3b27c01775865b2 +LLVM_assert.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/6c34f0d2d30965a1b826edf98031cbe96cb480998816d351eb2e361acd868d35c11249da0a9273469aadb7f55851e97cbfdd1f5536fc9d7310410c192a592a23 +LLVM_assert.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/md5/b43babd0f88939f70f24d6ba6c42d93f +LLVM_assert.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/sha512/5aa5c686ed1d75bfff26deed4975eee7eeace2516c93e2d2a88c86d2f88e67f894f24d777d3891dcf962281794143eaca720eaa8dd9c774da3b69346beb50a04 +LLVM_assert.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/md5/ad72b54cbca417fb2fcbc22885315c51 +LLVM_assert.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/sha512/f2d7ddbecc040c8ceb4fffe0240a15a8b18b697ad605fc8c29e16f8502e72e9e8281bac4634e84f95d86ea5cc3abd4fd0fc437b3ee986027bfca6b6efbf39d54 +LLVM_assert.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/176daaa135bdae4140cd64699500af7a +LLVM_assert.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/c08598773fdb8cbfeeb4e8b6802f90b0139b89e50d7434a7976c36416a2378db7873f49f81810204291c9edae72d82f3716b61df36411b0639b148fc838095fe +LLVM_assert.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/68c15927b4db3e2507b89e82f3332757 +LLVM_assert.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/e8598844215ed87fe6a1be05465e80100f433d649b4fabeace1de111626577a5747fc27b109de532c024cbd3f3e8261df0d4bd0eeffdc1928354f1ebf501ebcb +LLVM_assert.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/94cb1baaef471aaa4e07a2a0367caca9 +LLVM_assert.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/bb440e622e2da9f194a2804933131cdc4c084dd27567276e90a6638d6bb15d726abbb40bfbcb81d9934ae2472f1267068bf4f40043e7c928d12316eda66e4806 +LLVM_assert.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/1fb3a0ac1d0511ebd20f9520050a5f1e +LLVM_assert.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/5453dd469aaaee937d2a89c03fc382c52dcc1742070e6310f2394d4753fdde32bf91fc51e078d2aa00f3bf78cb73ba4e5721e008f84428e1269549af04689368 +LLVM_assert.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/c6c7d20f7bae0e4dd52b538bdb0ab1ce +LLVM_assert.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/cc1f792fa7dbb91470106d84c168c3d5e3c519079c8514039fbda8692f987ac994b1cf8d6b96995f47ab32ff55cff42bf53d278a78b21378ebea9c03f1b53d43 +LLVM_assert.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/c2fe748bb8e95fc1c22585109c372a37 +LLVM_assert.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/f94a13e0da4a51b4e3f3697ce88ff2ab7d41918e2d25894cb6e41622be9f3c888d6715574e8cbafc3a20bfcc2164a1c9b417c2c66bc420b445e11c5265a96f7f +LLVM_assert.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/ad087a60c33f5eda018ab8e2966bbfa8 +LLVM_assert.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/d0a4d1eb39491eff08c2991f8876a4e097071b337c4a5ddc783c51a1fa109810db67c5edd2e9b6dbef7e7fadc78224ab45864bee8e9b9e35f0325e49bfdcb6b5 +LLVM_assert.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/0015dc719aed7ac0ce2bd16f11bcf53c +LLVM_assert.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/de224f36068bce30adb7472e40d0b3ba3e3fe739fe9ed62ddec825fa922bdd075dc081401cd55abd14a303551ff5a047cc98b2a077f367c105953c8e27764d86 +LLVM_assert.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/md5/f9ed12bd7fe3e616016b81bd3c56caa7 +LLVM_assert.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/sha512/9287a724fc4b0a0c098a71c4ff4aaf50c3ca79120e13b3ce718c206a0dab1f239137175e6e8b46559fecb373650ddd8224e04194042eb62c974ebce84ace6ebd +LLVM_assert.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/md5/04dd433225feb65b499bee9b93698265 +LLVM_assert.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/sha512/2e1d1d9f5ded294890f37dc8c2449d9d66541d242d3aea76f3f170cb319be20b3f7d5a296c0631b6a8b713627c8f952c07de9151e88e1ef4ecb9a6f622595cb6 +LLVM_assert.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/md5/2cbf070301e7ca4a54ddfbd4420f18ae +LLVM_assert.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/sha512/5a7a2212d0e99130b9f2dca5311e2ac14622976f8d129b120754df9c130047369e2bc57757e8b0bd48430c0637dd886fc85b2143e233d503cb4c92b6bf9735b5 +LLVM_assert.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/md5/ec1eefe92eb1a0ffc08c2761f6bd0ac3 +LLVM_assert.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/sha512/6e54c1eaa55aef60c8a98e3870c1e18392a862b79cb482cc92e7346918cbf886f0845c6bcb0e75dade163bdf60b86d6888dbba30eb088ff0d4cac04624abb2db +LLVM_assert.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/md5/9b282bc5b379138b634613dc27451588 +LLVM_assert.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/sha512/7969075ec1f8a367bf14cc19185bd1ac66631ddfe8faec955969600cc5e3548a82f2775271cdac71807df7f0fe38106bc6ba28b60514c9461513e9cb9e39de59 +LLVM_assert.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/md5/c2af10728a4cdca9223f2769a5b41572 +LLVM_assert.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/sha512/4ed5303b5bb58fc6fba82c260f368398ba7df17ec9cec8e1ce9fe5f608e19c67cecb62043cc8e20599210d6c438e2d29381ec9d3a8bcdeb11b7676022f21664e +LLVM_assert.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/b8d7c5bc69c532251738e123124a046f +LLVM_assert.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/82bff8f8afe76ab38300a9e7fcba93ee07191230c1b2a0ee5bc98c6a1c94899a3da6eafd113ce7d938c27881f2af571534586e4adcdd1ca51ecd399fe56cd484 +LLVM_assert.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/defb081814ccc0cd6732ae3e3cde034d +LLVM_assert.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/5dd21608cc271d9a4d065bb336301d0e797cc40ed7fdae3a4370b7ef0f93d868e784e8c79ef37ec33b057a2eb86d07720bd0d7c178c9c28f4368724a5d0783d2 +LLVM_assert.v12.0.0+0.x86_64-apple-darwin.tar.gz/md5/212f317b4d01dd033e1eaada7076bfb2 +LLVM_assert.v12.0.0+0.x86_64-apple-darwin.tar.gz/sha512/19a222b4d1a239219498d5a4d67142047e00746ff6548c7adaac40196cc1b3088e320f26fc8c12b2ad41eed37d6dc3738af61a1dcbb81ac42f28e6bba0da1d54 +LLVM_assert.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/md5/5afaaaba76df2d7d5a1c50d51ef45ef2 +LLVM_assert.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/2bf44283938600faa845b0b8b48f08d1826f80e48264fdc95ec828593afa8e592e0e697cd5b9e4ef959200a776ef3f85cf9c35e98fc908f526e082d4c4b4b340 +LLVM_assert.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/md5/aa41affb6459858a9beabf583842134b +LLVM_assert.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/3b35ed3bad9c7e88c3d937548bf9af24b270c1faf4aae9ecaaaef8000b02ef17f90d425f7506a9716c1aaf3c7247472d2098ab7ecbdb4010f478602a2ba9c5ff +LLVM_assert.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/md5/0429e7474dc3d250b0fc8772beed5b5e +LLVM_assert.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/sha512/13c180d03d337e911769793bd4624b75be846fb67d71aa0f0ff837c232e14d5d016aaa2fa2b986676297f3bbcc2599f104ebf4877e7110f92888e5c4d95f9ee9 +LLVM_assert.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/md5/e4403471e47034e849cc66610724cd50 +LLVM_assert.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/sha512/957df75539a723b680173d823bf96e542dc4cffb4b05b64783a9d60f0f0bafc1b0d1113fb9c4ae25ffe7e36c4764804a2f98fd9cc2468e2af3f1fa0e77929788 +LLVM_assert.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/md5/070bd8e25a76b980564f9160bdaa66f3 +LLVM_assert.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/sha512/c7c03229c34dbb715e2c59ce3c9d404f5b6a337506952bbee594c2109a0824c4962575f8ae9801a89a30d5569a85f05e4c1c4fd231ecdfe36d3ca7488799d3c5 +LLVM_assert.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/1b7726c382c08e3e24fc1ec35b8c015c +LLVM_assert.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/029c084d83ee049f45b1026757d631751cd2edc6c7e10deeec398baab792e8cce366fad5c971a120154ed2b6cd28b6659090dee7402e8f904bf43371b4170048 +LLVM_assert.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/2c6d5945a5ee5b4d216acc6fdf22b54a +LLVM_assert.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/f086e0c58eff5560c23bb9444270005407e66afeb969b4e5bfb1eb041a3479939ada7014c696e1dc50b0aa2717928887d434941d5266bf16264375dd3acfb67d +LLVM.v12.0.0+0.aarch64-apple-darwin.tar.gz/md5/8837684991656303d1ccd1da16cef6ab +LLVM.v12.0.0+0.aarch64-apple-darwin.tar.gz/sha512/de2a74fc6c305a8353168ab7e5849706e29fd4b66936bf4a8b6b9cf9dbaa2b7c30a30c118cf59f1421eaa399e7b5a7efa52ccb9ee4c2ce55c7afb9ceb2050a23 +LLVM.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/md5/4597b32ca87cbab6ca3de44ad0ff33d9 +LLVM.v12.0.0+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/648233efb5037da8928e6d584ce7c0176fd41fd3ab66ffc36bc15fa0829bf4b19d554fdbfe7ad6d1fce28be5d66ee3e650871f4ca0973afeebb19ca4aa0cc596 +LLVM.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/md5/fa65be0be8c747801bf518e036d6b87e +LLVM.v12.0.0+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/cb9d926450b9e2d805ed3cde63db738eb4bfa2073382f52acdece2ca46019da0205b305db10af8feb96832016b0d10ad766e37b7f986541ef07b3877526a745c +LLVM.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/md5/d8ada1b149428e1b363a3776208778c0 +LLVM.v12.0.0+0.aarch64-linux-musl-cxx03.tar.gz/sha512/5cbb49cfa03aef5f455a282dd76a7943d0a791bc3e2818d0e8bdebe3b072202a35d1a37119bf2fbb8082f18af99c1aa935b1f07b7a8a6ec3d0fdf05d7d7d0f1d +LLVM.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/md5/f7af27355d90e71ed8d3b643ea058801 +LLVM.v12.0.0+0.aarch64-linux-musl-cxx11.tar.gz/sha512/27043b1229ae05e4502eff589a04469ede3f4b701aa62d33f69c9cb57ec5c84ecd1c1a312a3853b27a6f32281c41b62098b623a6a592671a7f53947eac7d955f +LLVM.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/0f19ff6eb5d6874f386a55dd903a3808 +LLVM.v12.0.0+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/fc57dc902c574701555a86b404fa07ba676252b405cfc130fe253adc7bba7518ebeb6e984846f1a75fc192292fb5f546c3269960419351991aef74adfe6ce30b +LLVM.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/bb054c404683edecdcaa8b4e6c5d1969 +LLVM.v12.0.0+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/10de5dbad00bd92e47c6a77d249e45ceae2cb790893c6472e91a8ce9d8f3f03f736f598d9930bf6bb53411f490f971559b281ef38b0cc953ff3aab766ff20cbc +LLVM.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/81c6b866133c044922149e8da3330234 +LLVM.v12.0.0+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/b56ba063e89320a72e4db45e1ea31ea5f2238d3f317f3c8ea042a36b312f9c4a02eeb9da722cf34aac0e7d703c66d996b0f2c0c8b0e61b38e1e10d7c6a872270 +LLVM.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/0cf3669c60ccb6304566a612ec84dd96 +LLVM.v12.0.0+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/a9b91abbcb1130e3bf83ffffa7c74e74a663f12fd79c1429f804af5d2a6dc71863bd387a080153fb241488baf9d0c9a3c317c92c7c95553fafb6714463b65e4e +LLVM.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/971bdc3c1e5f200d6d5e0791de47fc8c +LLVM.v12.0.0+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/71d50e5852892a8777076022dbe615c49363bd2321975a0fe93202a93518a9064c805966eb2b09783fb2679b589059e8673072fccbcf2110584b25e4174db365 +LLVM.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/2352473188a90f6b1df3613ff9f162ee +LLVM.v12.0.0+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/6f0e5a8eaf0d7976d31648370423caf9518f44182cd45fe7732d918d4cb2fcf302a5e1deb0856beed3064230e41581441a2ca339db7412a636c930e20bc8fefd +LLVM.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/6e9d5b4cda3fc8faf5d3b82d384e69c5 +LLVM.v12.0.0+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/ea0ebee79f685ea25d2be85656ae21cf18dac72874342ff960b6fbdc89c60383a2d6af8f36d14621cbc9bd534cbeb0f8a58c791c724e5469aa48d50606c2c08c +LLVM.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/4ab6e621226d158701368af6af0b8c1b +LLVM.v12.0.0+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/3ead9d5227bfae81251d5327c98e28a4f888206176835626e24603fa2638354f4bd0f9880fdd14919091c756a9ee5d0901d76af8555b67094cdf7b6094fb2afa +LLVM.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/md5/799676b765c76572ec4217fea32a569f +LLVM.v12.0.0+0.i686-linux-gnu-cxx03.tar.gz/sha512/6a712ae86de5bacacbf805f9f53e7274a9f25c8b0dec28cbad756e6ac3e190ff1e6576a1d132659208f114cd36703bff0f049180b5e1ae7a49e05175db1689a4 +LLVM.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/md5/a14269eaee410d35904760ee26029a13 +LLVM.v12.0.0+0.i686-linux-gnu-cxx11.tar.gz/sha512/bc5208ed6d365da10e7c9f9b4a771cab0ec7f2d340e8c35184e80ab093b7b79fc8e2735e6baf7fde6e7f4910d0fa893012c3635291528a0575ccfeae5a2baece +LLVM.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/md5/8c01b166aeddb75916a24b5bc4a5288d +LLVM.v12.0.0+0.i686-linux-musl-cxx03.tar.gz/sha512/51b6436452cc3dafdd0bdd03852a3ba131740b8bc701abd50d5123d08ff04b8be03051192fff26ccc4c446a3d1b08981fb66619c080d9450e52071dde62fa31a +LLVM.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/md5/b95bf3b5d2a0db37ff16fa6dceb4c55f +LLVM.v12.0.0+0.i686-linux-musl-cxx11.tar.gz/sha512/9fe5a3c4fc758c25eae7fa8886607e8cd926f6d15d65fa1dd2f745a38d885eaf248c2c199cee73bfd25bd98e65392dfde2004a9c63c061aa2c7d8a465b469b0c +LLVM.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/md5/f714f857ac90c159a390d6f5d761e067 +LLVM.v12.0.0+0.i686-w64-mingw32-cxx03.tar.gz/sha512/4befbb7f17f717669eb670cb18b9e60026c84722e0b8d7b4cc91e27c8c05b27d7b04b50b2ef20ffaf30cfb785f951836d08ec824f6b8fa95ff6b30d21c252212 +LLVM.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/md5/9648a00d069ed91628d0214366df6477 +LLVM.v12.0.0+0.i686-w64-mingw32-cxx11.tar.gz/sha512/a5fa4c4015e1ad450767f694cf0ce701aff5c3a20916745f60ad788f933029418b8303dccfe818be482862fb59bc889d8c4c0ffa3f8104a1f957a8f5578bb442 +LLVM.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/1b05656cd5ea85d90c0ff7e0f3d2bb09 +LLVM.v12.0.0+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/070628a05d0beb3efb12831725db2da0b55910180290842b63373a39a73e305a6c87b91615ef7f31dd771813e32d6d93b6260a2200ed62ca14c04bf713d775c3 +LLVM.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/0c41e6d77cea62b37d2b04cea3e3e865 +LLVM.v12.0.0+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/ec6c2a9e4de3921a2237ae0deefeef084713a0e8afdac63bc82a6ec4954ded1935696ada3e452d8c3929320d33a7ee6a861f3ad969e740e313639f72eaa33678 +LLVM.v12.0.0+0.x86_64-apple-darwin.tar.gz/md5/d716a03e7300f2c8b6cfd157baf82841 +LLVM.v12.0.0+0.x86_64-apple-darwin.tar.gz/sha512/be4bc5164d80db972cd4c0ce7e4325ad058243cc27850ca288635d191c0ac3b3428217623a01a312cfe4700a2af014eca03e06f4a345f52b5308185a38a2de65 +LLVM.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/md5/c4ef15b188097912a8893395e079d6fa +LLVM.v12.0.0+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/2f06bfddbb907de527517b4a455bb7398b36a7bf9f72fcad778f2586425cbe90be9b3eb9d1cc03ff6b7e5fa6d04a0a06988aa9d2003e748163a7e7460102ced7 +LLVM.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/md5/3ec8ed370b0995c3fb3062768d9211c1 +LLVM.v12.0.0+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/6e2414c5c4cc2696c951b928253bbed88b576d207772c2f14e483aa4f84fe16d0b8731c955ba7680596d29b5339f4ef90d1a2f8edac1a196b22923af09f6cbd1 +LLVM.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/md5/a186e057c1141e7efe465be3c07a167a +LLVM.v12.0.0+0.x86_64-linux-musl-cxx03.tar.gz/sha512/5e88b8a5a79889a7d402af9c49a1b7743dafc3572161b3137060066c5de18d48f7e6f6abc837ec1e794e22bb6dee3dd1663526c31b852be48c2c3f9d0ab85505 +LLVM.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/md5/ae4a90d5826c5b3db4085c90f91a42f5 +LLVM.v12.0.0+0.x86_64-linux-musl-cxx11.tar.gz/sha512/5bf3edbd72f86401d0f63803dbb0ef0ba9a835bd8cb9cece09e54807c0966d75b0ba68b6a0b337e40f8f754c04e0b6e95565baa4320a47a2b7f9d69c1e45de61 +LLVM.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/md5/1f3679db43d3b4b2fd2b2a4a8f92ddce +LLVM.v12.0.0+0.x86_64-unknown-freebsd.tar.gz/sha512/5ae1316d5327177975fcb7d4342760b66ba6bf7f38b90cdc04f77a00cb5d924b2dd041c1f354b9855001fae01b8cb301b486ee16db7daf4d0c41fcdf3e78fe39 +LLVM.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/441c0fc39bd0db777bf1c4a05a00d7eb +LLVM.v12.0.0+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/7cd2556e0a7d6a9ee93cc23ee5e755d7f777edad22b838867d25c00c742e4591dcad40496388a149b54df25aa5697aa025d49a061614ea6d20c67f29ac66a484 +LLVM.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/62f73d2ba5ccae272f6d85c6477d78e9 +LLVM.v12.0.0+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/a0f47a38994632c36502ec2f1b1d32f3f3c487062c7d47c38318ec6e85eb802a0e9d331b9743611eac86ef6d90c02960a6604f892aa295a88688905af6907b34 diff --git a/deps/libsuitesparse.mk b/deps/libsuitesparse.mk new file mode 100644 index 00000000000000..a7bf592ccc9ea9 --- /dev/null +++ b/deps/libsuitesparse.mk @@ -0,0 +1,156 @@ +## LIBSUITESPARSE ## + +ifeq ($(USE_BLAS64), 1) +UMFPACK_CONFIG := -DLONGBLAS='long long' +CHOLMOD_CONFIG := -DLONGBLAS='long long' +SPQR_CONFIG := -DLONGBLAS='long long' +UMFPACK_CONFIG += -DSUN64 +CHOLMOD_CONFIG += -DSUN64 +SPQR_CONFIG += -DSUN64 +endif + +# Disable linking to libmetis +CHOLMOD_CONFIG += -DNPARTITION + +ifneq ($(USE_BINARYBUILDER_LIBSUITESPARSE), 1) + +LIBSUITESPARSE_PROJECTS := AMD BTF CAMD CCOLAMD COLAMD CHOLMOD LDL KLU UMFPACK RBio SPQR +LIBSUITESPARSE_LIBS := $(addsuffix .*$(SHLIB_EXT)*,suitesparseconfig amd btf camd ccolamd colamd cholmod klu ldl umfpack rbio spqr) + +SUITE_SPARSE_LIB := $(LDFLAGS) -L"$(abspath $(BUILDDIR))/SuiteSparse-$(LIBSUITESPARSE_VER)/lib" +ifeq ($(OS), Darwin) +SUITE_SPARSE_LIB += $(RPATH_ESCAPED_ORIGIN) +endif +LIBSUITESPARSE_MFLAGS := CC="$(CC)" CXX="$(CXX)" F77="$(FC)" AR="$(AR)" RANLIB="$(RANLIB)" BLAS="-L$(build_shlibdir) -lblastrampoline" LAPACK="-L$(build_shlibdir) -lblastrampoline" \ + LDFLAGS="$(SUITE_SPARSE_LIB)" CFOPENMP="" CUDA=no CUDA_PATH="" \ + UMFPACK_CONFIG="$(UMFPACK_CONFIG)" CHOLMOD_CONFIG="$(CHOLMOD_CONFIG)" SPQR_CONFIG="$(SPQR_CONFIG)" +ifeq ($(OS),WINNT) +LIBSUITESPARSE_MFLAGS += UNAME=Windows +else +LIBSUITESPARSE_MFLAGS += UNAME=$(OS) +endif + +$(SRCCACHE)/SuiteSparse-$(LIBSUITESPARSE_VER).tar.gz: | $(SRCCACHE) + $(JLDOWNLOAD) $@ https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v$(LIBSUITESPARSE_VER).tar.gz + +$(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/source-extracted: $(SRCCACHE)/SuiteSparse-$(LIBSUITESPARSE_VER).tar.gz + $(JLCHECKSUM) $< + mkdir -p $(dir $@) + $(TAR) -C $(dir $@) --strip-components 1 -zxf $< + echo 1 > $@ + +checksum-libsuitesparse: $(SRCCACHE)/SuiteSparse-$(LIBSUITESPARSE_VER).tar.gz + $(JLCHECKSUM) $< + +$(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/SuiteSparse-winclang.patch-applied: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/source-extracted + cd $(dir $@) && patch -p0 < $(SRCDIR)/patches/SuiteSparse-winclang.patch + echo 1 > $@ +$(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/SuiteSparse-shlib.patch-applied: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/source-extracted + cd $(dir $@) && patch -p1 < $(SRCDIR)/patches/SuiteSparse-shlib.patch + echo 1 > $@ +$(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/SuiteSparse-winclang.patch-applied +$(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/SuiteSparse-shlib.patch-applied + +$(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-compiled: | $(build_prefix)/manifest/blastrampoline + +$(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/source-extracted + $(MAKE) -C $(dir $<)SuiteSparse_config library config $(LIBSUITESPARSE_MFLAGS) + $(INSTALL_NAME_CMD)libsuitesparseconfig.$(SHLIB_EXT) $(dir $<)lib/libsuitesparseconfig.$(SHLIB_EXT) + for PROJ in $(LIBSUITESPARSE_PROJECTS); do \ + $(MAKE) -C $(dir $<)$${PROJ} library $(LIBSUITESPARSE_MFLAGS) || exit 1; \ + $(INSTALL_NAME_CMD)lib`echo $${PROJ} | tr A-Z a-z`.$(SHLIB_EXT) $(dir $<)lib/lib`echo $${PROJ} | tr A-Z a-z`.$(SHLIB_EXT) || exit 1; \ + done + echo 1 > $@ + +ifeq ($(OS),WINNT) +LIBSUITESPARSE_SHLIB_ENV:=PATH="$(abspath $(dir $<))lib:$(build_bindir):$(PATH)" +else +LIBSUITESPARSE_SHLIB_ENV:=LD_LIBRARY_PATH="$(build_shlibdir)" +endif +$(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-checked: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-compiled + for PROJ in $(LIBSUITESPARSE_PROJECTS); do \ + $(LIBSUITESPARSE_SHLIB_ENV) $(MAKE) -C $(dir $<)$${PROJ} default $(LIBSUITESPARSE_MFLAGS) || exit 1; \ + done + echo 1 > $@ + +UNINSTALL_suitesparse := $(LIBSUITESPARSE_VER) manual_suitesparse $(LIBSUITESPARSE_LIBS) + +$(build_prefix)/manifest/libsuitesparse: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-compiled | $(build_prefix)/manifest $(build_shlibdir) + for lib in $(LIBSUITESPARSE_LIBS); do \ + cp -a $(dir $<)lib/lib$${lib} $(build_shlibdir) || exit 1; \ + done + #cp -a $(dir $<)lib/* $(build_shlibdir) + #cp -a $(dir $<)include/* $(build_includedir) + echo $(UNINSTALL_libsuitesparse) > $@ + +clean-libsuitesparse: clean-suitesparse-wrapper uninstall-libsuitesparse + -rm $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-compiled + -rm -fr $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/lib + -rm -fr $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/include + -$(MAKE) -C $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER) clean + +distclean-libsuitesparse: clean-libsuitesparse-wrapper + -rm -rf $(SRCCACHE)/SuiteSparse-$(LIBSUITESPARSE_VER).tar.gz \ + $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER) + +get-libsuitesparse: $(SRCCACHE)/SuiteSparse-$(LIBSUITESPARSE_VER).tar.gz +extract-libsuitesparse: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/source-extracted +configure-libsuitesparse: extract-libsuitesparse +compile-libsuitesparse: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-compiled +fastcheck-libsuitesparse: #none +check-libsuitesparse: $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/build-checked +install-libsuitesparse: $(build_prefix)/manifest/libsuitesparse install-libsuitesparse-wrapper + +# LIBSUITESPARSE WRAPPER + +ifeq ($(USE_SYSTEM_LIBSUITESPARSE), 1) +LIBSUITESPARSE_INC := -I $(LOCALBASE)/include/suitesparse +LIBSUITESPARSE_LIB := -lumfpack -lcholmod -lamd -lcamd -lcolamd -lspqr +else +LIBSUITESPARSE_INC := -I $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/CHOLMOD/Include -I $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/SuiteSparse_config -I $(BUILDDIR)/SuiteSparse-$(LIBSUITESPARSE_VER)/SPQR/Include +LIBSUITESPARSE_LIB := -L$(build_shlibdir) -lcholmod -lumfpack -lspqr $(RPATH_ORIGIN) +$(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT): $(build_prefix)/manifest/libsuitesparse +endif + +$(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT): $(SRCDIR)/SuiteSparse_wrapper.c + mkdir -p $(build_shlibdir) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -O2 -shared $(fPIC) $(LIBSUITESPARSE_INC) $< -o $@ $(LIBSUITESPARSE_LIB) + $(INSTALL_NAME_CMD)libsuitesparse_wrapper.$(SHLIB_EXT) $@ + touch -c $@ + +clean-libsuitesparse-wrapper: + -rm -f $(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT) + +distclean-libsuitesparse-wrapper: clean-suitesparse-wrapper + +get-libsuitesparse-wrapper: +extract-libsuitesparse-wrapper: +configure-libsuitesparse-wrapper: +compile-libsuitesparse-wrapper: +fastcheck-libsuitesparse-wrapper: #none +check-libsuitesparse-wrapper: +install-libsuitesparse-wrapper: $(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT) + +else # USE_BINARYBUILDER_LIBSUITESPARSE + +$(eval $(call bb-install,libsuitesparse,LIBSUITESPARSE,false)) + +get-libsuitesparse-wrapper: get-libsuitesparse +extract-libsuitesparse-wrapper: extract-libsuitesparse +configure-libsuitesparse-wrapper: configure-libsuitesparse +compile-libsuitesparse-wrapper: compile-libsuitesparse +fastcheck-libsuitesparse-wrapper: fastcheck-libsuitesparse +check-libsuitesparse-wrapper: check-libsuitesparse +clean-libsuitesparse-wrapper: clean-libsuitesparse +distclean-libsuitesparse-wrapper: distclean-libsuitesparse +install-libsuitesparse-wrapper: install-libsuitesparse + +# libsuitesparse depends on blastrampoline +compile-libsuitesparse: | $(build_prefix)/manifest/blastrampoline +endif + +define manual_libsuitesparse +uninstall-libsuitesparse: + -rm $(build_prefix)/manifest/libsuitesparse + -rm $(addprefix $(build_shlibdir)/lib,$3) +endef diff --git a/deps/llvm.mk b/deps/llvm.mk index 7e2b7357db3d07..c436a1a08a78c5 100644 --- a/deps/llvm.mk +++ b/deps/llvm.mk @@ -553,7 +553,7 @@ LLVM_INSTALL = \ cp -r $$(LLVM_SRC_DIR)/utils/lit $2$$(build_depsbindir)/ && \ $$(CMAKE) -DCMAKE_INSTALL_PREFIX="$2$$(build_prefix)" -P cmake_install.cmake ifeq ($(OS), WINNT) -LLVM_INSTALL += && cp $2$$(build_shlibdir)/LLVM.dll $2$$(build_depsbindir) +LLVM_INSTALL += && cp $2$$(build_shlibdir)/libLLVM.dll $2$$(build_depsbindir) endif ifeq ($(OS),Darwin) # https://github.com/JuliaLang/julia/issues/29981 diff --git a/deps/suitesparse.mk b/deps/suitesparse.mk deleted file mode 100644 index 8bc179ef76b000..00000000000000 --- a/deps/suitesparse.mk +++ /dev/null @@ -1,156 +0,0 @@ -## SUITESPARSE ## - -ifeq ($(USE_BLAS64), 1) -UMFPACK_CONFIG := -DLONGBLAS='long long' -CHOLMOD_CONFIG := -DLONGBLAS='long long' -SPQR_CONFIG := -DLONGBLAS='long long' -UMFPACK_CONFIG += -DSUN64 -CHOLMOD_CONFIG += -DSUN64 -SPQR_CONFIG += -DSUN64 -endif - -# Disable linking to libmetis -CHOLMOD_CONFIG += -DNPARTITION - -ifneq ($(USE_BINARYBUILDER_SUITESPARSE), 1) - -SUITESPARSE_PROJECTS := AMD BTF CAMD CCOLAMD COLAMD CHOLMOD LDL KLU UMFPACK RBio SPQR -SUITESPARSE_LIBS := $(addsuffix .*$(SHLIB_EXT)*,suitesparseconfig amd btf camd ccolamd colamd cholmod klu ldl umfpack rbio spqr) - -SUITE_SPARSE_LIB := $(LDFLAGS) -L"$(abspath $(BUILDDIR))/SuiteSparse-$(SUITESPARSE_VER)/lib" -ifeq ($(OS), Darwin) -SUITE_SPARSE_LIB += $(RPATH_ESCAPED_ORIGIN) -endif -SUITESPARSE_MFLAGS := CC="$(CC)" CXX="$(CXX)" F77="$(FC)" AR="$(AR)" RANLIB="$(RANLIB)" BLAS="-L$(build_shlibdir) -lblastrampoline" LAPACK="-L$(build_shlibdir) -lblastrampoline" \ - LDFLAGS="$(SUITE_SPARSE_LIB)" CFOPENMP="" CUDA=no CUDA_PATH="" \ - UMFPACK_CONFIG="$(UMFPACK_CONFIG)" CHOLMOD_CONFIG="$(CHOLMOD_CONFIG)" SPQR_CONFIG="$(SPQR_CONFIG)" -ifeq ($(OS),WINNT) -SUITESPARSE_MFLAGS += UNAME=Windows -else -SUITESPARSE_MFLAGS += UNAME=$(OS) -endif - -$(SRCCACHE)/SuiteSparse-$(SUITESPARSE_VER).tar.gz: | $(SRCCACHE) - $(JLDOWNLOAD) $@ https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v$(SUITESPARSE_VER).tar.gz - -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted: $(SRCCACHE)/SuiteSparse-$(SUITESPARSE_VER).tar.gz - $(JLCHECKSUM) $< - mkdir -p $(dir $@) - $(TAR) -C $(dir $@) --strip-components 1 -zxf $< - echo 1 > $@ - -checksum-suitesparse: $(SRCCACHE)/SuiteSparse-$(SUITESPARSE_VER).tar.gz - $(JLCHECKSUM) $< - -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-winclang.patch-applied: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted - cd $(dir $@) && patch -p0 < $(SRCDIR)/patches/SuiteSparse-winclang.patch - echo 1 > $@ -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-shlib.patch-applied: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted - cd $(dir $@) && patch -p1 < $(SRCDIR)/patches/SuiteSparse-shlib.patch - echo 1 > $@ -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-winclang.patch-applied -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-shlib.patch-applied - -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: | $(build_prefix)/manifest/blastrampoline - -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted - $(MAKE) -C $(dir $<)SuiteSparse_config library config $(SUITESPARSE_MFLAGS) - $(INSTALL_NAME_CMD)libsuitesparseconfig.$(SHLIB_EXT) $(dir $<)lib/libsuitesparseconfig.$(SHLIB_EXT) - for PROJ in $(SUITESPARSE_PROJECTS); do \ - $(MAKE) -C $(dir $<)$${PROJ} library $(SUITESPARSE_MFLAGS) || exit 1; \ - $(INSTALL_NAME_CMD)lib`echo $${PROJ} | tr A-Z a-z`.$(SHLIB_EXT) $(dir $<)lib/lib`echo $${PROJ} | tr A-Z a-z`.$(SHLIB_EXT) || exit 1; \ - done - echo 1 > $@ - -ifeq ($(OS),WINNT) -SUITESPARSE_SHLIB_ENV:=PATH="$(abspath $(dir $<))lib:$(build_bindir):$(PATH)" -else -SUITESPARSE_SHLIB_ENV:=LD_LIBRARY_PATH="$(build_shlibdir)" -endif -$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-checked: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled - for PROJ in $(SUITESPARSE_PROJECTS); do \ - $(SUITESPARSE_SHLIB_ENV) $(MAKE) -C $(dir $<)$${PROJ} default $(SUITESPARSE_MFLAGS) || exit 1; \ - done - echo 1 > $@ - -UNINSTALL_suitesparse := $(SUITESPARSE_VER) manual_suitesparse $(SUITESPARSE_LIBS) - -$(build_prefix)/manifest/suitesparse: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled | $(build_prefix)/manifest $(build_shlibdir) - for lib in $(SUITESPARSE_LIBS); do \ - cp -a $(dir $<)lib/lib$${lib} $(build_shlibdir) || exit 1; \ - done - #cp -a $(dir $<)lib/* $(build_shlibdir) - #cp -a $(dir $<)include/* $(build_includedir) - echo $(UNINSTALL_suitesparse) > $@ - -clean-suitesparse: clean-suitesparse-wrapper uninstall-suitesparse - -rm $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled - -rm -fr $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/lib - -rm -fr $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/include - -$(MAKE) -C $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER) clean - -distclean-suitesparse: clean-suitesparse-wrapper - -rm -rf $(SRCCACHE)/SuiteSparse-$(SUITESPARSE_VER).tar.gz \ - $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER) - -get-suitesparse: $(SRCCACHE)/SuiteSparse-$(SUITESPARSE_VER).tar.gz -extract-suitesparse: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted -configure-suitesparse: extract-suitesparse -compile-suitesparse: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled -fastcheck-suitesparse: #none -check-suitesparse: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-checked -install-suitesparse: $(build_prefix)/manifest/suitesparse install-suitesparse-wrapper - -# SUITESPARSE WRAPPER - -ifeq ($(USE_SYSTEM_SUITESPARSE), 1) -SUITESPARSE_INC := -I $(LOCALBASE)/include/suitesparse -SUITESPARSE_LIB := -lumfpack -lcholmod -lamd -lcamd -lcolamd -lspqr -else -SUITESPARSE_INC := -I $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/CHOLMOD/Include -I $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse_config -I $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SPQR/Include -SUITESPARSE_LIB := -L$(build_shlibdir) -lcholmod -lumfpack -lspqr $(RPATH_ORIGIN) -$(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT): $(build_prefix)/manifest/suitesparse -endif - -$(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT): $(SRCDIR)/SuiteSparse_wrapper.c - mkdir -p $(build_shlibdir) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -O2 -shared $(fPIC) $(SUITESPARSE_INC) $< -o $@ $(SUITESPARSE_LIB) - $(INSTALL_NAME_CMD)libsuitesparse_wrapper.$(SHLIB_EXT) $@ - touch -c $@ - -clean-suitesparse-wrapper: - -rm -f $(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT) - -distclean-suitesparse-wrapper: clean-suitesparse-wrapper - -get-suitesparse-wrapper: -extract-suitesparse-wrapper: -configure-suitesparse-wrapper: -compile-suitesparse-wrapper: -fastcheck-suitesparse-wrapper: #none -check-suitesparse-wrapper: -install-suitesparse-wrapper: $(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT) - -else # USE_BINARYBUILDER_SUITESPARSE - -$(eval $(call bb-install,suitesparse,SUITESPARSE,false)) - -get-suitesparse-wrapper: get-suitesparse -extract-suitesparse-wrapper: extract-suitesparse -configure-suitesparse-wrapper: configure-suitesparse -compile-suitesparse-wrapper: compile-suitesparse -fastcheck-suitesparse-wrapper: fastcheck-suitesparse -check-suitesparse-wrapper: check-suitesparse -clean-suitesparse-wrapper: clean-suitesparse -distclean-suitesparse-wrapper: distclean-suitesparse -install-suitesparse-wrapper: install-suitesparse - -# suitesparse depends on blastrampoline -compile-suitesparse: | $(build_prefix)/manifest/blastrampoline -endif - -define manual_suitesparse -uninstall-suitesparse: - -rm $(build_prefix)/manifest/suitesparse - -rm $(addprefix $(build_shlibdir)/lib,$3) -endef diff --git a/doc/src/base/arrays.md b/doc/src/base/arrays.md index 0493ae1e35e72d..1dc2d8ed926afd 100644 --- a/doc/src/base/arrays.md +++ b/doc/src/base/arrays.md @@ -141,6 +141,7 @@ Base.cat Base.vcat Base.hcat Base.hvcat +Base.hvncat Base.vect Base.circshift Base.circshift! diff --git a/doc/src/base/base.md b/doc/src/base/base.md index 7d1160dac918bc..1e419460bef533 100644 --- a/doc/src/base/base.md +++ b/doc/src/base/base.md @@ -254,6 +254,8 @@ Base.:(|>) Base.:(∘) Base.ComposedFunction Base.splat +Base.Fix1 +Base.Fix2 ``` ## Syntax @@ -354,7 +356,7 @@ Core.throw Base.rethrow Base.backtrace Base.catch_backtrace -Base.catch_stack +Base.current_exceptions Base.@assert Base.Experimental.register_error_hint Base.Experimental.show_error_hints diff --git a/doc/src/devdocs/ast.md b/doc/src/devdocs/ast.md index af89290618fec9..d02606840c4319 100644 --- a/doc/src/devdocs/ast.md +++ b/doc/src/devdocs/ast.md @@ -63,23 +63,25 @@ call. Finally, chains of comparisons have their own special expression structure ### Bracketed forms -| Input | AST | -|:------------------------ |:------------------------------------ | -| `a[i]` | `(ref a i)` | -| `t[i;j]` | `(typed_vcat t i j)` | -| `t[i j]` | `(typed_hcat t i j)` | -| `t[a b; c d]` | `(typed_vcat t (row a b) (row c d))` | -| `a{b}` | `(curly a b)` | -| `a{b;c}` | `(curly a (parameters c) b)` | -| `[x]` | `(vect x)` | -| `[x,y]` | `(vect x y)` | -| `[x;y]` | `(vcat x y)` | -| `[x y]` | `(hcat x y)` | -| `[x y; z t]` | `(vcat (row x y) (row z t))` | -| `[x for y in z, a in b]` | `(comprehension x (= y z) (= a b))` | -| `T[x for y in z]` | `(typed_comprehension T x (= y z))` | -| `(a, b, c)` | `(tuple a b c)` | -| `(a; b; c)` | `(block a (block b c))` | +| Input | AST | +|:------------------------ |:------------------------------------------------- | +| `a[i]` | `(ref a i)` | +| `t[i;j]` | `(typed_vcat t i j)` | +| `t[i j]` | `(typed_hcat t i j)` | +| `t[a b; c d]` | `(typed_vcat t (row a b) (row c d))` | +| `t[a b;;; c d]` | `(typed_ncat t 3 (row a b) (row c d))` | +| `a{b}` | `(curly a b)` | +| `a{b;c}` | `(curly a (parameters c) b)` | +| `[x]` | `(vect x)` | +| `[x,y]` | `(vect x y)` | +| `[x;y]` | `(vcat x y)` | +| `[x y]` | `(hcat x y)` | +| `[x y; z t]` | `(vcat (row x y) (row z t))` | +| `[x;y;; z;t;;;]` | `(ncat 3 (nrow 2 (nrow 1 x y) (nrow 1 z t)))` | +| `[x for y in z, a in b]` | `(comprehension x (= y z) (= a b))` | +| `T[x for y in z]` | `(typed_comprehension T x (= y z))` | +| `(a, b, c)` | `(tuple a b c)` | +| `(a; b; c)` | `(block a (block b c))` | ### Macros diff --git a/doc/src/devdocs/inference.md b/doc/src/devdocs/inference.md index c8fea74995595b..6181a1f64c8463 100644 --- a/doc/src/devdocs/inference.md +++ b/doc/src/devdocs/inference.md @@ -37,9 +37,8 @@ m = first(mths) interp = Core.Compiler.NativeInterpreter() sparams = Core.svec() # this particular method doesn't have type-parameters optimize = true # run all inference optimizations -cached = false # force inference to happen (do not use cached results) types = Tuple{typeof(convert), atypes.parameters...} # Tuple{typeof(convert), Type{Int}, UInt} -Core.Compiler.typeinf_code(interp, types, sparams, optimize, cached) +Core.Compiler.typeinf_code(interp, m, types, sparams, optimize) ``` If your debugging adventures require a `MethodInstance`, you can look it up by diff --git a/doc/src/devdocs/reflection.md b/doc/src/devdocs/reflection.md index fbf0fd58d86a44..1a99f040a44932 100644 --- a/doc/src/devdocs/reflection.md +++ b/doc/src/devdocs/reflection.md @@ -96,7 +96,7 @@ as assignments, branches, and calls: ```jldoctest julia> Meta.lower(@__MODULE__, :( [1+2, sin(0.5)] )) :($(Expr(:thunk, CodeInfo( - @ none within `top-level scope' + @ none within `top-level scope` 1 ─ %1 = 1 + 2 │ %2 = sin(0.5) │ %3 = Base.vect(%1, %2) diff --git a/doc/src/manual/arrays.md b/doc/src/manual/arrays.md index 2afc264556713e..c3c014ccb64fe0 100644 --- a/doc/src/manual/arrays.md +++ b/doc/src/manual/arrays.md @@ -5,8 +5,8 @@ technical computing languages pay a lot of attention to their array implementati of other containers. Julia does not treat arrays in any special way. The array library is implemented almost completely in Julia itself, and derives its performance from the compiler, just like any other code written in Julia. As such, it's also possible to define custom array types by inheriting -from [`AbstractArray`](@ref). See the [manual section on the AbstractArray interface](@ref man-interface-array) for more details -on implementing a custom array type. +from [`AbstractArray`](@ref). See the [manual section on the AbstractArray interface](@ref man-interface-array) +for more details on implementing a custom array type. An array is a collection of objects stored in a multi-dimensional grid. In the most general case, an array may contain objects of type [`Any`](@ref). For most computational purposes, arrays should contain @@ -126,7 +126,7 @@ Any[] ### [Concatenation](@id man-array-concatenation) -If the arguments inside the square brackets are separated by semicolons (`;`) or newlines +If the arguments inside the square brackets are separated by single semicolons (`;`) or newlines instead of commas, then their contents are _vertically concatenated_ together instead of the arguments being used as elements themselves. @@ -154,7 +154,7 @@ julia> [1:2 6 ``` -Similarly, if the arguments are separated by tabs or spaces, then their contents are +Similarly, if the arguments are separated by tabs or spaces or double semicolons, then their contents are _horizontally concatenated_ together. ```jldoctest @@ -171,9 +171,13 @@ julia> [[1,2] [4,5] [7,8]] julia> [1 2 3] # Numbers can also be horizontally concatenated 1×3 Matrix{Int64}: 1 2 3 + +julia> [1;; 2;; 3;; 4] +1×4 Matrix{Int64}: + 1 2 3 4 ``` -Using semicolons (or newlines) and spaces (or tabs) can be combined to concatenate +Single semicolons (or newlines) and spaces (or tabs) can be combined to concatenate both horizontally and vertically at the same time. ```jldoctest @@ -189,17 +193,135 @@ julia> [zeros(Int, 2, 2) [1; 2] 0 0 1 0 0 2 3 4 5 + +julia> [[1 1]; 2 3; [4 4]] +3×2 Matrix{Int64}: + 1 1 + 2 3 + 4 4 +``` + +Spaces (and tabs) have a higher precedence than semicolons, performing any horizontal +concatenations first and then concatenating the result. Using double semicolons for the +horizontal concatenation, on the other hand, performs any vertical concatenations before +horizontally concatenating the result. + +```jldoctest +julia> [zeros(Int, 2, 2) ; [3 4] ;; [1; 2] ; 5] +3×3 Matrix{Int64}: + 0 0 1 + 0 0 2 + 3 4 5 + +julia> [1:2; 4;; 1; 3:4] +3×2 Matrix{Int64}: + 1 1 + 2 3 + 4 4 +``` + +Just as `;` and `;;` concatenate in the first and second dimension, using more semicolons +extends this same general scheme. The number of semicolons in the separator specifies the +particular dimension, so `;;;` concetenates in the third dimension, `;;;;` in the 4th, and +so on. Fewer semicolons take precedence, so the lower dimensions are generally concatenated +first. + +```jldoctest +julia> [1; 2;; 3; 4;; 5; 6;;; + 7; 8;; 9; 10;; 11; 12] +2×3×2 Array{Int64, 3}: +[:, :, 1] = + 1 3 5 + 2 4 6 + +[:, :, 2] = + 7 9 11 + 8 10 12 +``` + +Like before, spaces (and tabs) for horizontal concatenation have a higher precedence than +any number of semicolons. Thus, higher dimensional arrays can also be written by specifying +their rows first, with their elements textually arranged in a manner similar to their layout: + +```jldoctest +julia> [1 3 5 + 2 4 6;;; + 7 9 11 + 8 10 12] +2×3×2 Array{Int64, 3}: +[:, :, 1] = + 1 3 5 + 2 4 6 + +[:, :, 2] = + 7 9 11 + 8 10 12 + +julia> [1 2;;; 3 4;;;; 5 6;;; 7 8] +1×2×2×2 Array{Int64, 4}: +[:, :, 1, 1] = + 1 2 + +[:, :, 2, 1] = + 3 4 + +[:, :, 1, 2] = + 5 6 + +[:, :, 2, 2] = + 7 8 + +julia> [[1 2;;; 3 4];;;; [5 6];;; [7 8]] +1×2×2×2 Array{Int64, 4}: +[:, :, 1, 1] = + 1 2 + +[:, :, 2, 1] = + 3 4 + +[:, :, 1, 2] = + 5 6 + +[:, :, 2, 2] = + 7 8 +``` + +Although they both mean concatenation in the second dimension, spaces (or tabs) and `;;` +cannot appear in the same array expression unless the double semicolon is simply serving as +a "line continuation" character. This allows a single horizontal concatenation to span +multiple lines (without the line break being interpreted as a vertical concatenation). + +```jldoctest +julia> [1 2 ;; + 3 4] +1×4 Matrix{Int64}: + 1 2 3 4 +``` + +Terminating semicolons may also be used to add trailing length 1 dimensions. + +```jldoctest +julia> [1;;] +1×1 Matrix{Int64}: + 1 + +julia> [2; 3;;;] +2×1×1 Array{Int64, 3}: +[:, :, 1] = + 2 + 3 ``` More generally, concatenation can be accomplished through the [`cat`](@ref) function. These syntaxes are shorthands for function calls that themselves are convenience functions: -| Syntax | Function | Description | -|:----------------- |:--------------- |:-------------------------------------------------- | -| | [`cat`](@ref) | concatenate input arrays along dimension(s) `k` | -| `[A; B; C; ...]` | [`vcat`](@ref) | shorthand for `cat(A...; dims=1) | -| `[A B C ...]` | [`hcat`](@ref) | shorthand for `cat(A...; dims=2) | -| `[A B; C D; ...]` | [`hvcat`](@ref) | simultaneous vertical and horizontal concatenation | +| Syntax | Function | Description | +|:---------------------- |:---------------- |:---------------------------------------------------------------------------------------------------------- | +| | [`cat`](@ref) | concatenate input arrays along dimension(s) `k` | +| `[A; B; C; ...]` | [`vcat`](@ref) | shorthand for `cat(A...; dims=1) | +| `[A B C ...]` | [`hcat`](@ref) | shorthand for `cat(A...; dims=2) | +| `[A B; C D; ...]` | [`hvcat`](@ref) | simultaneous vertical and horizontal concatenation | +| `[A; C;; B; D;;; ...]` | [`hvncat`](@ref) | simultaneous n-dimensional concatenation, where number of semicolons indicate the dimension to concatenate | ### Typed array literals diff --git a/doc/src/manual/calling-c-and-fortran-code.md b/doc/src/manual/calling-c-and-fortran-code.md index 312e668afbd3f2..89d535fd543441 100644 --- a/doc/src/manual/calling-c-and-fortran-code.md +++ b/doc/src/manual/calling-c-and-fortran-code.md @@ -928,7 +928,7 @@ macro dlsym(func, lib) let zlocal = $z[] if zlocal == C_NULL zlocal = dlsym($(esc(lib))::Ptr{Cvoid}, $(esc(func)))::Ptr{Cvoid} - $z[] = $zlocal + $z[] = zlocal end zlocal end diff --git a/doc/src/manual/complex-and-rational-numbers.md b/doc/src/manual/complex-and-rational-numbers.md index 99e4a677e27241..ac48e5b420f5e4 100644 --- a/doc/src/manual/complex-and-rational-numbers.md +++ b/doc/src/manual/complex-and-rational-numbers.md @@ -8,7 +8,7 @@ behave as expected. ## Complex Numbers The global constant [`im`](@ref) is bound to the complex number *i*, representing the principal -square root of -1. (Using mathematicians' `i` or engineers' `j` for this global constant were rejected since they are such popular index variable names.) Since Julia allows numeric literals to be [juxtaposed with identifiers as coefficients](@ref man-numeric-literal-coefficients), +square root of -1. (Using mathematicians' `i` or engineers' `j` for this global constant was rejected since they are such popular index variable names.) Since Julia allows numeric literals to be [juxtaposed with identifiers as coefficients](@ref man-numeric-literal-coefficients), this binding suffices to provide convenient syntax for complex numbers, similar to the traditional mathematical notation: diff --git a/doc/src/manual/control-flow.md b/doc/src/manual/control-flow.md index 1b785070c0e1a4..63832cc4c90c96 100644 --- a/doc/src/manual/control-flow.md +++ b/doc/src/manual/control-flow.md @@ -817,7 +817,7 @@ The power of the `try/catch` construct lies in the ability to unwind a deeply ne immediately to a much higher level in the stack of calling functions. There are situations where no error has occurred, but the ability to unwind the stack and pass a value to a higher level is desirable. Julia provides the [`rethrow`](@ref), [`backtrace`](@ref), [`catch_backtrace`](@ref) -and [`Base.catch_stack`](@ref) functions for more advanced error handling. +and [`current_exceptions`](@ref) functions for more advanced error handling. ### `finally` Clauses diff --git a/doc/src/manual/distributed-computing.md b/doc/src/manual/distributed-computing.md index 16f57314e945b3..bfcfb883e8228f 100644 --- a/doc/src/manual/distributed-computing.md +++ b/doc/src/manual/distributed-computing.md @@ -656,7 +656,7 @@ Once finalized, a reference becomes invalid and cannot be used in any further ca ## Local invocations Data is necessarily copied over to the remote node for execution. This is the case for both -remotecalls and when data is stored to a[`RemoteChannel`](@ref) / [`Future`](@ref Distributed.Future) on +remotecalls and when data is stored to a [`RemoteChannel`](@ref) / [`Future`](@ref Distributed.Future) on a different node. As expected, this results in a copy of the serialized objects on the remote node. However, when the destination node is the local node, i.e. the calling process id is the same as the remote node id, it is executed diff --git a/doc/src/manual/documentation.md b/doc/src/manual/documentation.md index 8a3d41ffc8171a..ab52536e01cb90 100644 --- a/doc/src/manual/documentation.md +++ b/doc/src/manual/documentation.md @@ -343,17 +343,17 @@ for your custom type that returns the documentation on a per-instance basis. For ```julia struct MyType - value::String + value::Int end Docs.getdoc(t::MyType) = "Documentation for MyType with value $(t.value)" -x = MyType("x") -y = MyType("y") +x = MyType(1) +y = MyType(2) ``` -`?x` will display "Documentation for MyType with value x" while `?y` will display -"Documentation for MyType with value y". +`?x` will display "Documentation for MyType with value 1" while `?y` will display +"Documentation for MyType with value 2". ## Syntax Guide diff --git a/doc/src/manual/interfaces.md b/doc/src/manual/interfaces.md index a6539c457c6fc4..7333434b87afb8 100644 --- a/doc/src/manual/interfaces.md +++ b/doc/src/manual/interfaces.md @@ -371,7 +371,7 @@ julia> A[1:2,:] 2.0 5.0 8.0 ``` -In this example it is accomplished by defining `Base.similar{T}(A::SparseArray, ::Type{T}, dims::Dims)` +In this example it is accomplished by defining `Base.similar(A::SparseArray, ::Type{T}, dims::Dims) where T` to create the appropriate wrapped array. (Note that while `similar` supports 1- and 2-argument forms, in most case you only need to specialize the 3-argument form.) For this to work it's important that `SparseArray` is mutable (supports `setindex!`). Defining `similar`, `getindex` and @@ -479,7 +479,7 @@ they are iterable collections of their characters (see [Strings](@ref) for more) The next two steps (selecting the output array and implementation) are dependent upon determining a single answer for a given set of arguments. Broadcast must take all the varied types of its arguments and collapse them down to just one output array and one -implementation. Broadcast calls this single answer a "style." Every broadcastable object +implementation. Broadcast calls this single answer a "style". Every broadcastable object each has its own preferred style, and a promotion-like system is used to combine these styles into a single answer — the "destination style". @@ -549,7 +549,7 @@ Base.showarg(io::IO, A::ArrayAndChar, toplevel) = print(io, typeof(A), " with ch ``` -You might want broadcasting to preserve the `char` "metadata." First we define +You might want broadcasting to preserve the `char` "metadata". First we define ```jldoctest ArrayAndChar; output = false Base.BroadcastStyle(::Type{<:ArrayAndChar}) = Broadcast.ArrayStyle{ArrayAndChar}() diff --git a/doc/src/manual/stacktraces.md b/doc/src/manual/stacktraces.md index 50cdfd5b1ed64a..40130d9e7dd445 100644 --- a/doc/src/manual/stacktraces.md +++ b/doc/src/manual/stacktraces.md @@ -185,7 +185,7 @@ ERROR: Whoops! [...] ``` -## Exception stacks and `catch_stack` +## Exception stacks and [`current_exceptions`](@ref) !!! compat "Julia 1.1" Exception stacks requires at least Julia 1.1. @@ -195,7 +195,7 @@ identify the root cause of a problem. The julia runtime supports this by pushing *exception stack* as it occurs. When the code exits a `catch` normally, any exceptions which were pushed onto the stack in the associated `try` are considered to be successfully handled and are removed from the stack. -The stack of current exceptions can be accessed using the experimental [`Base.catch_stack`](@ref) function. For example, +The stack of current exceptions can be accessed using the [`current_exceptions`](@ref) function. For example, ```julia-repl julia> try @@ -204,7 +204,7 @@ julia> try try error("(B) An exception while handling the exception") catch - for (exc, bt) in Base.catch_stack() + for (exc, bt) in current_exceptions() showerror(stdout, exc, bt) println(stdout) end @@ -233,7 +233,7 @@ exiting both catch blocks normally (i.e., without throwing a further exception) and are no longer accessible. The exception stack is stored on the `Task` where the exceptions occurred. When a task fails with uncaught exceptions, -`catch_stack(task)` may be used to inspect the exception stack for that task. +`current_exceptions(task)` may be used to inspect the exception stack for that task. ## Comparison with [`backtrace`](@ref) diff --git a/src/abi_aarch64.cpp b/src/abi_aarch64.cpp index 4d55d3d69a8de1..3a0a5c25dc8597 100644 --- a/src/abi_aarch64.cpp +++ b/src/abi_aarch64.cpp @@ -16,7 +16,7 @@ struct ABI_AArch64Layout : AbiLayout { Type *get_llvm_vectype(jl_datatype_t *dt) const { // Assume jl_is_datatype(dt) && !jl_is_abstracttype(dt) - // `!dt->mutabl && dt->pointerfree && !dt->haspadding && dt->nfields > 0` + // `!dt->name->mutabl && dt->pointerfree && !dt->haspadding && dt->nfields > 0` if (dt->layout == NULL || jl_is_layout_opaque(dt->layout)) return nullptr; size_t nfields = dt->layout->nfields; @@ -62,7 +62,7 @@ Type *get_llvm_vectype(jl_datatype_t *dt) const Type *get_llvm_fptype(jl_datatype_t *dt) const { // Assume jl_is_datatype(dt) && !jl_is_abstracttype(dt) - // `!dt->mutabl && dt->pointerfree && !dt->haspadding && dt->nfields == 0` + // `!dt->name->mutabl && dt->pointerfree && !dt->haspadding && dt->nfields == 0` Type *lltype; // Check size first since it's cheaper. switch (jl_datatype_size(dt)) { @@ -88,7 +88,7 @@ Type *get_llvm_fptype(jl_datatype_t *dt) const Type *get_llvm_fp_or_vectype(jl_datatype_t *dt) const { // Assume jl_is_datatype(dt) && !jl_is_abstracttype(dt) - if (dt->mutabl || dt->layout->npointers || dt->layout->haspadding) + if (dt->name->mutabl || dt->layout->npointers || dt->layout->haspadding) return nullptr; return dt->layout->nfields ? get_llvm_vectype(dt) : get_llvm_fptype(dt); } diff --git a/src/abi_arm.cpp b/src/abi_arm.cpp index 1a5d3d06513689..b0ae29a623abbc 100644 --- a/src/abi_arm.cpp +++ b/src/abi_arm.cpp @@ -33,7 +33,7 @@ bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab) override Type *get_llvm_fptype(jl_datatype_t *dt) const { // Assume jl_is_datatype(dt) && !jl_is_abstracttype(dt) - if (dt->mutabl || jl_datatype_nfields(dt) != 0) + if (dt->name->mutabl || jl_datatype_nfields(dt) != 0) return NULL; Type *lltype; // Check size first since it's cheaper. diff --git a/src/aotcompile.cpp b/src/aotcompile.cpp index db3f9f4b0e22e2..93683d320e6b90 100644 --- a/src/aotcompile.cpp +++ b/src/aotcompile.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #if defined(USE_POLLY) #include #include @@ -616,11 +617,20 @@ void addMachinePasses(legacy::PassManagerBase *PM, TargetMachine *TM) } + // this defines the set of optimization passes defined for Julia at various optimization levels. // it assumes that the TLI and TTI wrapper passes have already been added. void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, bool lower_intrinsics, bool dump_native) { + // Note: LLVM 12 disabled the hoisting of common instruction + // before loop vectorization (https://reviews.llvm.org/D84108). + // + // TODO: CommonInstruction hoisting/sinking enables AllocOpt + // to merge allocations and sometimes eliminate them, + // since AllocOpt does not handle PhiNodes. + // Enable this instruction hoisting because of this and Union benchmarks. + auto simplifyCFGOptions = SimplifyCFGOptions().hoistCommonInsts(true); #ifdef JL_DEBUG_BUILD PM->add(createGCInvariantVerifierPass(true)); PM->add(createVerifierPass()); @@ -628,7 +638,7 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, PM->add(createConstantMergePass()); if (opt_level < 2) { - PM->add(createCFGSimplificationPass()); + PM->add(createCFGSimplificationPass(simplifyCFGOptions)); if (opt_level == 1) { PM->add(createSROAPass()); PM->add(createInstructionCombiningPass()); @@ -672,7 +682,7 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, PM->add(createBasicAAWrapperPass()); } - PM->add(createCFGSimplificationPass()); + PM->add(createCFGSimplificationPass(simplifyCFGOptions)); PM->add(createDeadCodeEliminationPass()); PM->add(createSROAPass()); @@ -686,12 +696,13 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, PM->add(createAllocOptPass()); // consider AggressiveInstCombinePass at optlevel > 2 PM->add(createInstructionCombiningPass()); - PM->add(createCFGSimplificationPass()); + PM->add(createCFGSimplificationPass(simplifyCFGOptions)); if (dump_native) PM->add(createMultiVersioningPass()); PM->add(createSROAPass()); PM->add(createInstSimplifyLegacyPass()); PM->add(createJumpThreadingPass()); + PM->add(createCorrelatedValuePropagationPass()); PM->add(createReassociatePass()); @@ -743,6 +754,7 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, // loops over Union-typed arrays to vectorize. PM->add(createInstructionCombiningPass()); PM->add(createJumpThreadingPass()); + PM->add(createCorrelatedValuePropagationPass()); PM->add(createDeadStoreEliminationPass()); // More dead allocation (store) deletion before loop optimization @@ -751,12 +763,21 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, // see if all of the constant folding has exposed more loops // to simplification and deletion // this helps significantly with cleaning up iteration - PM->add(createCFGSimplificationPass()); + PM->add(createCFGSimplificationPass()); // See note above, don't hoist instructions before LV PM->add(createLoopDeletionPass()); PM->add(createInstructionCombiningPass()); PM->add(createLoopVectorizePass()); PM->add(createLoopLoadEliminationPass()); - PM->add(createCFGSimplificationPass()); + // Cleanup after LV pass + PM->add(createInstructionCombiningPass()); + PM->add(createCFGSimplificationPass( // Aggressive CFG simplification + SimplifyCFGOptions() + .forwardSwitchCondToPhi(true) + .convertSwitchToLookupTable(true) + .needCanonicalLoops(false) + .hoistCommonInsts(true) + // .sinkCommonInsts(true) // FIXME: Causes assertion in llvm-late-lowering + )); PM->add(createSLPVectorizerPass()); // might need this after LLVM 11: //PM->add(createVectorCombinePass()); diff --git a/src/ast.scm b/src/ast.scm index 6ed530718e3dbe..d89cae95ad1850 100644 --- a/src/ast.scm +++ b/src/ast.scm @@ -61,6 +61,12 @@ (else (string e)))) +(define (deparse-semicolons n) + ; concatenate n semicolons + (if (<= n 0) + "" + (string ";" (deparse-semicolons (1- n))))) + (define (deparse e (ilvl 0)) (cond ((or (symbol? e) (number? e)) (string e)) ((string? e) (print-to-string e)) @@ -134,7 +140,14 @@ ((hcat) (string #\[ (deparse-arglist (cdr e) " ") #\])) ((typed_hcat) (string (deparse (cadr e)) (deparse (cons 'hcat (cddr e))))) + ((ncat) (string #\[ (deparse-arglist (cddr e) (string (deparse-semicolons (cadr e)) " ")) + (if (= (length (cddr e)) 1) + (deparse-semicolons (cadr e)) + "") #\])) + ((typed_ncat) (string (deparse (cadr e)) + (deparse (cons 'ncat (cddr e))))) ((row) (deparse-arglist (cdr e) " ")) + ((nrow) (deparse-arglist (cddr e) (string (deparse-semicolons (cadr e)) " "))) ((braces) (string #\{ (deparse-arglist (cdr e) ", ") #\})) ((bracescat) (string #\{ (deparse-arglist (cdr e) "; ") #\})) ((string) diff --git a/src/builtins.c b/src/builtins.c index 601fb4e1e7b231..0134e4e24eb33a 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -183,7 +183,7 @@ static int egal_types(jl_value_t *a, jl_value_t *b, jl_typeenv_t *env, int tvar_ } if (dt == jl_symbol_type) return 0; - assert(!dt->mutabl); + assert(!dt->name->mutabl); return jl_egal__bits(a, b, dt); } @@ -324,7 +324,7 @@ static uintptr_t type_object_id_(jl_value_t *v, jl_varidx_t *env) JL_NOTSAFEPOIN } if (tv == jl_symbol_type) return ((jl_sym_t*)v)->hash; - assert(!tv->mutabl); + assert(!tv->name->mutabl); return immut_id_(tv, v, tv->hash); } @@ -358,7 +358,7 @@ static uintptr_t immut_id_(jl_datatype_t *dt, jl_value_t *v, uintptr_t h) JL_NOT uint8_t sel = ((uint8_t*)vo)[jl_field_size(dt, f) - 1]; fieldtype = (jl_datatype_t*)jl_nth_union_component((jl_value_t*)fieldtype, sel); } - assert(jl_is_datatype(fieldtype) && !fieldtype->abstract && !fieldtype->mutabl); + assert(jl_is_datatype(fieldtype) && !fieldtype->name->abstract && !fieldtype->name->mutabl); int32_t first_ptr = fieldtype->layout->first_ptr; if (first_ptr >= 0 && ((jl_value_t**)vo)[first_ptr] == NULL) { // If the field is a inline immutable that can be can be undef @@ -391,7 +391,7 @@ static uintptr_t NOINLINE jl_object_id__cold(jl_datatype_t *dt, jl_value_t *v) J return memhash32_seed(jl_string_data(v), jl_string_len(v), 0xedc3b677); #endif } - if (dt->mutabl) + if (dt->name->mutabl) return inthash((uintptr_t)v); return immut_id_(dt, v, dt->hash); } @@ -451,7 +451,7 @@ JL_CALLABLE(jl_f_sizeof) if (jl_is_datatype(x)) { jl_datatype_t *dx = (jl_datatype_t*)x; if (dx->layout == NULL) { - if (dx->abstract) + if (dx->name->abstract) jl_errorf("Abstract type %s does not have a definite size.", jl_symbol_name(dx->name->name)); else jl_errorf("Argument is an incomplete %s type and does not have a definite size.", jl_symbol_name(dx->name->name)); @@ -473,7 +473,7 @@ JL_CALLABLE(jl_f_sizeof) return jl_box_long((1+jl_svec_len(x))*sizeof(void*)); jl_datatype_t *dt = (jl_datatype_t*)jl_typeof(x); assert(jl_is_datatype(dt)); - assert(!dt->abstract); + assert(!dt->name->abstract); return jl_box_long(jl_datatype_size(dt)); } @@ -840,7 +840,7 @@ JL_CALLABLE(jl_f_setfield) assert(jl_is_datatype(st)); if (st == jl_module_type) jl_error("cannot assign variables in other modules"); - if (!st->mutabl) + if (!st->name->mutabl) jl_errorf("setfield! immutable struct of type %s cannot be changed", jl_symbol_name(st->name->name)); size_t idx; if (jl_is_long(args[1])) { @@ -1337,6 +1337,32 @@ static int equiv_field_types(jl_value_t *old, jl_value_t *ft) return 1; } +static int references_name(jl_value_t *p, jl_typename_t *name, int affects_layout) JL_NOTSAFEPOINT +{ + if (jl_is_uniontype(p)) + return references_name(((jl_uniontype_t*)p)->a, name, affects_layout) || + references_name(((jl_uniontype_t*)p)->b, name, affects_layout); + if (jl_is_unionall(p)) + return references_name((jl_value_t*)((jl_unionall_t*)p)->var, name, 0) || + references_name(((jl_unionall_t*)p)->body, name, affects_layout); + if (jl_is_typevar(p)) + return references_name(((jl_tvar_t*)p)->ub, name, 0) || + references_name(((jl_tvar_t*)p)->lb, name, 0); + if (jl_is_datatype(p)) { + jl_datatype_t *dp = (jl_datatype_t*)p; + if (affects_layout && dp->name == name) + return 1; + affects_layout = dp->types == NULL || jl_svec_len(dp->types) != 0; + size_t i, l = jl_nparams(p); + for (i = 0; i < l; i++) { + if (references_name(jl_tparam(p, i), name, affects_layout)) + return 1; + } + } + return 0; +} + + JL_CALLABLE(jl_f__typebody) { JL_NARGS(_typebody!, 1, 2); @@ -1361,6 +1387,14 @@ JL_CALLABLE(jl_f__typebody) else { dt->types = (jl_svec_t*)ft; jl_gc_wb(dt, ft); + size_t i, nf = jl_svec_len(ft); + for (i = 0; i < nf; i++) { + jl_value_t *fld = jl_svecref(ft, i); + if (references_name(fld, dt->name, 1)) { + dt->name->references_self = 1; + break; + } + } } } @@ -1386,8 +1420,6 @@ static int equiv_type(jl_value_t *ta, jl_value_t *tb) jl_datatype_t *dtb = (jl_datatype_t*)jl_unwrap_unionall(tb); if (!(jl_typeof(dta) == jl_typeof(dtb) && dta->name->name == dtb->name->name && - dta->abstract == dtb->abstract && - dta->mutabl == dtb->mutabl && (jl_svec_len(jl_field_names(dta)) != 0 || dta->size == dtb->size) && dta->ninitialized == dtb->ninitialized && jl_egal((jl_value_t*)jl_field_names(dta), (jl_value_t*)jl_field_names(dtb)) && diff --git a/src/cgutils.cpp b/src/cgutils.cpp index 1a3a8de523e576..51f697d80eb631 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -982,10 +982,13 @@ static Value *emit_sizeof(jl_codectx_t &ctx, const jl_cgval_t &p) static Value *emit_datatype_mutabl(jl_codectx_t &ctx, Value *dt) { - Value *Ptr = emit_bitcast(ctx, decay_derived(ctx, dt), T_pint8); - Value *Idx = ConstantInt::get(T_size, offsetof(jl_datatype_t, mutabl)); + Value *Ptr = emit_bitcast(ctx, decay_derived(ctx, dt), T_ppint8); + Value *Idx = ConstantInt::get(T_size, offsetof(jl_datatype_t, name)); + Value *Nam = tbaa_decorate(tbaa_const, + ctx.builder.CreateAlignedLoad(T_pint8, ctx.builder.CreateInBoundsGEP(T_pint8, Ptr, Idx), Align(sizeof(int8_t*)))); + Value *Idx2 = ConstantInt::get(T_size, offsetof(jl_typename_t, name)); Value *mutabl = tbaa_decorate(tbaa_const, - ctx.builder.CreateAlignedLoad(T_int8, ctx.builder.CreateInBoundsGEP(T_int8, Ptr, Idx), Align(1))); + ctx.builder.CreateAlignedLoad(T_int8, ctx.builder.CreateInBoundsGEP(T_int8, Nam, Idx2), Align(1))); return ctx.builder.CreateTrunc(mutabl, T_int1); } @@ -1111,7 +1114,7 @@ static bool _can_optimize_isa(jl_value_t *type, int &counter) if (jl_is_concrete_type(type)) return true; jl_datatype_t *dt = (jl_datatype_t*)jl_unwrap_unionall(type); - if (jl_is_datatype(dt) && !dt->abstract && jl_subtype(dt->name->wrapper, type)) + if (jl_is_datatype(dt) && !dt->name->abstract && jl_subtype(dt->name->wrapper, type)) return true; return false; } @@ -1227,7 +1230,7 @@ static std::pair emit_isa(jl_codectx_t &ctx, const jl_cgval_t &x, track_pjlvalue(ctx, literal_pointer_val(ctx, intersected_type))), false); } jl_datatype_t *dt = (jl_datatype_t*)jl_unwrap_unionall(intersected_type); - if (jl_is_datatype(dt) && !dt->abstract && jl_subtype(dt->name->wrapper, type)) { + if (jl_is_datatype(dt) && !dt->name->abstract && jl_subtype(dt->name->wrapper, type)) { // intersection is a supertype of all instances of its constructor, // so the isa test reduces to a comparison of the typename by pointer return std::make_pair( @@ -1713,7 +1716,7 @@ static bool emit_getfield_unknownidx(jl_codectx_t &ctx, assert(jl_is_concrete_type(jft)); idx = idx0(); Value *ptr = maybe_decay_tracked(ctx, data_pointer(ctx, strct)); - if (!stt->mutabl && !(maybe_null && (jft == (jl_value_t*)jl_bool_type || + if (!stt->name->mutabl && !(maybe_null && (jft == (jl_value_t*)jl_bool_type || ((jl_datatype_t*)jft)->layout->npointers))) { // just compute the pointer and let user load it when necessary Type *fty = julia_type_to_llvm(ctx, jft); @@ -1806,7 +1809,7 @@ static jl_cgval_t emit_getfield_knownidx(jl_codectx_t &ctx, const jl_cgval_t &st // ConstantAsMetadata::get(ConstantInt::get(T_int8, 0)), // ConstantAsMetadata::get(ConstantInt::get(T_int8, union_max)) })); Value *tindex = ctx.builder.CreateNUWAdd(ConstantInt::get(T_int8, 1), tindex0); - if (jt->mutabl) { + if (jt->name->mutabl) { // move value to an immutable stack slot (excluding tindex) Type *ET = IntegerType::get(jl_LLVMContext, 8 * al); AllocaInst *lv = emit_static_alloca(ctx, ET); @@ -1817,7 +1820,7 @@ static jl_cgval_t emit_getfield_knownidx(jl_codectx_t &ctx, const jl_cgval_t &st return mark_julia_slot(addr, jfty, tindex, tbaa); } assert(jl_is_concrete_type(jfty)); - if (!jt->mutabl && !(maybe_null && (jfty == (jl_value_t*)jl_bool_type || + if (!jt->name->mutabl && !(maybe_null && (jfty == (jl_value_t*)jl_bool_type || ((jl_datatype_t*)jfty)->layout->npointers))) { // just compute the pointer and let user load it when necessary return mark_julia_slot(addr, jfty, NULL, tbaa); @@ -2432,7 +2435,7 @@ static Value *_boxed_special(jl_codectx_t &ctx, const jl_cgval_t &vinfo, Type *t v = ctx.builder.CreateExtractValue(v, makeArrayRef(&zero, 1)); box = call_with_attrs(ctx, box_ssavalue_func, v); } - else if (!jb->abstract && jl_datatype_nbits(jb) == 0) { + else if (!jb->name->abstract && jl_datatype_nbits(jb) == 0) { // singleton assert(jb->instance != NULL); return track_pjlvalue(ctx, literal_pointer_val(ctx, jb->instance)); @@ -2836,7 +2839,7 @@ static void emit_setfield(jl_codectx_t &ctx, jl_datatype_t *sty, const jl_cgval_t &strct, size_t idx0, const jl_cgval_t &rhs, bool checked, bool wb) { - if (sty->mutabl || !checked) { + if (sty->name->mutabl || !checked) { assert(strct.ispointer()); size_t byte_offset = jl_field_offset(sty, idx0); Value *addr = data_pointer(ctx, strct); @@ -2892,7 +2895,7 @@ static jl_cgval_t emit_new_struct(jl_codectx_t &ctx, jl_value_t *ty, size_t narg assert(jl_is_concrete_type(ty)); jl_datatype_t *sty = (jl_datatype_t*)ty; size_t nf = jl_datatype_nfields(sty); - if (nf > 0 || sty->mutabl) { + if (nf > 0 || sty->name->mutabl) { if (deserves_stack(ty)) { Type *lt = julia_type_to_llvm(ctx, ty); unsigned na = nargs < nf ? nargs : nf; diff --git a/src/codegen.cpp b/src/codegen.cpp index 3534dff7f62000..3d17dd781d68bd 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1365,7 +1365,7 @@ static inline jl_cgval_t update_julia_type(jl_codectx_t &ctx, const jl_cgval_t & if (jl_is_concrete_type(utyp)) alwaysboxed = !jl_is_pointerfree(utyp); else - alwaysboxed = !((jl_datatype_t*)utyp)->abstract && ((jl_datatype_t*)utyp)->mutabl; + alwaysboxed = !((jl_datatype_t*)utyp)->name->abstract && ((jl_datatype_t*)utyp)->name->mutabl; if (alwaysboxed) { // discovered that this union-split type must actually be isboxed if (v.Vboxed) { @@ -3152,7 +3152,7 @@ static bool emit_builtin_call(jl_codectx_t &ctx, jl_cgval_t *ret, jl_value_t *f, else if (f == jl_builtin_sizeof && nargs == 1) { const jl_cgval_t &obj = argv[1]; jl_datatype_t *sty = (jl_datatype_t*)jl_unwrap_unionall(obj.typ); - assert(jl_string_type->mutabl); + assert(jl_string_type->name->mutabl); if (sty == jl_string_type || sty == jl_simplevector_type) { if (obj.constant) { size_t sz; @@ -7968,6 +7968,10 @@ extern "C" void jl_init_llvm(void) // and to ensure that it is 16-byte aligned for out-going calls, // to ensure compatibility with GCC codes options.StackAlignmentOverride = 16; +#endif +#ifdef JL_DEBUG_BUILD + // LLVM defaults to tls stack guard, which causes issues with Julia's tls implementation + options.StackProtectorGuard = StackProtectorGuards::Global; #endif Triple TheTriple(sys::getProcessTriple()); #if defined(FORCE_ELF) diff --git a/src/datatype.c b/src/datatype.c index 35127af7abbb49..8f2229b4f1515b 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -60,7 +60,7 @@ JL_DLLEXPORT jl_methtable_t *jl_new_method_table(jl_sym_t *name, jl_module_t *mo return mt; } -JL_DLLEXPORT jl_typename_t *jl_new_typename_in(jl_sym_t *name, jl_module_t *module) +JL_DLLEXPORT jl_typename_t *jl_new_typename_in(jl_sym_t *name, jl_module_t *module, int abstract, int mutabl) { jl_task_t *ct = jl_current_task; jl_typename_t *tn = @@ -73,6 +73,9 @@ JL_DLLEXPORT jl_typename_t *jl_new_typename_in(jl_sym_t *name, jl_module_t *modu tn->linearcache = jl_emptysvec; tn->names = NULL; tn->hash = bitmix(bitmix(module ? module->build_id : 0, name->hash), 0xa1ada1da); + tn->abstract = abstract; + tn->mutabl = mutabl; + tn->references_self = 0; tn->mt = NULL; tn->partial = NULL; return tn; @@ -220,8 +223,8 @@ unsigned jl_special_vector_alignment(size_t nfields, jl_value_t *t) STATIC_INLINE int jl_is_datatype_make_singleton(jl_datatype_t *d) { - return (!d->abstract && jl_datatype_size(d) == 0 && d != jl_symbol_type && d->name != jl_array_typename && - d->isconcretetype && !d->mutabl); + return (!d->name->abstract && jl_datatype_size(d) == 0 && d != jl_symbol_type && d->name != jl_array_typename && + d->isconcretetype && !d->name->mutabl); } STATIC_INLINE void jl_maybe_allocate_singleton_instance(jl_datatype_t *st) @@ -315,31 +318,6 @@ int jl_pointer_egal(jl_value_t *t) return 0; } -static int references_name(jl_value_t *p, jl_typename_t *name, int affects_layout) JL_NOTSAFEPOINT -{ - if (jl_is_uniontype(p)) - return references_name(((jl_uniontype_t*)p)->a, name, affects_layout) || - references_name(((jl_uniontype_t*)p)->b, name, affects_layout); - if (jl_is_unionall(p)) - return references_name((jl_value_t*)((jl_unionall_t*)p)->var, name, 0) || - references_name(((jl_unionall_t*)p)->body, name, affects_layout); - if (jl_is_typevar(p)) - return references_name(((jl_tvar_t*)p)->ub, name, 0) || - references_name(((jl_tvar_t*)p)->lb, name, 0); - if (jl_is_datatype(p)) { - jl_datatype_t *dp = (jl_datatype_t*)p; - if (affects_layout && dp->name == name) - return 1; - affects_layout = dp->types == NULL || jl_svec_len(dp->types) != 0; - size_t i, l = jl_nparams(p); - for (i = 0; i < l; i++) { - if (references_name(jl_tparam(p, i), name, affects_layout)) - return 1; - } - } - return 0; -} - static void throw_ovf(int should_malloc, void *desc, jl_datatype_t* st, int offset) { if (should_malloc) @@ -360,8 +338,7 @@ void jl_compute_field_offsets(jl_datatype_t *st) if (w->types == NULL) // we got called too early--we'll be back return; size_t i, nfields = jl_svec_len(st->types); - int isinlinealloc = st->isconcretetype && !st->mutabl; - int isbitstype = isinlinealloc; + int isinlinealloc = st->isconcretetype && !st->name->mutabl && !st->name->references_self; assert(st->ninitialized <= nfields); if (st == w && st->layout) { // this check allows us to force re-computation of the layout for some types during init @@ -420,22 +397,10 @@ void jl_compute_field_offsets(jl_datatype_t *st) } } - // compute whether this type may ever be inlined - // based solely on whether its definition is self-referential - if (isinlinealloc) { - size_t i, nf = jl_svec_len(w->types); - for (i = 0; i < nf; i++) { - jl_value_t *fld = jl_svecref(w->types, i); - if (references_name(fld, w->name, 1)) { - isinlinealloc = 0; - isbitstype = 0; - break; - } - } - for (i = 0; isbitstype && i < nfields; i++) { - jl_value_t *fld = jl_field_type(st, i); - isbitstype = jl_isbits(fld); - } + int isbitstype = isinlinealloc; + for (i = 0; isbitstype && i < nfields; i++) { + jl_value_t *fld = jl_field_type(st, i); + isbitstype = jl_isbits(fld); } // if we didn't reuse the layout above, compute it now @@ -593,8 +558,6 @@ JL_DLLEXPORT jl_datatype_t *jl_new_datatype( jl_gc_wb(t, t->parameters); t->types = ftypes; if (ftypes != NULL) jl_gc_wb(t, t->types); - t->abstract = abstract; - t->mutabl = mutabl; t->ninitialized = ninitialized; t->size = 0; @@ -602,9 +565,11 @@ JL_DLLEXPORT jl_datatype_t *jl_new_datatype( if (jl_is_typename(name)) { // This code-path is used by the Serialization module to by-pass normal expectations tn = (jl_typename_t*)name; + tn->abstract = abstract; + tn->mutabl = mutabl; } else { - tn = jl_new_typename_in((jl_sym_t*)name, module); + tn = jl_new_typename_in((jl_sym_t*)name, module, abstract, mutabl); if (super == jl_function_type || super == jl_builtin_type || is_anonfn_typename(jl_symbol_name(name))) { // Callable objects (including compiler-generated closures) get independent method tables // as an optimization @@ -686,6 +651,12 @@ JL_DLLEXPORT jl_datatype_t * jl_new_foreign_type(jl_sym_t *name, return bt; } +JL_DLLEXPORT int jl_is_foreign_type(jl_datatype_t *dt) +{ + return jl_is_datatype(dt) && dt->layout && dt->layout->fielddesc_type == 3; +} + + // bits constructors ---------------------------------------------------------- JL_DLLEXPORT jl_value_t *jl_new_bits(jl_value_t *dt, void *data) diff --git a/src/disasm.cpp b/src/disasm.cpp index c8c5a759d028be..90264c7b69e823 100644 --- a/src/disasm.cpp +++ b/src/disasm.cpp @@ -249,7 +249,7 @@ void DILineInfoPrinter::emit_lineinfo(raw_ostream &Out, std::vector if (frame.Line != UINT_MAX && frame.Line != 0) Out << ":" << frame.Line; StringRef method = StringRef(frame.FunctionName).rtrim(';'); - Out << " within `" << method << "'"; + Out << " within `" << method << "`"; if (collapse_recursive) { while (nctx < nframes) { const DILineInfo &frame = DI.at(nframes - 1 - nctx); diff --git a/src/dump.c b/src/dump.c index 5a3388851dd720..a6ae96ae86f47b 100644 --- a/src/dump.c +++ b/src/dump.c @@ -8,6 +8,7 @@ #include "julia.h" #include "julia_internal.h" +#include "julia_gcext.h" #include "builtin_proto.h" #include "serialize.h" @@ -270,7 +271,7 @@ static void jl_serialize_datatype(jl_serializer_state *s, jl_datatype_t *dt) JL_ write_int32(s->s, dt->size); int has_instance = (dt->instance != NULL); int has_layout = (dt->layout != NULL); - write_uint8(s->s, dt->abstract | (dt->mutabl << 1) | (has_layout << 2) | (has_instance << 3)); + write_uint8(s->s, dt->name->abstract | (has_layout << 1) | (has_instance << 2)); write_uint8(s->s, dt->hasfreetypevars | (dt->isconcretetype << 1) | (dt->isdispatchtuple << 2) @@ -279,7 +280,7 @@ static void jl_serialize_datatype(jl_serializer_state *s, jl_datatype_t *dt) JL_ | (dt->isinlinealloc << 5) | (dt->has_concrete_subtype << 6) | (dt->cached_by_hash << 7)); - if (!dt->abstract) { + if (!dt->name->abstract) { write_uint16(s->s, dt->ninitialized); } write_int32(s->s, dt->hash); @@ -815,10 +816,15 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li jl_serialize_value(s, tn->wrapper); jl_serialize_value(s, tn->mt); ios_write(s->s, (char*)&tn->hash, sizeof(tn->hash)); + write_uint8(s->s, tn->abstract | (tn->mutabl << 1) | (tn->references_self << 2)); } return; } + if (jl_is_foreign_type(t)) { + jl_error("Cannot serialize instances of foreign datatypes"); + } + char *data = (char*)jl_data_ptr(v); size_t i, j, np = t->layout->npointers; uint32_t nf = t->layout->nfields; @@ -833,7 +839,7 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li ios_write(s->s, last, prevptr - last); jl_value_t *e = *(jl_value_t**)prevptr; JL_GC_PROMISE_ROOTED(e); - if (t->mutabl && e && jl_field_isptr(t, i - 1) && jl_is_cpointer(e) && + if (t->name->mutabl && e && jl_field_isptr(t, i - 1) && jl_is_cpointer(e) && jl_unbox_voidpointer(e) != (void*)-1 && jl_unbox_voidpointer(e) != NULL) // reset Ptr fields to C_NULL (but keep MAP_FAILED / INVALID_HANDLE) jl_serialize_cnull(s, jl_typeof(e)); @@ -849,7 +855,7 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li } if (i == nf) break; - if (t->mutabl && jl_is_cpointer_type(jl_field_type(t, i)) && *(void**)ptr != (void*)-1) { + if (t->name->mutabl && jl_is_cpointer_type(jl_field_type(t, i)) && *(void**)ptr != (void*)-1) { if (ptr > last) ios_write(s->s, last, ptr - last); char *n = NULL; @@ -1264,10 +1270,9 @@ static jl_value_t *jl_deserialize_datatype(jl_serializer_state *s, int pos, jl_v uint8_t flags = read_uint8(s->s); uint8_t memflags = read_uint8(s->s); dt->size = size; - dt->abstract = flags & 1; - dt->mutabl = (flags >> 1) & 1; - int has_layout = (flags >> 2) & 1; - int has_instance = (flags >> 3) & 1; + int abstract = flags & 1; + int has_layout = (flags >> 1) & 1; + int has_instance = (flags >> 2) & 1; dt->hasfreetypevars = memflags & 1; dt->isconcretetype = (memflags >> 1) & 1; dt->isdispatchtuple = (memflags >> 2) & 1; @@ -1276,10 +1281,10 @@ static jl_value_t *jl_deserialize_datatype(jl_serializer_state *s, int pos, jl_v dt->isinlinealloc = (memflags >> 5) & 1; dt->has_concrete_subtype = (memflags >> 6) & 1; dt->cached_by_hash = (memflags >> 7) & 1; - if (!dt->abstract) - dt->ninitialized = read_uint16(s->s); - else + if (abstract) dt->ninitialized = 0; + else + dt->ninitialized = read_uint16(s->s); dt->hash = read_int32(s->s); if (has_layout) { @@ -1729,6 +1734,10 @@ static jl_value_t *jl_deserialize_value_any(jl_serializer_state *s, uint8_t tag, tn->mt = (jl_methtable_t*)jl_deserialize_value(s, (jl_value_t**)&tn->mt); jl_gc_wb(tn, tn->mt); ios_read(s->s, (char*)&tn->hash, sizeof(tn->hash)); + int8_t flags = read_int8(s->s); + tn->abstract = flags & 1; + tn->mutabl = (flags>>1) & 1; + tn->references_self = (flags>>2) & 1; } else { jl_datatype_t *dt = (jl_datatype_t*)jl_unwrap_unionall(jl_get_global(m, sym)); diff --git a/src/features_aarch64.h b/src/features_aarch64.h index 6a834610f0cde0..88d988a35f03f3 100644 --- a/src/features_aarch64.h +++ b/src/features_aarch64.h @@ -35,11 +35,11 @@ JL_FEATURE_DEF(fp16fml, 23, 0) // HWCAP_ASIMDFHM, ARMv8.2-FHM JL_FEATURE_DEF(dit, 24, 0) // HWCAP_DIT, ARMv8.4-DIT. Required in ARMv8.4 // JL_FEATURE_DEF(uscat, 25, UINT32_MAX) // HWCAP_USCAT, ARMv8.4-LSE JL_FEATURE_DEF_NAME(rcpc_immo, 26, 0, "rcpc-immo") // HWCAP_ILRCPC, ARMv8.4-RCPC. Required in ARMv8.4 -JL_FEATURE_DEF(fmi, 27, 0) // HWCAP_FLAGM, ARMv8.4-CondM. Requird in ARMv8.4 +JL_FEATURE_DEF(flagm, 27, 120000) // HWCAP_FLAGM, ARMv8.4-CondM. Required in ARMv8.4 JL_FEATURE_DEF(ssbs, 28, 0) // HWCAP_SSBS JL_FEATURE_DEF(sb, 29, 0) // HWCAP_SB. Required in ARMv8.5 -JL_FEATURE_DEF(pa, 30, 0) // HWCAP_PACA -// JL_FEATURE_DEF(pa, 31, 0) // HWCAP_PACG. Merged with `pa`. +JL_FEATURE_DEF(pauth, 30, 120000) // HWCAP_PACA +// JL_FEATURE_DEF(pa, 31, 0) // HWCAP_PACG. Merged with `pauth`. // hwcap2 JL_FEATURE_DEF(ccdp, 32 + 0, 0) // HWCAP2_DCPODP, ARMv8.2-DCCVADP. Required in ARMv8.5 diff --git a/src/intrinsics.cpp b/src/intrinsics.cpp index 834034d367a9fd..deb174f700c771 100644 --- a/src/intrinsics.cpp +++ b/src/intrinsics.cpp @@ -202,8 +202,9 @@ static Constant *julia_const_to_llvm(jl_codectx_t &ctx, const void *ptr, jl_data const uint8_t *ov = (const uint8_t*)ptr + offs; if (jl_is_uniontype(ft)) { // compute the same type layout as julia_struct_to_llvm - size_t fsz = jl_field_size(bt, i); - size_t al = jl_field_align(bt, i); + size_t fsz = 0, al = 0; + (void)jl_islayout_inline(ft, &fsz, &al); + fsz = jl_field_size(bt, i); uint8_t sel = ((const uint8_t*)ptr)[offs + fsz - 1]; jl_value_t *active_ty = jl_nth_union_component(ft, sel); size_t active_sz = jl_datatype_size(active_ty); diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index f9671d472f7921..82611bfb50dfab 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -275,6 +275,8 @@ XX(jl_init_restored_modules) \ XX(jl_init) \ XX(jl_init_with_image) \ + XX(jl_init__threading) \ + XX(jl_init_with_image__threading) \ XX(jl_install_sigint_handler) \ XX(jl_instantiate_type_in_env) \ XX(jl_instantiate_unionall) \ diff --git a/src/jlapi.c b/src/jlapi.c index 7de2a9a70f1ccc..2192d4cee665f0 100644 --- a/src/jlapi.c +++ b/src/jlapi.c @@ -91,6 +91,19 @@ JL_DLLEXPORT void jl_init(void) free(libbindir); } +// HACK: remove this for Julia 1.8 (see ) +JL_DLLEXPORT void jl_init__threading(void) +{ + jl_init(); +} + +// HACK: remove this for Julia 1.8 (see ) +JL_DLLEXPORT void jl_init_with_image__threading(const char *julia_bindir, + const char *image_relative_path) +{ + jl_init_with_image(julia_bindir, image_relative_path); +} + JL_DLLEXPORT jl_value_t *jl_eval_string(const char *str) { jl_value_t *r; diff --git a/src/jltypes.c b/src/jltypes.c index deb04669ec133c..8aae9e8b7599b7 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -62,9 +62,8 @@ static int has_free_typevars(jl_value_t *v, jl_typeenv_t *env) JL_NOTSAFEPOINT if (expect == 0 || env == NULL) return expect; size_t i; - for (i=0; i < jl_nparams(v); i++) { - if (has_free_typevars(jl_tparam(v,i), env)) { - assert(expect); + for (i = 0; i < jl_nparams(v); i++) { + if (has_free_typevars(jl_tparam(v, i), env)) { return 1; } } @@ -1082,7 +1081,7 @@ void jl_precompute_memoized_dt(jl_datatype_t *dt, int cacheable) { int istuple = (dt->name == jl_tuple_typename); dt->hasfreetypevars = 0; - dt->isconcretetype = !dt->abstract; + dt->isconcretetype = !dt->name->abstract; dt->isdispatchtuple = istuple; size_t i, l = jl_nparams(dt); for (i = 0; i < l; i++) { @@ -1398,8 +1397,6 @@ static jl_value_t *inst_datatype_inner(jl_datatype_t *dt, jl_svec_t *p, jl_value ndt->types = jl_emptysvec; } } - ndt->mutabl = dt->mutabl; - ndt->abstract = dt->abstract; ndt->size = 0; jl_precompute_memoized_dt(ndt, cacheable); if (istuple) @@ -1437,7 +1434,7 @@ static jl_value_t *inst_datatype_inner(jl_datatype_t *dt, jl_svec_t *p, jl_value } else if (!isnamedtuple && !istuple) { assert(ftypes != jl_emptysvec || jl_field_names(ndt) == jl_emptysvec); - assert(ftypes == jl_emptysvec || !ndt->abstract); + assert(ftypes == jl_emptysvec || !ndt->name->abstract); if (ftypes == jl_emptysvec) { ndt->types = ftypes; } @@ -1453,7 +1450,7 @@ static jl_value_t *inst_datatype_inner(jl_datatype_t *dt, jl_svec_t *p, jl_value // now publish the finished result if (cacheable) { - if (!jl_is_primitivetype(dt) && ndt->types != NULL && !ndt->abstract) { + if (!jl_is_primitivetype(dt) && ndt->types != NULL && !ndt->name->abstract) { jl_compute_field_offsets(ndt); } jl_cache_type_(ndt); @@ -1883,11 +1880,12 @@ void jl_init_types(void) JL_GC_DISABLED jl_type_typename->mt = jl_type_type_mt; // initialize them. lots of cycles. - jl_datatype_type->name = jl_new_typename_in(jl_symbol("DataType"), core); + // NOTE: types are not actually mutable, but we want to ensure they are heap-allocated with stable addresses + jl_datatype_type->name = jl_new_typename_in(jl_symbol("DataType"), core, 0, 1); jl_datatype_type->name->wrapper = (jl_value_t*)jl_datatype_type; jl_datatype_type->super = (jl_datatype_t*)jl_type_type; jl_datatype_type->parameters = jl_emptysvec; - jl_datatype_type->name->names = jl_perm_symsvec(20, + jl_datatype_type->name->names = jl_perm_symsvec(18, "name", "super", "parameters", @@ -1898,8 +1896,6 @@ void jl_init_types(void) JL_GC_DISABLED "size", "ninitialized", "hash", - "abstract", - "mutable", "hasfreetypevars", "isconcretetype", "isdispatchtuple", @@ -1908,7 +1904,7 @@ void jl_init_types(void) JL_GC_DISABLED "isinlinealloc", "has_concrete_subtype", "cached_by_hash"); - jl_datatype_type->types = jl_svec(20, + jl_datatype_type->types = jl_svec(18, jl_typename_type, jl_datatype_type, jl_simplevector_type, @@ -1916,32 +1912,28 @@ void jl_init_types(void) JL_GC_DISABLED jl_any_type, // instance jl_any_type, jl_any_type, jl_any_type, jl_any_type, // properties jl_any_type, jl_any_type, jl_any_type, jl_any_type, - jl_any_type, jl_any_type, jl_any_type, jl_any_type, - jl_any_type, jl_any_type); - jl_datatype_type->abstract = 0; - // NOTE: types are not actually mutable, but we want to ensure they are heap-allocated with stable addresses - jl_datatype_type->mutabl = 1; + jl_any_type, jl_any_type, jl_any_type, jl_any_type); jl_datatype_type->ninitialized = 3; jl_precompute_memoized_dt(jl_datatype_type, 1); - jl_typename_type->name = jl_new_typename_in(jl_symbol("TypeName"), core); + jl_typename_type->name = jl_new_typename_in(jl_symbol("TypeName"), core, 0, 1); jl_typename_type->name->wrapper = (jl_value_t*)jl_typename_type; jl_typename_type->name->mt = jl_nonfunction_mt; jl_typename_type->super = jl_any_type; jl_typename_type->parameters = jl_emptysvec; - jl_typename_type->name->names = jl_perm_symsvec(9, "name", "module", + jl_typename_type->name->names = jl_perm_symsvec(12, "name", "module", "names", "wrapper", "cache", "linearcache", - "hash", "mt", "partial"); - jl_typename_type->types = jl_svec(9, jl_symbol_type, jl_any_type, jl_simplevector_type, + "hash", "abstract", "mutable", "references_self", + "mt", "partial"); + jl_typename_type->types = jl_svec(12, jl_symbol_type, jl_any_type, jl_simplevector_type, jl_type_type, jl_simplevector_type, jl_simplevector_type, - jl_any_type, jl_methtable_type, jl_any_type); - jl_typename_type->abstract = 0; - jl_typename_type->mutabl = 1; + jl_any_type, jl_any_type, jl_any_type, jl_any_type, + jl_methtable_type, jl_any_type); jl_typename_type->ninitialized = 2; jl_precompute_memoized_dt(jl_typename_type, 1); - jl_methtable_type->name = jl_new_typename_in(jl_symbol("MethodTable"), core); + jl_methtable_type->name = jl_new_typename_in(jl_symbol("MethodTable"), core, 0, 1); jl_methtable_type->name->wrapper = (jl_value_t*)jl_methtable_type; jl_methtable_type->name->mt = jl_nonfunction_mt; jl_methtable_type->super = jl_any_type; @@ -1955,12 +1947,10 @@ void jl_init_types(void) JL_GC_DISABLED jl_any_type, jl_any_type/*module*/, jl_any_type/*any vector*/, jl_any_type/*long*/, jl_any_type/*int32*/, jl_any_type/*uint8*/, jl_any_type/*uint8*/); - jl_methtable_type->abstract = 0; - jl_methtable_type->mutabl = 1; jl_methtable_type->ninitialized = 5; jl_precompute_memoized_dt(jl_methtable_type, 1); - jl_symbol_type->name = jl_new_typename_in(jl_symbol("Symbol"), core); + jl_symbol_type->name = jl_new_typename_in(jl_symbol("Symbol"), core, 0, 1); jl_symbol_type->name->wrapper = (jl_value_t*)jl_symbol_type; jl_symbol_type->name->mt = jl_nonfunction_mt; jl_symbol_type->super = jl_any_type; @@ -1968,20 +1958,16 @@ void jl_init_types(void) JL_GC_DISABLED jl_symbol_type->name->names = jl_emptysvec; jl_symbol_type->types = jl_emptysvec; jl_symbol_type->size = 0; - jl_symbol_type->abstract = 0; - jl_symbol_type->mutabl = 1; jl_symbol_type->ninitialized = 0; jl_precompute_memoized_dt(jl_symbol_type, 1); - jl_simplevector_type->name = jl_new_typename_in(jl_symbol("SimpleVector"), core); + jl_simplevector_type->name = jl_new_typename_in(jl_symbol("SimpleVector"), core, 0, 1); jl_simplevector_type->name->wrapper = (jl_value_t*)jl_simplevector_type; jl_simplevector_type->name->mt = jl_nonfunction_mt; jl_simplevector_type->super = jl_any_type; jl_simplevector_type->parameters = jl_emptysvec; jl_simplevector_type->name->names = jl_emptysvec; jl_simplevector_type->types = jl_emptysvec; - jl_simplevector_type->abstract = 0; - jl_simplevector_type->mutabl = 1; jl_simplevector_type->ninitialized = 0; jl_precompute_memoized_dt(jl_simplevector_type, 1); @@ -2518,11 +2504,12 @@ void jl_init_types(void) JL_GC_DISABLED jl_svecset(jl_datatype_type->types, 15, jl_bool_type); jl_svecset(jl_datatype_type->types, 16, jl_bool_type); jl_svecset(jl_datatype_type->types, 17, jl_bool_type); - jl_svecset(jl_datatype_type->types, 18, jl_bool_type); - jl_svecset(jl_datatype_type->types, 19, jl_bool_type); jl_svecset(jl_typename_type->types, 1, jl_module_type); - jl_svecset(jl_typename_type->types, 6, jl_long_type); jl_svecset(jl_typename_type->types, 3, jl_type_type); + jl_svecset(jl_typename_type->types, 6, jl_long_type); + jl_svecset(jl_typename_type->types, 7, jl_bool_type); + jl_svecset(jl_typename_type->types, 8, jl_bool_type); + jl_svecset(jl_typename_type->types, 9, jl_bool_type); jl_svecset(jl_methtable_type->types, 4, jl_long_type); jl_svecset(jl_methtable_type->types, 6, jl_module_type); jl_svecset(jl_methtable_type->types, 7, jl_array_any_type); diff --git a/src/julia-parser.scm b/src/julia-parser.scm index c6510dcbd9536c..1f594ff0a14142 100644 --- a/src/julia-parser.scm +++ b/src/julia-parser.scm @@ -1218,6 +1218,8 @@ (loop (list* 'typed_vcat ex (cdr al)))) ((comprehension) (loop (list* 'typed_comprehension ex (cdr al)))) + ((ncat) + (loop (list* 'typed_ncat ex (cdr al)))) (else (error "unknown parse-cat result (internal error)"))))))) ((|.|) (disallow-space s ex t) @@ -1849,60 +1851,125 @@ (take-token s)) `(comprehension ,gen)))) -(define (parse-matrix s first closer gotnewline last-end-symbol) - (define (fix head v) (cons head (reverse v))) - (define (update-outer v outer) - (cond ((null? v) outer) - ((null? (cdr v)) (cons (car v) outer)) - (else (cons (fix 'row v) outer)))) - (define semicolon (eqv? (peek-token s) #\;)) +(define (parse-array s first closer gotnewline last-end-symbol) + (define (fix head v) + (cons head (reverse v))) + (define (unfixrow l) + (cons (reverse (cdaar l)) (if (and (null? (cdar l)) (null? (cdr l))) + '() + (cons (cdar l) (cdr l))))) + (define (fixcat head d v) + (cons head (cons d (reverse v)))) + (define (ncons a n l) + (if (< n 1) + l + (ncons a (1- n) (cons a l)))) + (define (fix-level ah n) + (if (length= ah 1) + (car ah) + (if (= n 1) + (fix 'row ah) + (fixcat 'nrow (1- n) ah)))) + (define (collapse-level n l i) + (if (> n 0) + (let* ((lhfix (fix-level (car l) i)) + (lnew (if (null? (cdr l)) + (list (list lhfix)) + (cons (cons lhfix (cadr l)) (cddr l))))) + (collapse-level (1- n) lnew (1+ i))) + l)) + (define (parse-array-inner s a is-row-first semicolon-count max-level closer gotnewline gotlinesep) + (define (process-semicolon next) + (set! semicolon-count (1+ semicolon-count)) + (set! max-level (max max-level semicolon-count)) + (if (and (null? is-row-first) (= semicolon-count 2) (not (eqv? next #\;))) + ; finding ;; that isn't a row-separator makes it column-first + (set! is-row-first #f)) + (set! a (collapse-level 1 a semicolon-count))) + (define (restore-lower-dim-lists next) + (if (and (not gotlinesep) (not (memv next (list #\; 'for closer #\newline)))) + (set! a (ncons '() semicolon-count a)))) + (let ((t (if (or gotnewline (eqv? (peek-token s) #\newline)) + #\newline + (require-token s)))) + (if (eqv? t closer) + (begin + (take-token s) + (set! a (collapse-level (- max-level semicolon-count) a (1+ semicolon-count))) + (cond ((= max-level 0) + (if (length= (car a) 1) + (fix 'vect (car a)) + (fix 'hcat (car a)))) + ((= max-level 1) + (fix 'vcat (car a))) + (else + (fixcat 'ncat max-level (car a))))) + (case t + ((#\newline) + (or gotnewline (take-token s)) + (let ((next (peek-token s))) + (if (and (> semicolon-count 0) (eqv? next #\;)) + (error (string "semicolons may appear before or after a line break in an array expression, " + "but not both"))) + (if (and (= semicolon-count 0) + (not (memv next (list #\; 'for closer #\newline)))) + ; treat a linebreak prior to a value as a semicolon if no previous semicolons observed + (process-semicolon next)) + (restore-lower-dim-lists next) + (parse-array-inner s a is-row-first semicolon-count max-level closer #f gotlinesep))) + ((#\;) + (or gotnewline (take-token s)) + (if (and (> semicolon-count 0) (ts:space? s)) ; disallow [a; ;b] + (error "multiple semicolons must be adjacent in an array expression")) + (let ((next (peek-token s))) + (let ((is-line-sep + (if (and (not (null? is-row-first)) is-row-first (= semicolon-count 1)) + (cond ((eqv? next #\newline) #t) ; [a b ;;... + ((not (or (eof-object? next) (eqv? next #\;))) ; [a b ;;... + (error (string "cannot mix space and ;; separators in an array expression, " + "except to wrap a line"))) + (else #f)) ; [a b ;; for REPL, [a ;;... + #f))) ; [a ; b ;; c ; d... + (if is-line-sep + (begin (set! a (unfixrow a)) + (set! max-level + (if (null? (cdr a)) + 0 ; no prior single semicolon + max-level))) + (begin (process-semicolon next) + (restore-lower-dim-lists next))) + (parse-array-inner s a is-row-first semicolon-count max-level closer #f is-line-sep)))) + ((#\,) + (error "unexpected comma in array expression")) + ((#\] #\}) + (error (string "unexpected \"" t "\""))) + ((for) + (if (and (length= (car a) 1) + (null? (cdr a))) + (begin ;; if we get here, there must have been some kind of space or separator + ;;(expect-space-before s 'for) + (take-token s) + (parse-comprehension s (caar a) closer)) + (error "invalid comprehension syntax"))) + (else + (if (and (not gotlinesep) (pair? (car a)) (not (ts:space? s))) + (error (string "expected \"" closer "\" or separator in arguments to \"" + (if (eqv? closer #\]) #\[ #\{) " " closer + "\"; got \"" + (deparse (caar a)) t "\""))) + (let ((u (parse-eq* s))) + (set! a (cons (cons u (car a)) (cdr a))) + (if (= (length (car a)) 2) + ; at least 2 elements separated by space found [a b...], [a; b c...] + (if (null? is-row-first) + (set! is-row-first #t) + (if (not is-row-first) + (error (string "cannot mix space and \";;\" separators in an array expression, " + "except to wrap a line")))))) + (parse-array-inner s a is-row-first 0 max-level closer #f #f)))))) ;; if a [ ] expression is a cat expression, `end` is not special (with-bindings ((end-symbol last-end-symbol)) - (let loop ((vec (list first)) - (outer '())) - (let ((t (if (or (eqv? (peek-token s) #\newline) gotnewline) - #\newline - (require-token s)))) - (if (eqv? t closer) - (begin (take-token s) - (if (pair? outer) - (fix 'vcat (update-outer vec outer)) - (if (or (null? vec) (null? (cdr vec))) - (fix 'vect vec) ; [x] => (vect x) - (fix 'hcat vec)))) ; [x y] => (hcat x y) - (case t - ((#\;) - (take-token s) - (if (eqv? (peek-token s) #\;) - (parser-depwarn s (string "Multiple semicolons in an array concatenation expression currently have no effect, " - "but may have a new meaning in a future version of Julia.") - "Please remove extra semicolons to preserve forward compatibility e.g. [1;;3] => [1;3].")) - (set! gotnewline #f) - (loop '() (update-outer vec outer))) - ((#\newline) - (or gotnewline (take-token s)) - (set! gotnewline #f) - (loop '() (update-outer vec outer))) - ((#\,) - (error "unexpected comma in matrix expression")) - ((#\] #\}) - (error (string "unexpected \"" t "\""))) - ((for) - (if (and (not semicolon) - (length= outer 1) - (null? vec)) - (begin ;; if we get here, there must have been some kind of space or separator - ;;(expect-space-before s 'for) - (take-token s) - (parse-comprehension s (car outer) closer)) - (error "invalid comprehension syntax"))) - (else - (if (and (pair? vec) (not (ts:space? s))) - (error (string "expected \"" closer "\" or separator in arguments to \"" - (if (eqv? closer #\]) #\[ #\{) " " closer - "\"; got \"" - (deparse (car vec)) t "\""))) - (loop (cons (parse-eq* s) vec) outer)))))))) + (parse-array-inner s (list (list first)) '() 0 0 closer gotnewline #f))) (define (expect-space-before s t) (if (not (ts:space? s)) @@ -1929,9 +1996,9 @@ (take-token s) (if (memv (peek-token s) (list #\, closer)) (parse-vect s first closer) - (parse-matrix s first closer #t last-end-symbol))) + (parse-array s first closer #t last-end-symbol))) (else - (parse-matrix s first closer #f last-end-symbol))))))) + (parse-array s first closer #f last-end-symbol))))))) (define (kw-to-= e) (if (kwarg? e) (cons '= (cdr e)) e)) (define (=-to-kw e) (if (assignment? e) (cons 'kw (cdr e)) e)) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index ca274ef552f5b4..6bc8401c9b3ddc 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -1599,7 +1599,7 @@ ,(expand-update-operator op op= (car e) rhs T)))) (else (if (and (pair? lhs) (eq? op= '=) - (not (memq (car lhs) '(|.| tuple vcat typed_hcat typed_vcat)))) + (not (memq (car lhs) '(|.| tuple vcat ncat typed_hcat typed_vcat typed_ncat)))) (error (string "invalid assignment location \"" (deparse lhs) "\""))) (expand-update-operator- op op= lhs rhs declT)))) @@ -1976,6 +1976,113 @@ ,@(apply append rows)))) `(call ,@vcat ,@a)))))) +(define (expand-ncat e (hvncat '((top hvncat)))) + (define (is-row a) (and (pair? a) + (or (eq? (car a) 'row) + (eq? (car a) 'nrow)))) + (define (is-1d a) (not (any is-row a))) + (define (sum xs) (foldl + 0 xs)) + (define (get-shape a is-row-first d) + (define (zip xss) (apply map list xss)) + (define (get-next x) + (cond ((or (not (is-row x)) + (and (eq? (car x) 'nrow) (> d (1+ (cadr x)))) + (and (eq? (car x) 'row) (> d 1))) + (list x)) + ((eq? (car x) 'nrow) (cddr x)) + (else (cdr x)))) + ; describe the shape of the concatenation + (cond ((or (= d 0) + (and (not is-row-first) (= d 1))) + (length a)) + ((and is-row-first (= d 3)) + (get-shape a is-row-first (1- d))) + (else + (let ((ashape + (map (lambda (x) + (get-shape (get-next x) is-row-first (1- d))) + a))) + (if (pair? (car ashape)) + (let ((zipashape (zip ashape))) + (cons (sum (car zipashape)) + (cons (car zipashape) + (map (lambda (x) + (apply append x)) + (cdr zipashape))))) + (list (sum ashape) ashape)))))) + (define (get-dims a is-row-first d) + (cond ((and (< d 2) (not (is-row (car a)))) + (list (length a))) + ((= d 1) + (list (car (get-dims (cdar a) is-row-first 0)) (length a))) + ((and (= d 3) is-row-first) + (get-dims a is-row-first 2)) + (else + (let ((anext (if (and (pair? (car a)) + (eq? (caar a) 'nrow) + (= d (1+ (cadar a)))) + (cddar a) + (list (car a))))) + (cons (length a) (get-dims anext is-row-first (1- d))))))) + (define (is-balanced s) + ; determine whether there are exactly the same number of elements along each axis + (= 0 (sum (map (lambda (x y) + (sum (map (lambda (z) + (- z y)) + x))) + (cdr s) (map car (cdr s)))))) + (define (hasrows-flatten a) + ; (car ) stores if a row was observed + (foldl (lambda (x y) + (let ((r (car y)) + (yt (cdr y))) + (if (is-row x) + (if (eq? (car x) 'nrow) + (let* ((raflat (append (hasrows-flatten (cddr x)))) + (aflat (cdr raflat)) + (rinner (car raflat)) + (r (if (null? (or r rinner)) + (and r rinner) + r))) + (if (and (not (null? r)) + (or (null? rinner) (and (not r) rinner)) + (and (= (cadr x) 2) r)) + (error "cannot mix space and ;; separators in an array expression, except to wrap a line")) + (cons (if (and (= (cadr x) 2) (null? r)) + #f + r) + (append aflat yt))) + (if (or (null? r) r) + (cons #t (append (reverse (cdr x)) yt)) + (error "cannot mix space and ;; separators in an array expression, except to wrap a line"))) + (cons r (cons x yt))))) + (list '()) a)) + (define (tf a) (if a '(true) '(false))) + (define (tuplize s) + (cons 'tuple (reverse (map (lambda (x) + (cons 'tuple x)) + (cons (list (car s)) (cdr s)))))) + (let* ((d (cadr e)) + (a (cddr e)) + (raflat (hasrows-flatten a)) + (r (car raflat)) + (is-row-first (if (null? r) #f r)) + (aflat (reverse (cdr raflat)))) + (if (any assignment? aflat) + (error (string "misplaced assignment statement in \"" (deparse e) "\""))) + (if (has-parameters? aflat) + (error "unexpected parameters in array expression")) + (expand-forms + (if (is-1d a) + `(call ,@hvncat ,d ,@aflat) + (if (any vararg? aflat) + (error (string "Splatting ... in an hvncat with multiple dimensions is not supported")) + (let ((shape (get-shape a is-row-first d))) + (if (is-balanced shape) + (let ((dims `(tuple ,@(reverse (get-dims a is-row-first d))))) + `(call ,@hvncat ,dims ,(tf is-row-first) ,@aflat)) + `(call ,@hvncat ,(tuplize shape) ,(tf is-row-first) ,@aflat)))))))) + (define (expand-property-destruct lhss x) (if (not (length= lhss 1)) (error (string "invalid assignment location \"" (deparse lhs) "\""))) @@ -2220,7 +2327,7 @@ (expand-tuple-destruct lhss x)))) ((typed_hcat) (error "invalid spacing in left side of indexed assignment")) - ((typed_vcat) + ((typed_vcat typed_ncat) (error "unexpected \";\" in left side of indexed assignment")) ((ref) ;; (= (ref a . idxs) rhs) @@ -2257,7 +2364,7 @@ `(block ,@(cdr e) (decl ,(car e) ,T) (= ,(car e) ,rhs)))))) - ((vcat) + ((vcat ncat) ;; (= (vcat . args) rhs) (error "use \"(a, b) = ...\" to assign multiple values")) (else @@ -2493,6 +2600,8 @@ 'vcat expand-vcat + 'ncat expand-ncat + 'typed_hcat (lambda (e) (if (any assignment? (cddr e)) @@ -2505,6 +2614,12 @@ (e (cdr e))) (expand-vcat e `((top typed_vcat) ,t) `((top typed_hvcat) ,t) `((top typed_hvcat_rows) ,t)))) + 'typed_ncat + (lambda (e) + (let ((t (cadr e)) + (e (cdr e))) + (expand-ncat e `((top typed_hvncat) ,t)))) + '|'| (lambda (e) (expand-forms `(call |'| ,(cadr e)))) 'generator diff --git a/src/julia.h b/src/julia.h index cd3b2f9efa190d..946740f8f61e3b 100644 --- a/src/julia.h +++ b/src/julia.h @@ -429,6 +429,9 @@ typedef struct { jl_svec_t *cache; // sorted array jl_svec_t *linearcache; // unsorted array intptr_t hash; + uint8_t abstract; + uint8_t mutabl; + uint8_t references_self; struct _jl_methtable_t *mt; jl_array_t *partial; // incomplete instantiations of this type } jl_typename_t; @@ -489,8 +492,6 @@ typedef struct _jl_datatype_t { int32_t size; // TODO: move to _jl_datatype_layout_t int32_t ninitialized; uint32_t hash; - uint8_t abstract; - uint8_t mutabl; // memoized properties uint8_t hasfreetypevars; // majority part of isconcrete computation uint8_t isconcretetype; // whether this type can have instances @@ -1136,10 +1137,10 @@ static inline int jl_is_layout_opaque(const jl_datatype_layout_t *l) JL_NOTSAFEP #define jl_is_svec(v) jl_typeis(v,jl_simplevector_type) #define jl_is_simplevector(v) jl_is_svec(v) #define jl_is_datatype(v) jl_typeis(v,jl_datatype_type) -#define jl_is_mutable(t) (((jl_datatype_t*)t)->mutabl) -#define jl_is_mutable_datatype(t) (jl_is_datatype(t) && (((jl_datatype_t*)t)->mutabl)) -#define jl_is_immutable(t) (!((jl_datatype_t*)t)->mutabl) -#define jl_is_immutable_datatype(t) (jl_is_datatype(t) && (!((jl_datatype_t*)t)->mutabl)) +#define jl_is_mutable(t) (((jl_datatype_t*)t)->name->mutabl) +#define jl_is_mutable_datatype(t) (jl_is_datatype(t) && (((jl_datatype_t*)t)->name->mutabl)) +#define jl_is_immutable(t) (!((jl_datatype_t*)t)->name->mutabl) +#define jl_is_immutable_datatype(t) (jl_is_datatype(t) && (!((jl_datatype_t*)t)->name->mutabl)) #define jl_is_uniontype(v) jl_typeis(v,jl_uniontype_type) #define jl_is_typevar(v) jl_typeis(v,jl_tvar_type) #define jl_is_unionall(v) jl_typeis(v,jl_unionall_type) @@ -1208,7 +1209,7 @@ STATIC_INLINE int jl_is_primitivetype(void *v) JL_NOTSAFEPOINT STATIC_INLINE int jl_is_structtype(void *v) JL_NOTSAFEPOINT { return (jl_is_datatype(v) && - !((jl_datatype_t*)(v))->abstract && + !((jl_datatype_t*)(v))->name->abstract && !jl_is_primitivetype(v)); } @@ -1224,7 +1225,7 @@ STATIC_INLINE int jl_is_datatype_singleton(jl_datatype_t *d) JL_NOTSAFEPOINT STATIC_INLINE int jl_is_abstracttype(void *v) JL_NOTSAFEPOINT { - return (jl_is_datatype(v) && ((jl_datatype_t*)(v))->abstract); + return (jl_is_datatype(v) && ((jl_datatype_t*)(v))->name->abstract); } STATIC_INLINE int jl_is_array_type(void *t) JL_NOTSAFEPOINT @@ -1315,7 +1316,7 @@ STATIC_INLINE int jl_egal_(jl_value_t *a JL_MAYBE_UNROOTED, jl_value_t *b JL_MAY jl_datatype_t *dt = (jl_datatype_t*)jl_typeof(a); if (dt != (jl_datatype_t*)jl_typeof(b)) return 0; - if (dt->mutabl) { + if (dt->name->mutabl) { if (dt == jl_simplevector_type || dt == jl_string_type || dt == jl_datatype_type) return jl_egal__special(a, b, dt); return 0; @@ -1355,7 +1356,7 @@ STATIC_INLINE int jl_is_concrete_type(jl_value_t *v) JL_NOTSAFEPOINT JL_DLLEXPORT int jl_isa_compileable_sig(jl_tupletype_t *type, jl_method_t *definition); // type constructors -JL_DLLEXPORT jl_typename_t *jl_new_typename_in(jl_sym_t *name, jl_module_t *inmodule); +JL_DLLEXPORT jl_typename_t *jl_new_typename_in(jl_sym_t *name, jl_module_t *inmodule, int abstract, int mutabl); JL_DLLEXPORT jl_tvar_t *jl_new_typevar(jl_sym_t *name, jl_value_t *lb, jl_value_t *ub); JL_DLLEXPORT jl_value_t *jl_instantiate_unionall(jl_unionall_t *u, jl_value_t *p); JL_DLLEXPORT jl_value_t *jl_apply_type(jl_value_t *tc, jl_value_t **params, size_t n); diff --git a/src/julia_gcext.h b/src/julia_gcext.h index 3ca729e722dba4..6787dafb4b7ee6 100644 --- a/src/julia_gcext.h +++ b/src/julia_gcext.h @@ -49,6 +49,8 @@ JL_DLLEXPORT jl_datatype_t *jl_new_foreign_type( int haspointers, int large); +JL_DLLEXPORT int jl_is_foreign_type(jl_datatype_t *dt); + JL_DLLEXPORT size_t jl_gc_max_internal_obj_size(void); JL_DLLEXPORT size_t jl_gc_external_obj_hdr_size(void); diff --git a/src/processor_arm.cpp b/src/processor_arm.cpp index 908b7889f3a019..a411314e34e9d7 100644 --- a/src/processor_arm.cpp +++ b/src/processor_arm.cpp @@ -215,7 +215,7 @@ static constexpr FeatureDep deps[] = { {ccdp, ccpp}, {sve, fullfp16}, {fp16fml, fullfp16}, - {altnzcv, fmi}, + {altnzcv, flagm}, {sve2, sve}, {sve2_aes, sve2}, {sve2_aes, aes}, @@ -237,7 +237,7 @@ constexpr auto armv8_2a = armv8_1a | get_feature_masks(v8_2a, ccpp); constexpr auto armv8_2a_crypto = armv8_2a | get_feature_masks(aes, sha2); constexpr auto armv8_3a = armv8_2a | get_feature_masks(v8_3a, jsconv, complxnum, rcpc); constexpr auto armv8_3a_crypto = armv8_3a | get_feature_masks(aes, sha2); -constexpr auto armv8_4a = armv8_3a | get_feature_masks(v8_4a, dit, rcpc_immo, fmi); +constexpr auto armv8_4a = armv8_3a | get_feature_masks(v8_4a, dit, rcpc_immo, flagm); constexpr auto armv8_4a_crypto = armv8_4a | get_feature_masks(aes, sha2); constexpr auto armv8_5a = armv8_4a | get_feature_masks(v8_5a, sb, ccdp, altnzcv, fptoint); constexpr auto armv8_6a = armv8_5a | get_feature_masks(v8_6a, i8mm, bf16); @@ -256,7 +256,7 @@ constexpr auto armv8_6a = armv8_5a | get_feature_masks(v8_6a, i8mm, bf16); // .SM4: sm4 // .DP: dotprod // .FHM: fp16fml -// .TS: fmi, altnzcz +// .TS: flagm, altnzcz // .RNDR: rand // ID_AA64ISAR1_EL1 @@ -1191,7 +1191,7 @@ static NOINLINE std::pair> _get_host_cpu() features[1] = (uint32_t)jl_getauxval(AT_HWCAP2); #ifdef _CPU_AARCH64_ if (test_nbit(features, 31)) // HWCAP_PACG - set_bit(features, Feature::pa, true); + set_bit(features, Feature::pauth, true); #endif auto cpuinfo = get_cpuinfo(); auto arch = get_elf_arch(); @@ -1419,7 +1419,7 @@ static inline void enable_depends(FeatureList &features) if (test_nbit(features, Feature::v8_4a)) { set_bit(features, Feature::dit, true); set_bit(features, Feature::rcpc_immo, true); - set_bit(features, Feature::fmi, true); + set_bit(features, Feature::flagm, true); } if (test_nbit(features, Feature::v8_5a)) { set_bit(features, Feature::sb, true); diff --git a/src/rtutils.c b/src/rtutils.c index 382141f3eee6a3..07e4c969ddbfa5 100644 --- a/src/rtutils.c +++ b/src/rtutils.c @@ -353,7 +353,7 @@ JL_DLLEXPORT jl_value_t *jl_value_ptr(jl_value_t *a) JL_DLLEXPORT void jl_set_nth_field(jl_value_t *v, size_t idx0, jl_value_t *rhs) { jl_datatype_t *st = (jl_datatype_t*)jl_typeof(v); - if (!st->mutabl) + if (!st->name->mutabl) jl_errorf("setfield! immutable struct of type %s cannot be changed", jl_symbol_name(st->name->name)); if (idx0 >= jl_datatype_nfields(st)) jl_bounds_error_int(v, idx0 + 1); diff --git a/src/stackwalk.c b/src/stackwalk.c index 80c8a9fb8425a1..b686bbf5be847d 100644 --- a/src/stackwalk.c +++ b/src/stackwalk.c @@ -334,7 +334,7 @@ JL_DLLEXPORT jl_value_t *jl_get_backtrace(void) // interleaved. JL_DLLEXPORT jl_value_t *jl_get_excstack(jl_task_t* task, int include_bt, int max_entries) { - JL_TYPECHK(catch_stack, task, (jl_value_t*)task); + JL_TYPECHK(current_exceptions, task, (jl_value_t*)task); jl_task_t *ct = jl_current_task; if (task != ct && task->_state == JL_TASK_STATE_RUNNABLE) { jl_error("Inspecting the exception stack of a task which might " diff --git a/src/staticdata.c b/src/staticdata.c index efa9f765ddfe0d..e2d3116b258d70 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -907,7 +907,7 @@ static void jl_write_values(jl_serializer_state *s) write_padding(s->s, offset - tot); tot = offset; size_t fsz = jl_field_size(t, i); - if (t->mutabl && jl_is_cpointer_type(jl_field_type(t, i))) { + if (t->name->mutabl && jl_is_cpointer_type(jl_field_type(t, i))) { // reset Ptr fields to C_NULL assert(!jl_field_isptr(t, i)); write_pointer(s->s); diff --git a/src/subtype.c b/src/subtype.c index 90f5438cfd1b62..0d87532e73c396 100644 --- a/src/subtype.c +++ b/src/subtype.c @@ -646,7 +646,7 @@ static int is_leaf_bound(jl_value_t *v) JL_NOTSAFEPOINT if (v == jl_bottom_type) return 1; if (jl_is_datatype(v)) { - if (((jl_datatype_t*)v)->abstract) { + if (((jl_datatype_t*)v)->name->abstract) { if (jl_is_type_type(v)) return 1;//!jl_has_free_typevars(jl_tparam0(v)); return 0; diff --git a/src/sys.c b/src/sys.c index 684e000026c6d0..664489397977b3 100644 --- a/src/sys.c +++ b/src/sys.c @@ -13,6 +13,7 @@ #include "julia.h" #include "julia_internal.h" +#include "llvm-version.h" #ifdef _OS_WINDOWS_ #include @@ -668,7 +669,13 @@ JL_DLLEXPORT jl_value_t *jl_get_libllvm(void) JL_NOTSAFEPOINT { HMODULE mod; // FIXME: GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS on LLVMContextCreate, // but that just points to libjulia.dll - if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, "LLVM", &mod)) +#if JL_LLVM_VERSION <= 110000 + const char* libLLVM = "LLVM"; +#else + const char* libLLVM = "libLLVM"; +#endif + + if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, libLLVM, &mod)) return jl_nothing; char path[MAX_PATH]; diff --git a/src/typemap.c b/src/typemap.c index c25597b079d35c..58dd2b8b13069f 100644 --- a/src/typemap.c +++ b/src/typemap.c @@ -65,7 +65,7 @@ static int jl_type_extract_name_precise(jl_value_t *t1, int invariant) } else if (jl_is_datatype(t1)) { jl_datatype_t *dt = (jl_datatype_t*)t1; - if ((invariant || !dt->abstract) && !jl_is_kind(t1)) + if ((invariant || !dt->name->abstract) && !jl_is_kind(t1)) return 1; return 0; } diff --git a/stdlib/.gitignore b/stdlib/.gitignore index 59354288f912c8..891eda58c689dc 100644 --- a/stdlib/.gitignore +++ b/stdlib/.gitignore @@ -13,5 +13,7 @@ /Tar /NetworkOptions-* /NetworkOptions +/SuiteSparse-* +/SuiteSparse /*_jll/StdlibArtifacts.toml /*/Manifest.toml diff --git a/stdlib/CompilerSupportLibraries_jll/Project.toml b/stdlib/CompilerSupportLibraries_jll/Project.toml index 86a66afc17ed03..95366df955720a 100644 --- a/stdlib/CompilerSupportLibraries_jll/Project.toml +++ b/stdlib/CompilerSupportLibraries_jll/Project.toml @@ -1,6 +1,6 @@ name = "CompilerSupportLibraries_jll" uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "0.4.2+1" +version = "0.4.3+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" diff --git a/stdlib/Distributed/src/cluster.jl b/stdlib/Distributed/src/cluster.jl index 8b68287aad8d78..f485384aa1fec1 100644 --- a/stdlib/Distributed/src/cluster.jl +++ b/stdlib/Distributed/src/cluster.jl @@ -851,7 +851,7 @@ julia> nprocs() 3 julia> workers() -5-element Array{Int64,1}: +2-element Array{Int64,1}: 2 3 ``` diff --git a/stdlib/InteractiveUtils/src/InteractiveUtils.jl b/stdlib/InteractiveUtils/src/InteractiveUtils.jl index db87e9e5cba040..459cad76e7d60a 100644 --- a/stdlib/InteractiveUtils/src/InteractiveUtils.jl +++ b/stdlib/InteractiveUtils/src/InteractiveUtils.jl @@ -303,7 +303,7 @@ end function dumptype(io::IO, @nospecialize(x), n::Int, indent) print(io, x) n == 0 && return # too deeply nested - isa(x, DataType) && x.abstract && dumpsubtypes(io, x, Main, n, indent) + isa(x, DataType) && x.name.abstract && dumpsubtypes(io, x, Main, n, indent) nothing end diff --git a/stdlib/LinearAlgebra/src/generic.jl b/stdlib/LinearAlgebra/src/generic.jl index ec8e9df654c465..e0e7cebe2b0e1c 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -1558,6 +1558,9 @@ function det(A::AbstractMatrix{T}) where T end det(x::Number) = x +# Resolve Issue #40128 +det(A::AbstractMatrix{BigInt}) = det_bareiss(A) + """ logabsdet(M) @@ -1620,6 +1623,55 @@ logdet(A) = log(det(A)) const NumberArray{T<:Number} = AbstractArray{T} +exactdiv(a, b) = a/b +exactdiv(a::Integer, b::Integer) = div(a, b) + +""" + det_bareiss!(M) + +Calculates the determinant of a matrix using the +[Bareiss Algorithm](https://en.wikipedia.org/wiki/Bareiss_algorithm) using +inplace operations. + +# Examples +```jldoctest +julia> M = [1 0; 2 2] +2×2 Matrix{Int64}: + 1 0 + 2 2 + +julia> LinearAlgebra.det_bareiss!(M) +2 +``` +""" +function det_bareiss!(M) + n = checksquare(M) + sign, prev = Int8(1), one(eltype(M)) + for i in 1:n-1 + if iszero(M[i,i]) # swap with another col to make nonzero + swapto = findfirst(!iszero, @view M[i,i+1:end]) + isnothing(swapto) && return zero(prev) + sign = -sign + Base.swapcols!(M, i, i + swapto) + end + for k in i+1:n, j in i+1:n + M[j,k] = exactdiv(M[j,k]*M[i,i] - M[j,i]*M[i,k], prev) + end + prev = M[i,i] + end + return sign * M[end,end] +end +""" + LinearAlgebra.det_bareiss(M) + +Calculates the determinant of a matrix using the +[Bareiss Algorithm](https://en.wikipedia.org/wiki/Bareiss_algorithm). +Also refer to [`det_bareiss!`](@ref). +""" +det_bareiss(M) = det_bareiss!(copy(M)) + + + """ promote_leaf_eltypes(itr) diff --git a/stdlib/LinearAlgebra/src/lq.jl b/stdlib/LinearAlgebra/src/lq.jl index f6a2d3e29f85fa..606e8c3dd006e5 100644 --- a/stdlib/LinearAlgebra/src/lq.jl +++ b/stdlib/LinearAlgebra/src/lq.jl @@ -22,9 +22,15 @@ julia> A = [5. 7.; -2. -4.] -2.0 -4.0 julia> S = lq(A) -LQ{Float64, Matrix{Float64}} with factors L and Q: -[-8.60233 0.0; 4.41741 -0.697486] -[-0.581238 -0.813733; -0.813733 0.581238] +LQ{Float64, Matrix{Float64}} +L factor: +2×2 Matrix{Float64}: + -8.60233 0.0 + 4.41741 -0.697486 +Q factor: +2×2 LinearAlgebra.LQPackedQ{Float64, Matrix{Float64}}: + -0.581238 -0.813733 + -0.813733 0.581238 julia> S.L * S.Q 2×2 Matrix{Float64}: @@ -90,9 +96,15 @@ julia> A = [5. 7.; -2. -4.] -2.0 -4.0 julia> S = lq(A) -LQ{Float64, Matrix{Float64}} with factors L and Q: -[-8.60233 0.0; 4.41741 -0.697486] -[-0.581238 -0.813733; -0.813733 0.581238] +LQ{Float64, Matrix{Float64}} +L factor: +2×2 Matrix{Float64}: + -8.60233 0.0 + 4.41741 -0.697486 +Q factor: +2×2 LinearAlgebra.LQPackedQ{Float64, Matrix{Float64}}: + -0.581238 -0.813733 + -0.813733 0.581238 julia> S.L * S.Q 2×2 Matrix{Float64}: @@ -141,12 +153,12 @@ Base.propertynames(F::LQ, private::Bool=false) = getindex(A::LQPackedQ, i::Integer, j::Integer) = lmul!(A, setindex!(zeros(eltype(A), size(A, 2)), 1, j))[i] -function show(io::IO, ::MIME"text/plain", C::LQ) - println(io, typeof(C), " with factors L and Q:") - io = IOContext(io, :compact => true) - show(io, C.L) - println(io) - show(io, C.Q) +function show(io::IO, mime::MIME{Symbol("text/plain")}, F::LQ) + summary(io, F); println(io) + println(io, "L factor:") + show(io, mime, F.L) + println(io, "\nQ factor:") + show(io, mime, F.Q) end LQPackedQ{T}(Q::LQPackedQ) where {T} = LQPackedQ(convert(AbstractMatrix{T}, Q.factors), convert(Vector{T}, Q.τ)) diff --git a/stdlib/LinearAlgebra/test/generic.jl b/stdlib/LinearAlgebra/test/generic.jl index f3ef87da83052a..cde16288f8f671 100644 --- a/stdlib/LinearAlgebra/test/generic.jl +++ b/stdlib/LinearAlgebra/test/generic.jl @@ -142,6 +142,10 @@ end @testset "Scaling with 5-argument mul!" begin @test mul!(copy(a), 5., a, 10, 100) == a*150 @test mul!(copy(a), a, 5., 10, 100) == a*150 + @test mul!(vec(copy(a)), 5., a, 10, 100) == vec(a*150) + @test mul!(vec(copy(a)), a, 5., 10, 100) == vec(a*150) + @test_throws DimensionMismatch mul!([vec(copy(a)); 0], 5., a, 10, 100) + @test_throws DimensionMismatch mul!([vec(copy(a)); 0], a, 5., 10, 100) @test mul!(copy(a), Diagonal([1.; 2.]), a, 10, 100) == 10a.*[1; 2] .+ 100a @test mul!(copy(a), Diagonal([1; 2]), a, 10, 100) == 10a.*[1; 2] .+ 100a @test mul!(copy(a), a, Diagonal(1.:an), 10, 100) == 10a.*Vector(1:an)' .+ 100a @@ -189,6 +193,7 @@ end @test det(a) == a @test norm(a) == abs(a) @test norm(a, 0) == 1 + @test norm(0, 0) == 0 end @test !issymmetric(NaN16) @@ -241,12 +246,14 @@ end rotate!(x, y, c, s) @test x ≈ c*x2 + s*y2 @test y ≈ -conj(s)*x2 + c*y2 + @test_throws DimensionMismatch rotate!([x; x], y, c, s) x3 = copy(x) y3 = copy(y) reflect!(x, y, c, s) @test x ≈ c*x3 + s*y3 @test y ≈ conj(s)*x3 - c*y3 + @test_throws DimensionMismatch reflect!([x; x], y, c, s) end @testset "LinearAlgebra.axp(b)y! for element type without commutative multiplication" begin @@ -270,6 +277,7 @@ end ry = [2 8] @test LinearAlgebra.axpy!(α, x, rx, y, ry) == [1 1 1 1; 11 1 1 26] end + @testset "norm and normalize!" begin vr = [3.0, 4.0] for Tr in (Float32, Float64) @@ -347,6 +355,11 @@ end @test [[1,2, [3,4]], 5.0, [6im, [7.0, 8.0]]] ≈ [[1,2, [3,4]], 5.0, [6im, [7.0, 8.0]]] end +@testset "Issue 40128" begin + @test det(BigInt[9 1 8 0; 0 0 8 7; 7 6 8 3; 2 9 7 7])::BigInt == -1 + @test det(BigInt[1 big(2)^65+1; 3 4])::BigInt == (4 - 3*(big(2)^65+1)) +end + # Minimal modulo number type - but not subtyping Number struct ModInt{n} k diff --git a/stdlib/LinearAlgebra/test/lq.jl b/stdlib/LinearAlgebra/test/lq.jl index 6e21b9ac6c1ccd..883793c55d4dd2 100644 --- a/stdlib/LinearAlgebra/test/lq.jl +++ b/stdlib/LinearAlgebra/test/lq.jl @@ -56,9 +56,6 @@ rectangularQ(Q::LinearAlgebra.LQPackedQ) = convert(Array, Q) @test l*q ≈ a @test Array(lqa) ≈ a @test Array(copy(lqa)) ≈ a - lstring = sprint(show, l, context = :compact=>true) - qstring = sprint(show, q, context = :compact=>true) - @test sprint(show,MIME"text/plain"(),lqa) == "$(typeof(lqa)) with factors L and Q:\n$lstring\n$qstring" @test LinearAlgebra.Factorization{eltya}(lqa) === lqa @test Matrix{eltya}(q) isa Matrix{eltya} # test Array{T}(LQPackedQ{T}) @@ -203,4 +200,24 @@ end end end +@testset "REPL printing" begin + bf = IOBuffer() + show(bf, "text/plain", lq(Matrix(I, 4, 4))) + seekstart(bf) + @test String(take!(bf)) == """ +LinearAlgebra.LQ{Float64, Matrix{Float64}} +L factor: +4×4 Matrix{Float64}: + 1.0 0.0 0.0 0.0 + 0.0 1.0 0.0 0.0 + 0.0 0.0 1.0 0.0 + 0.0 0.0 0.0 1.0 +Q factor: +4×4 LinearAlgebra.LQPackedQ{Float64, Matrix{Float64}}: + 1.0 0.0 0.0 0.0 + 0.0 1.0 0.0 0.0 + 0.0 0.0 1.0 0.0 + 0.0 0.0 0.0 1.0""" +end + end # module TestLQ diff --git a/stdlib/Makefile b/stdlib/Makefile index 8ef2330f5a5adb..38c8c45ac89756 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -16,7 +16,7 @@ $(build_datarootdir)/julia/stdlib/$(VERSDIR): mkdir -p $@ JLLS = DSFMT GMP CURL LIBGIT2 LLVM LIBSSH2 LIBUV MBEDTLS MPFR NGHTTP2 \ - BLASTRAMPOLINE OPENBLAS OPENLIBM P7ZIP PCRE SUITESPARSE ZLIB \ + BLASTRAMPOLINE OPENBLAS OPENLIBM P7ZIP PCRE LIBSUITESPARSE ZLIB \ LLVMUNWIND CSL UNWIND # Initialize this with JLLs that aren't in deps/Versions.make @@ -44,7 +44,7 @@ STDLIBS = Artifacts Base64 CRC32c Dates DelimitedFiles Distributed FileWatching SharedArrays Sockets SparseArrays SuiteSparse Test TOML Unicode UUIDs \ $(JLL_NAMES) -STDLIBS_EXT = Pkg Statistics LibCURL Downloads ArgTools Tar NetworkOptions +STDLIBS_EXT = Pkg Statistics LibCURL Downloads ArgTools Tar NetworkOptions SuiteSparse PKG_GIT_URL := git://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 STATISTICS_GIT_URL := git://github.com/JuliaLang/Statistics.jl.git @@ -59,6 +59,8 @@ TAR_GIT_URL := git://github.com/JuliaIO/Tar.jl.git TAR_TAR_URL = https://api.github.com/repos/JuliaIO/Tar.jl/tarball/$1 NETWORKOPTIONS_GIT_URL := git://github.com/JuliaLang/NetworkOptions.jl.git NETWORKOPTIONS_TAR_URL = https://api.github.com/repos/JuliaLang/NetworkOptions.jl/tarball/$1 +SUITESPARSE_GIT_URL := git://github.com/JuliaLang/SuiteSparse.jl.git +SUITESPARSE_TAR_URL = https://api.github.com/repos/JuliaLang/SuiteSparse.jl/tarball/$1 $(foreach module, $(STDLIBS_EXT), $(eval $(call stdlib-external,$(module),$(shell echo $(module) | tr a-z A-Z)))) diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index b0804498895f20..329a2a83f85d3f 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,2 +1,2 @@ PKG_BRANCH = master -PKG_SHA1 = 1a47f445f92053edc83a9528ed849ca404b4a2af +PKG_SHA1 = 9f67253529c72753cbfbb0078a80717f6c9bd90f diff --git a/stdlib/REPL/src/REPL.jl b/stdlib/REPL/src/REPL.jl index e777655806afa3..54053f2066c711 100644 --- a/stdlib/REPL/src/REPL.jl +++ b/stdlib/REPL/src/REPL.jl @@ -29,8 +29,7 @@ import Base: display, show, AnyDict, - ==, - catch_stack + == _displaysize(io::IO) = displaysize(io)::Tuple{Int,Int} @@ -76,6 +75,9 @@ end answer_color(::AbstractREPL) = "" const JULIA_PROMPT = "julia> " +const PKG_PROMPT = "pkg> " +const SHELL_PROMPT = "shell> " +const HELP_PROMPT = "help?> " mutable struct REPLBackend "channel for AST" @@ -157,7 +159,7 @@ function eval_user_input(@nospecialize(ast), backend::REPLBackend) println("SYSTEM ERROR: Failed to report error to REPL frontend") println(err) end - lasterr = catch_stack() + lasterr = current_exceptions() end end Base.sigatomic_end() @@ -298,7 +300,7 @@ function print_response(errio::IO, response, show_value::Bool, have_color::Bool, println(errio) # an error during printing is likely to leave us mid-line println(errio, "SYSTEM (REPL): showing an error caused an error") try - Base.invokelatest(Base.display_error, errio, catch_stack()) + Base.invokelatest(Base.display_error, errio, current_exceptions()) catch e # at this point, only print the name of the type as a Symbol to # minimize the possibility of further errors. @@ -308,7 +310,7 @@ function print_response(errio::IO, response, show_value::Bool, have_color::Bool, end break end - val = catch_stack() + val = current_exceptions() iserr = true end end @@ -832,7 +834,7 @@ function respond(f, repl, main; pass_empty::Bool = false, suppress_on_semicolon: ast = Base.invokelatest(f, line) response = eval_with_backend(ast, backend(repl)) catch - response = Pair{Any, Bool}(catch_stack(), true) + response = Pair{Any, Bool}(current_exceptions(), true) end hide_output = suppress_on_semicolon && ends_with_semicolon(line) print_response(repl, response, !hide_output, hascolor(repl)) @@ -935,7 +937,7 @@ function setup_interface( on_enter = return_callback) # Setup help mode - help_mode = Prompt("help?> ", + help_mode = Prompt(HELP_PROMPT, prompt_prefix = hascolor ? repl.help_color : "", prompt_suffix = hascolor ? (repl.envcolors ? Base.input_color : repl.input_color) : "", @@ -947,7 +949,7 @@ function setup_interface( # Set up shell mode - shell_mode = Prompt("shell> "; + shell_mode = Prompt(SHELL_PROMPT; prompt_prefix = hascolor ? repl.shell_color : "", prompt_suffix = hascolor ? (repl.envcolors ? Base.input_color : repl.input_color) : "", @@ -984,7 +986,7 @@ function setup_interface( hist_from_file(hp, hist_path) catch # use REPL.hascolor to avoid using the local variable with the same name - print_response(repl, Pair{Any, Bool}(catch_stack(), true), true, REPL.hascolor(repl)) + print_response(repl, Pair{Any, Bool}(current_exceptions(), true), true, REPL.hascolor(repl)) println(outstream(repl)) @info "Disabling history file for this session" repl.history_file = false @@ -1001,6 +1003,12 @@ function setup_interface( search_prompt, skeymap = LineEdit.setup_search_keymap(hp) search_prompt.complete = LatexCompletions() + jl_prompt_len = length(JULIA_PROMPT) + pkg_prompt_len = length(PKG_PROMPT) + shell_prompt_len = length(SHELL_PROMPT) + help_prompt_len = length(HELP_PROMPT) + pkg_prompt_regex = r"^(?:\(.+\) )?pkg> " + # Canonicalize user keymap input if isa(extra_repl_keymap, Dict) extra_repl_keymap = AnyDict[extra_repl_keymap] @@ -1053,12 +1061,15 @@ function setup_interface( oldpos = firstindex(input) firstline = true isprompt_paste = false - jl_prompt_len = 7 # "julia> " + curr_prompt_len = 0 + pasting_help = false + while oldpos <= lastindex(input) # loop until all lines have been executed if JL_PROMPT_PASTE[] - # Check if the next statement starts with "julia> ", in that case - # skip it. But first skip whitespace - while input[oldpos] in ('\n', ' ', '\t') + # Check if the next statement starts with a prompt i.e. "julia> ", in that case + # skip it. But first skip whitespace unless pasting in a docstring which may have + # indented prompt examples that we don't want to execute + while input[oldpos] in (pasting_help ? ('\n') : ('\n', ' ', '\t')) oldpos = nextind(input, oldpos) oldpos >= sizeof(input) && return end @@ -1066,7 +1077,32 @@ function setup_interface( if (firstline || isprompt_paste) && startswith(SubString(input, oldpos), JULIA_PROMPT) isprompt_paste = true oldpos += jl_prompt_len - # If we are prompt pasting and current statement does not begin with julia> , skip to next line + curr_prompt_len = jl_prompt_len + transition(s, julia_prompt) + pasting_help = false + # Check if input line starts with "pkg> " or "(...) pkg> ", remove it if we are in prompt paste mode and switch mode + elseif (firstline || isprompt_paste) && startswith(SubString(input, oldpos), pkg_prompt_regex) + detected_pkg_prompt = match(pkg_prompt_regex, SubString(input, oldpos)).match + isprompt_paste = true + curr_prompt_len = sizeof(detected_pkg_prompt) + oldpos += curr_prompt_len + Base.active_repl.interface.modes[1].keymap_dict[']'](s, o...) + pasting_help = false + # Check if input line starts with "shell> ", remove it if we are in prompt paste mode and switch mode + elseif (firstline || isprompt_paste) && startswith(SubString(input, oldpos), SHELL_PROMPT) + isprompt_paste = true + oldpos += shell_prompt_len + curr_prompt_len = shell_prompt_len + transition(s, shell_mode) + pasting_help = false + # Check if input line starts with "help?> ", remove it if we are in prompt paste mode and switch mode + elseif (firstline || isprompt_paste) && startswith(SubString(input, oldpos), HELP_PROMPT) + isprompt_paste = true + oldpos += help_prompt_len + curr_prompt_len = help_prompt_len + transition(s, help_mode) + pasting_help = true + # If we are prompt pasting and current statement does not begin with a mode prefix, skip to next line elseif isprompt_paste while input[oldpos] != '\n' oldpos = nextind(input, oldpos) @@ -1075,11 +1111,35 @@ function setup_interface( continue end end - ast, pos = Meta.parse(input, oldpos, raise=false, depwarn=false) - if (isa(ast, Expr) && (ast.head === :error || ast.head === :incomplete)) || - (pos > ncodeunits(input) && !endswith(input, '\n')) - # remaining text is incomplete (an error, or parser ran to the end but didn't stop with a newline): - # Insert all the remaining text as one line (might be empty) + dump_tail = false + nl_pos = findfirst('\n', input[oldpos:end]) + if s.current_mode == julia_prompt + ast, pos = Meta.parse(input, oldpos, raise=false, depwarn=false) + if (isa(ast, Expr) && (ast.head === :error || ast.head === :incomplete)) || + (pos > ncodeunits(input) && !endswith(input, '\n')) + # remaining text is incomplete (an error, or parser ran to the end but didn't stop with a newline): + # Insert all the remaining text as one line (might be empty) + dump_tail = true + end + elseif isnothing(nl_pos) # no newline at end, so just dump the tail into the prompt and don't execute + dump_tail = true + elseif s.current_mode == shell_mode # handle multiline shell commands + lines = split(input[oldpos:end], '\n') + pos = oldpos + sizeof(lines[1]) + 1 + if length(lines) > 1 + for line in lines[2:end] + # to be recognized as a multiline shell command, the lines must be indented to the + # same prompt position + if !startswith(line, ' '^curr_prompt_len) + break + end + pos += sizeof(line) + 1 + end + end + else + pos = oldpos + nl_pos + end + if dump_tail tail = input[oldpos:end] if !firstline # strip leading whitespace, but only if it was the result of executing something @@ -1087,7 +1147,7 @@ function setup_interface( tail = lstrip(tail) end if isprompt_paste # remove indentation spaces corresponding to the prompt - tail = replace(tail, r"^"m * ' '^jl_prompt_len => "") + tail = replace(tail, r"^"m * ' '^curr_prompt_len => "") end LineEdit.replace_line(s, tail, true) LineEdit.refresh_line(s) @@ -1097,7 +1157,7 @@ function setup_interface( line = strip(input[oldpos:prevind(input, pos)]) if !isempty(line) if isprompt_paste # remove indentation spaces corresponding to the prompt - line = replace(line, r"^"m * ' '^jl_prompt_len => "") + line = replace(line, r"^"m * ' '^curr_prompt_len => "") end # put the line on the screen and history LineEdit.replace_line(s, line) diff --git a/stdlib/REPL/src/docview.jl b/stdlib/REPL/src/docview.jl index cfb554f6cae32e..2ff223beff4b20 100644 --- a/stdlib/REPL/src/docview.jl +++ b/stdlib/REPL/src/docview.jl @@ -272,14 +272,14 @@ function summarize(io::IO, TT::Type, binding::Binding) if T isa DataType println(io, "```") print(io, - T.abstract ? "abstract type " : - T.mutable ? "mutable struct " : + T.name.abstract ? "abstract type " : + T.name.mutable ? "mutable struct " : Base.isstructtype(T) ? "struct " : "primitive type ") supert = supertype(T) println(io, T) println(io, "```") - if !T.abstract && T.name !== Tuple.name && !isempty(fieldnames(T)) + if !T.name.abstract && T.name !== Tuple.name && !isempty(fieldnames(T)) println(io, "# Fields") println(io, "```") pad = maximum(length(string(f)) for f in fieldnames(T)) diff --git a/stdlib/REPL/test/repl.jl b/stdlib/REPL/test/repl.jl index 9b72b8db7b1c50..d467c82eb42266 100644 --- a/stdlib/REPL/test/repl.jl +++ b/stdlib/REPL/test/repl.jl @@ -750,6 +750,32 @@ fake_repl() do stdin_write, stdout_read, repl readuntil(stdout_read, "begin") @test readuntil(stdout_read, "end", keep=true) == "\n\r\e[7C α=1\n\r\e[7C β=2\n\r\e[7Cend" + # Test switching repl modes + sendrepl2("""\e[200~ + julia> A = 1 + 1 + + shell> echo foo + foo + + shell> echo foo + foo + foo foo + + help?> Int + Dummy docstring + + Some text + + julia> error("If this error throws, the paste handler has failed to ignore this docstring example") + + julia> B = 2 + 2\e[201~ + """) + wait(c) + @test Main.A == 1 + @test Main.B == 2 + # Close repl write(stdin_write, '\x04') Base.wait(repltask) @@ -851,7 +877,7 @@ mutable struct Error19864 <: Exception; end function test19864() @eval Base.showerror(io::IO, e::Error19864) = print(io, "correct19864") buf = IOBuffer() - fake_response = (Any[(Error19864(), Ptr{Cvoid}[])], true) + fake_response = (Base.ExceptionStack([(exception=Error19864(),backtrace=Ptr{Cvoid}[])]),true) REPL.print_response(buf, fake_response, false, false, nothing) return String(take!(buf)) end diff --git a/stdlib/Serialization/src/Serialization.jl b/stdlib/Serialization/src/Serialization.jl index f644c73762c2f2..22782eff99816b 100644 --- a/stdlib/Serialization/src/Serialization.jl +++ b/stdlib/Serialization/src/Serialization.jl @@ -462,11 +462,11 @@ function serialize(s::AbstractSerializer, t::Task) serialize(s, t.code) serialize(s, t.storage) serialize(s, t.state) - if t._isexception && (stk = Base.catch_stack(t); !isempty(stk)) + if t._isexception && (stk = Base.current_exceptions(t); !isempty(stk)) # the exception stack field is hidden inside the task, so if there # is any information there make a CapturedException from it instead. # TODO: Handle full exception chain, not just the first one. - serialize(s, CapturedException(stk[1][1], stk[1][2])) + serialize(s, CapturedException(stk[1].exception, stk[1].backtrace)) else serialize(s, t.result) end @@ -507,8 +507,8 @@ function serialize_typename(s::AbstractSerializer, t::Core.TypeName) serialize(s, primary.parameters) serialize(s, primary.types) serialize(s, isdefined(primary, :instance)) - serialize(s, primary.abstract) - serialize(s, primary.mutable) + serialize(s, t.abstract) + serialize(s, t.mutable) serialize(s, primary.ninitialized) if isdefined(t, :mt) && t.mt !== Symbol.name.mt serialize(s, t.mt.name) @@ -660,7 +660,7 @@ function serialize_any(s::AbstractSerializer, @nospecialize(x)) serialize_type(s, t) write(s.io, x) else - if t.mutable + if t.name.mutable serialize_cycle(s, x) && return serialize_type(s, t, true) else @@ -937,7 +937,7 @@ function handle_deserialize(s::AbstractSerializer, b::Int32) return deserialize_dict(s, t) end t = desertag(b)::DataType - if t.mutable && length(t.types) > 0 # manual specialization of fieldcount + if t.name.mutable && length(t.types) > 0 # manual specialization of fieldcount slot = s.counter; s.counter += 1 push!(s.pending_refs, slot) end @@ -1253,8 +1253,8 @@ function deserialize_typename(s::AbstractSerializer, number) else # reuse the same name for the type, if possible, for nicer debugging tn_name = isdefined(__deserialized_types__, name) ? gensym() : name - tn = ccall(:jl_new_typename_in, Ref{Core.TypeName}, (Any, Any), - tn_name, __deserialized_types__) + tn = ccall(:jl_new_typename_in, Ref{Core.TypeName}, (Any, Any, Cint, Cint), + tn_name, __deserialized_types__, false, false) makenew = true end remember_object(s, tn, number) @@ -1270,7 +1270,7 @@ function deserialize_typename(s::AbstractSerializer, number) ninitialized = deserialize(s)::Int32 if makenew - tn.names = names + Core.setfield!(tn, :names, names) # TODO: there's an unhanded cycle in the dependency graph at this point: # while deserializing super and/or types, we may have encountered # tn.wrapper and throw UndefRefException before we get to this point @@ -1422,7 +1422,7 @@ function deserialize(s::AbstractSerializer, t::DataType) if nf == 0 && t.size > 0 # bits type return read(s.io, t) - elseif t.mutable + elseif t.name.mutable x = ccall(:jl_new_struct_uninit, Any, (Any,), t) deserialize_cycle(s, x) for i in 1:nf diff --git a/stdlib/SparseArrays/src/abstractsparse.jl b/stdlib/SparseArrays/src/abstractsparse.jl index 3ea70f48b4a7e1..86d6c4b3da56d5 100644 --- a/stdlib/SparseArrays/src/abstractsparse.jl +++ b/stdlib/SparseArrays/src/abstractsparse.jl @@ -50,17 +50,19 @@ julia> issparse(Array(sv)) false ``` """ -issparse(A::AbstractArray) = false +function issparse(A::AbstractArray) + # Handle wrapper arrays: sparse if it is wrapping a sparse array. + # This gets compiled away during specialization. + p = parent(A) + if p === A + # have reached top of wrapping without finding a sparse array, assume it is not. + return false + else + return issparse(p) + end +end +issparse(A::DenseArray) = false issparse(S::AbstractSparseArray) = true -issparse(S::LinearAlgebra.Adjoint{<:Any,<:AbstractSparseArray}) = true -issparse(S::LinearAlgebra.Transpose{<:Any,<:AbstractSparseArray}) = true - -issparse(S::LinearAlgebra.Symmetric{<:Any,<:AbstractSparseMatrix}) = true -issparse(S::LinearAlgebra.Hermitian{<:Any,<:AbstractSparseMatrix}) = true -issparse(S::LinearAlgebra.LowerTriangular{<:Any,<:AbstractSparseMatrix}) = true -issparse(S::LinearAlgebra.UnitLowerTriangular{<:Any,<:AbstractSparseMatrix}) = true -issparse(S::LinearAlgebra.UpperTriangular{<:Any,<:AbstractSparseMatrix}) = true -issparse(S::LinearAlgebra.UnitUpperTriangular{<:Any,<:AbstractSparseMatrix}) = true indtype(S::AbstractSparseArray{<:Any,Ti}) where {Ti} = Ti diff --git a/stdlib/SparseArrays/src/sparsematrix.jl b/stdlib/SparseArrays/src/sparsematrix.jl index 58dfd88abd3395..ffecaaeaf20c0b 100644 --- a/stdlib/SparseArrays/src/sparsematrix.jl +++ b/stdlib/SparseArrays/src/sparsematrix.jl @@ -706,7 +706,7 @@ julia> sparse(A) ⋅ ⋅ 1.0 ``` """ -sparse(A::AbstractMatrix{Tv}) where {Tv} = convert(SparseMatrixCSC{Tv,Int}, A) +sparse(A::AbstractMatrix{Tv}) where {Tv} = convert(SparseMatrixCSC{Tv}, A) sparse(S::AbstractSparseMatrixCSC) = copy(S) diff --git a/stdlib/SparseArrays/test/sparse.jl b/stdlib/SparseArrays/test/sparse.jl index f2754ba5ade81b..85fb999cbe677c 100644 --- a/stdlib/SparseArrays/test/sparse.jl +++ b/stdlib/SparseArrays/test/sparse.jl @@ -94,6 +94,7 @@ end # with combine @test sparse([1, 1, 2, 2, 2], [1, 2, 1, 2, 2], 1.0, 2, 2, +) == sparse([1, 1, 2, 2], [1, 2, 1, 2], [1.0, 1.0, 1.0, 2.0], 2, 2) @test sparse([1, 1, 2, 2, 2], [1, 2, 1, 2, 2], -1.0, 2, 2, *) == sparse([1, 1, 2, 2], [1, 2, 1, 2], [-1.0, -1.0, -1.0, 1.0], 2, 2) + @test sparse(sparse(Int32.(1:5), Int32.(1:5), trues(5))') isa SparseMatrixCSC{Bool,Int32} end @testset "SparseMatrixCSC construction from UniformScaling" begin @@ -2165,6 +2166,12 @@ end @test issparse(LinearAlgebra.UnitLowerTriangular(Array(m))) == false @test issparse(UpperTriangular(Array(m))) == false @test issparse(LinearAlgebra.UnitUpperTriangular(Array(m))) == false + @test issparse(Base.ReshapedArray(m, (20, 5), ())) + @test issparse(@view m[1:3, :]) + + # greater nesting + @test issparse(Symmetric(UpperTriangular(m))) + @test issparse(Symmetric(UpperTriangular(Array(m)))) == false end @testset "issparse for sparse vectors #34253" begin diff --git a/stdlib/SuiteSparse.version b/stdlib/SuiteSparse.version new file mode 100644 index 00000000000000..da54441dc40412 --- /dev/null +++ b/stdlib/SuiteSparse.version @@ -0,0 +1,2 @@ +SUITESPARSE_BRANCH = master +SUITESPARSE_SHA1 = ec4b40ad9c0490ebf0969a41d4f880620db3f6f9 diff --git a/stdlib/SuiteSparse/Project.toml b/stdlib/SuiteSparse/Project.toml deleted file mode 100644 index 0312b1625f7e39..00000000000000 --- a/stdlib/SuiteSparse/Project.toml +++ /dev/null @@ -1,19 +0,0 @@ -name = "SuiteSparse" -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" - -[deps] -Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" -LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" -SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -SuiteSparse_jll = "bea87d4a-7f5b-5778-9afe-8cc45184846c" - -[extras] -DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" -Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" -Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["Test", "Printf", "Random", "DelimitedFiles", "Serialization"] diff --git a/stdlib/SuiteSparse/docs/src/index.md b/stdlib/SuiteSparse/docs/src/index.md deleted file mode 100644 index e8654caf943b40..00000000000000 --- a/stdlib/SuiteSparse/docs/src/index.md +++ /dev/null @@ -1,34 +0,0 @@ -# Sparse Linear Algebra - -```@meta -DocTestSetup = :(using LinearAlgebra, SparseArrays, SuiteSparse) -``` - -Sparse matrix solvers call functions from [SuiteSparse](http://suitesparse.com). The following factorizations are available: - -| Type | Description | -|:--------------------------------- |:--------------------------------------------- | -| `SuiteSparse.CHOLMOD.Factor` | Cholesky factorization | -| `SuiteSparse.UMFPACK.UmfpackLU` | LU factorization | -| `SuiteSparse.SPQR.QRSparse` | QR factorization | - -Other solvers such as [Pardiso.jl](https://github.com/JuliaSparse/Pardiso.jl/) are as external packages. [Arpack.jl](https://julialinearalgebra.github.io/Arpack.jl/stable/) provides `eigs` and `svds` for iterative solution of eigensystems and singular value decompositions. - -These factorizations are described in the [`Linear Algebra`](@ref man-linalg) section of the manual: -1. [`cholesky`](@ref) -2. [`ldlt`](@ref) -3. [`lu`](@ref) -4. [`qr`](@ref) - -```@docs -SuiteSparse.CHOLMOD.lowrankupdate -SuiteSparse.CHOLMOD.lowrankupdate! -SuiteSparse.CHOLMOD.lowrankdowndate -SuiteSparse.CHOLMOD.lowrankdowndate! -SuiteSparse.CHOLMOD.lowrankupdowndate! -``` - - -```@meta -DocTestSetup = nothing -``` diff --git a/stdlib/SuiteSparse/src/SuiteSparse.jl b/stdlib/SuiteSparse/src/SuiteSparse.jl deleted file mode 100644 index e07e6aaea1c5ae..00000000000000 --- a/stdlib/SuiteSparse/src/SuiteSparse.jl +++ /dev/null @@ -1,31 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -module SuiteSparse - -import Base: \ -import LinearAlgebra: ldiv!, rdiv! - -## Functions to switch to 0-based indexing to call external sparse solvers - -# Convert from 1-based to 0-based indices -function decrement!(A::AbstractArray{T}) where T<:Integer - for i in eachindex(A); A[i] -= oneunit(T) end - A -end -decrement(A::AbstractArray{<:Integer}) = decrement!(copy(A)) - -# Convert from 0-based to 1-based indices -function increment!(A::AbstractArray{T}) where T<:Integer - for i in eachindex(A); A[i] += oneunit(T) end - A -end -increment(A::AbstractArray{<:Integer}) = increment!(copy(A)) - -if Base.USE_GPL_LIBS - include("umfpack.jl") - include("cholmod.jl") - include("spqr.jl") - include("deprecated.jl") -end - -end # module SuiteSparse diff --git a/stdlib/SuiteSparse/src/cholmod.jl b/stdlib/SuiteSparse/src/cholmod.jl deleted file mode 100644 index 8bc3b9747f53b1..00000000000000 --- a/stdlib/SuiteSparse/src/cholmod.jl +++ /dev/null @@ -1,2026 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -# Theoretically CHOLMOD supports both Int32 and Int64 indices on 64-bit. -# However experience suggests that using both in the same session causes memory -# leaks, so we restrict indices to be SuiteSparse_long (see cholmod_h.jl). -# Ref: https://github.com/JuliaLang/julia/issues/12664 - -# Additionally, only Float64/ComplexF64 are supported in practice. -# Ref: https://github.com/JuliaLang/julia/issues/25986 - -module CHOLMOD - -import Base: (*), convert, copy, eltype, getindex, getproperty, show, size, - IndexStyle, IndexLinear, IndexCartesian, adjoint, axes -using Base: require_one_based_indexing - -using LinearAlgebra -import LinearAlgebra: (\), - cholesky, cholesky!, det, diag, ishermitian, isposdef, - issuccess, issymmetric, ldlt, ldlt!, logdet - -using SparseArrays -using SparseArrays: getcolptr -import Libdl - -export - Dense, - Factor, - Sparse - -import SparseArrays: AbstractSparseMatrix, SparseMatrixCSC, indtype, sparse, spzeros, nnz - -import ..increment, ..increment!, ..decrement, ..decrement! - -######### -# Setup # -######### - -include("cholmod_h.jl") - -const CHOLMOD_MIN_VERSION = v"2.1.1" - -## macro to generate the name of the C function according to the integer type -macro cholmod_name(nm) - string("cholmod_l_", nm) -end - -# Set a `common` field, execute some code and then safely reset the field to -# its initial value -macro cholmod_param(kwarg, code) - @assert kwarg.head == :(=) - param = kwarg.args[1] - value = kwarg.args[2] - - common_param = # Read `common.param` - Expr(:., :(common[Threads.threadid()]), QuoteNode(param)) - - return quote - default_value = $common_param - try - $common_param = $(esc(value)) - $(esc(code)) - finally - $common_param = default_value - end - end -end - -# Julia copy of the cholmod_method_struct -# https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/master/CHOLMOD/Include/cholmod_core.h#L655 -# Keep this synchronized with `jl_cholmod_method_offsets` in -# https://github.com/JuliaLang/julia/blob/master/deps/SuiteSparse_wrapper.c -struct Method - lnz::Cdouble - fl::Cdouble - prune_dense::Cdouble - prune_dense2::Cdouble - nd_oksep::Cdouble - other_1::NTuple{4,Cdouble} - nd_small::Csize_t - other_2::NTuple{4,Csize_t} - aggressive::Cint - order_for_lu::Cint - nd_compress::Cint - nd_camd::Cint - nd_components::Cint - ordering::Cint - other_3::NTuple{4,Csize_t} -end - -# Julia copy of the cholmod_common_struct -# https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/master/CHOLMOD/Include/cholmod_core.h#L414 -# Keep this synchronized with `jl_cholmod_method_offsets` in -# https://github.com/JuliaLang/julia/blob/master/deps/SuiteSparse_wrapper.c -mutable struct Common - dbound::Cdouble - grow0::Cdouble - grow1::Cdouble - grow2::Csize_t - maxrank::Csize_t - supernodal_switch::Cdouble - supernodal::Cint - final_asis::Cint - final_super::Cint - final_ll::Cint - final_pack::Cint - final_monotonic::Cint - final_resymbol::Cint - zrelax::NTuple{3,Cdouble} - nrelax::NTuple{3,Csize_t} - prefer_zomplex::Cint - prefer_upper::Cint - quick_return_if_not_posdef::Cint - prefer_binary::Cint - print::Cint - precise::Cint - try_catch::Cint - error_handler::Ptr{Nothing} - nmethods::Cint - current::Cint - selected::Cint - method::NTuple{10,Method} - postorder::Cint - default_nesdis::Cint - metis_memory::Cdouble - metis_dswitch::Cdouble - metis_nswitch::Csize_t - nrow::Csize_t - mark::SuiteSparse_long - iworksize::Csize_t - xworksize::Csize_t - Flag::Ptr{Nothing} - Head::Ptr{Nothing} - Xwork::Ptr{Nothing} - Iwork::Ptr{Nothing} - itype::Cint - dtype::Cint - no_workspace_reallocate::Cint - status::Cint - fl::Cdouble - lnz::Cdouble - anz::Cdouble - modfl::Cdouble - malloc_count::Csize_t - memory_usage::Csize_t - memory_inuse::Csize_t - nrealloc_col::Cdouble - nrealloc_factor::Cdouble - ndbounds_hit::Cdouble - rowfacfl::Cdouble - aatfl::Cdouble - called_nd::Cint - blas_ok::Cint - SPQR_grain::Cdouble - SPQR_small::Cdouble - SPQR_shrink::Cint - SPQR_nthreads::Cint - SPQR_flopcount::Cdouble - SPQR_analyze_time::Cdouble - SPQR_factorize_time::Cdouble - SPQR_solve_time::Cdouble - SPQR_flopcount_bound::Cdouble - SPQR_tol_used::Cdouble - SPQR_norm_E_fro::Cdouble - SPQR_istat::NTuple{10,SuiteSparse_long} - useGPU::Cint - maxGpuMemBytes::Csize_t - maxGpuMemFraction::Cdouble - gpuMemorySize::Csize_t - gpuKernelTime::Cdouble - gpuFlops::SuiteSparse_long - gpuNumKernelLaunches::Cint - cublasHandle::Ptr{Nothing} - gpuStream::NTuple{8,Ptr{Nothing}} - cublasEventPotrf::NTuple{3,Ptr{Nothing}} - updateCKernelsComplete::Ptr{Nothing} - updateCBuffersFree::NTuple{8,Ptr{Nothing}} - dev_mempool::Ptr{Nothing} - dev_mempool_size::Csize_t - host_pinned_mempool::Ptr{Nothing} - host_pinned_mempool_size::Csize_t - devBuffSize::Csize_t - ibuffer::Cint - syrkStart::Cdouble - cholmod_cpu_gemm_time::Cdouble - cholmod_cpu_syrk_time::Cdouble - cholmod_cpu_trsm_time::Cdouble - cholmod_cpu_potrf_time::Cdouble - cholmod_gpu_gemm_time::Cdouble - cholmod_gpu_syrk_time::Cdouble - cholmod_gpu_trsm_time::Cdouble - cholmod_gpu_potrf_time::Cdouble - cholmod_assemble_time::Cdouble - cholmod_assemble_time2::Cdouble - cholmod_cpu_gemm_calls::Csize_t - cholmod_cpu_syrk_calls::Csize_t - cholmod_cpu_trsm_calls::Csize_t - cholmod_cpu_potrf_calls::Csize_t - cholmod_gpu_gemm_calls::Csize_t - cholmod_gpu_syrk_calls::Csize_t - cholmod_gpu_trsm_calls::Csize_t - cholmod_gpu_potrf_calls::Csize_t - - function Common() - common = new() - ccall((@cholmod_name("start"), :libcholmod), - Cint, (Ptr{Common},), common) - finalizer(common) do common - ccall((@cholmod_name("finish"), :libcholmod), - Cint, (Ptr{Common},), common) == TRUE - end - end -end - -Base.unsafe_convert(::Type{Ptr{Common}},c::Common) = - reinterpret(Ptr{Common}, pointer_from_objref(c)) - -const common = Vector{Common}() - -function defaults!(common) - ccall((@cholmod_name("defaults"), :libcholmod), - Cint, (Ptr{Common},), common) - return common -end - -const build_version_array = Vector{Cint}(undef, 3) -ccall((:jl_cholmod_version, :libsuitesparse_wrapper), Cint, (Ptr{Cint},), build_version_array) -const build_version = VersionNumber(build_version_array...) - -function __init__() - try - ### Check if the linked library is compatible with the Julia code - if Libdl.dlsym_e(Libdl.dlopen("libcholmod"), :cholmod_version) != C_NULL - current_version_array = Vector{Cint}(undef, 3) - ccall((:cholmod_version, :libcholmod), Cint, (Ptr{Cint},), current_version_array) - current_version = VersionNumber(current_version_array...) - else # CHOLMOD < 2.1.1 does not include cholmod_version() - current_version = v"0.0.0" - end - - - if current_version < CHOLMOD_MIN_VERSION - @warn """ - CHOLMOD version incompatibility - - Julia was compiled with CHOLMOD version $build_version. It is - currently linked with a version older than - $(CHOLMOD_MIN_VERSION). This might cause Julia to - terminate when working with sparse matrix factorizations, - e.g. solving systems of equations with \\. - - It is recommended that you use Julia with a recent version - of CHOLMOD, or download the generic binaries - from www.julialang.org, which ship with the correct - versions of all dependencies. - """ - elseif build_version != current_version - @warn """ - CHOLMOD version incompatibility - - Julia was compiled with CHOLMOD version $build_version. It is - currently linked with version $current_version. - This might cause Julia to terminate when working with - sparse matrix factorizations, e.g. solving systems of - equations with \\. - - It is recommended that you use Julia with the same major - version of CHOLMOD as the one used during the build, or - download the generic binaries from www.julialang.org, - which ship with the correct versions of all dependencies. - """ - end - - intsize = Int(ccall((:jl_cholmod_sizeof_long,:libsuitesparse_wrapper),Csize_t,())) - if intsize != 4length(IndexTypes) - @error """ - CHOLMOD integer size incompatibility - - Julia was compiled with a version of CHOLMOD that - supported $(32length(IndexTypes)) bit integers. It is - currently linked with version that supports $(8intsize) - integers. This might cause Julia to terminate when - working with sparse matrix factorizations, e.g. solving - systems of equations with \\. - - This problem can be fixed by modifying the Julia build - configuration or by downloading the OS X or generic - Linux binary from www.julialang.org, which include - the correct versions of all dependencies. - """ - end - - ### Initiate CHOLMOD - ### common controls the type of factorization and keeps pointers - ### to temporary memory. We need to manage a copy for each thread. - nt = Threads.nthreads() - resize!(common, nt) - errorhandler = @cfunction(error_handler, Cvoid, (Cint, Cstring, Cint, Cstring)) - for i in 1:nt - common[i] = Common() - common[i].print = 0 # no printing from CHOLMOD by default - common[i].error_handler = errorhandler - end - - # Register gc tracked allocator if CHOLMOD is new enough - if current_version >= v"3.0.0" - cnfg = cglobal((:SuiteSparse_config, :libsuitesparseconfig), Ptr{Cvoid}) - unsafe_store!(cnfg, cglobal(:jl_malloc, Ptr{Cvoid}), 1) - unsafe_store!(cnfg, cglobal(:jl_calloc, Ptr{Cvoid}), 2) - unsafe_store!(cnfg, cglobal(:jl_realloc, Ptr{Cvoid}), 3) - unsafe_store!(cnfg, cglobal(:jl_free, Ptr{Cvoid}), 4) - end - - catch ex - @error "Error during initialization of module CHOLMOD" exception=ex,catch_backtrace() - end -end - -#################### -# Type definitions # -#################### - -abstract type SuiteSparseStruct end - -# The three core data types for CHOLMOD: Dense, Sparse and Factor. -# CHOLMOD manages the memory, so the Julia versions only wrap a -# pointer to a struct. Therefore finalizers should be registered each -# time a pointer is returned from CHOLMOD. - -# Dense -struct C_Dense{T<:VTypes} <: SuiteSparseStruct - nrow::Csize_t - ncol::Csize_t - nzmax::Csize_t - d::Csize_t - x::Ptr{T} - z::Ptr{Cvoid} - xtype::Cint - dtype::Cint -end - -mutable struct Dense{Tv<:VTypes} <: DenseMatrix{Tv} - ptr::Ptr{C_Dense{Tv}} - function Dense{Tv}(ptr::Ptr{C_Dense{Tv}}) where Tv<:VTypes - if ptr == C_NULL - throw(ArgumentError("dense matrix construction failed for " * - "unknown reasons. Please submit a bug report.")) - end - s = unsafe_load(ptr) - if s.xtype != xtyp(Tv) - free!(ptr) - throw(CHOLMODException("xtype=$(s.xtype) not supported")) - elseif s.dtype != dtyp(Tv) - free!(ptr) - throw(CHOLMODException("dtype=$(s.dtype) not supported")) - end - A = new(ptr) - finalizer(free!, A) - return A - end -end -Dense(p::Ptr{C_Dense{Tv}}) where {Tv<:VTypes} = Dense{Tv}(p) - -# Sparse -# allow Cvoid pointer for reading matrices of unknown type from files as in -# cholmod_read_sparse -struct C_Sparse{Tv<:Union{Cvoid, VTypes}} <: SuiteSparseStruct - nrow::Csize_t - ncol::Csize_t - nzmax::Csize_t - p::Ptr{SuiteSparse_long} - i::Ptr{SuiteSparse_long} - nz::Ptr{SuiteSparse_long} - x::Ptr{Tv} - z::Ptr{Cvoid} - stype::Cint - itype::Cint - xtype::Cint - dtype::Cint - sorted::Cint - packed::Cint -end - -mutable struct Sparse{Tv<:VTypes} <: AbstractSparseMatrix{Tv,SuiteSparse_long} - ptr::Ptr{C_Sparse{Tv}} - function Sparse{Tv}(ptr::Ptr{C_Sparse{Tv}}) where Tv<:VTypes - if ptr == C_NULL - throw(ArgumentError("sparse matrix construction failed for " * - "unknown reasons. Please submit a bug report.")) - end - s = unsafe_load(ptr) - if s.itype != ityp(SuiteSparse_long) - free!(ptr) - throw(CHOLMODException("itype=$(s.itype) not supported")) - elseif s.xtype != xtyp(Tv) - free!(ptr) - throw(CHOLMODException("xtype=$(s.xtype) not supported")) - elseif s.dtype != dtyp(Tv) - free!(ptr) - throw(CHOLMODException("dtype=$(s.dtype) not supported")) - end - A = new(ptr) - finalizer(free!, A) - return A - end -end -Sparse(p::Ptr{C_Sparse{Tv}}) where {Tv<:VTypes} = Sparse{Tv}(p) - -# Useful when reading in files, but not type stable -function Sparse(p::Ptr{C_Sparse{Cvoid}}) - if p == C_NULL - throw(ArgumentError("sparse matrix construction failed for " * - "unknown reasons. Please submit a bug report.")) - end - s = unsafe_load(p) - Tv = s.xtype == REAL ? Float64 : ComplexF64 - Sparse(convert(Ptr{C_Sparse{Tv}}, p)) -end - -Base.unsafe_convert(::Type{Ptr{Tv}}, A::Sparse{Tv}) where {Tv} = getfield(A, :ptr) - -# Factor -# Cvoid is used for pattern-only factors -struct C_Factor{Tv<:VTypes} <: SuiteSparseStruct - n::Csize_t - minor::Csize_t - Perm::Ptr{SuiteSparse_long} - ColCount::Ptr{SuiteSparse_long} - @static if build_version >= v"2.1.0" - IPerm::Ptr{SuiteSparse_long} # this pointer was added in version 2.1.0 - end - nzmax::Csize_t - p::Ptr{SuiteSparse_long} - i::Ptr{SuiteSparse_long} - x::Ptr{Tv} - z::Ptr{Cvoid} - nz::Ptr{SuiteSparse_long} - next::Ptr{SuiteSparse_long} - prev::Ptr{SuiteSparse_long} - nsuper::Csize_t - ssize::Csize_t - xsize::Csize_t - maxcsize::Csize_t - maxesize::Csize_t - super::Ptr{SuiteSparse_long} - pi::Ptr{SuiteSparse_long} - px::Ptr{SuiteSparse_long} - s::Ptr{SuiteSparse_long} - ordering::Cint - is_ll::Cint - is_super::Cint - is_monotonic::Cint - itype::Cint - xtype::Cint - dtype::Cint -end - -mutable struct Factor{Tv<:VTypes} <: Factorization{Tv} - ptr::Ptr{C_Factor{Tv}} - function Factor{Tv}(ptr::Ptr{C_Factor{Tv}}, register_finalizer = true) where Tv - if ptr == C_NULL - throw(ArgumentError("factorization construction failed for " * - "unknown reasons. Please submit a bug report.")) - end - s = unsafe_load(ptr) - if s.itype != ityp(SuiteSparse_long) - free!(ptr) - throw(CHOLMODException("itype=$(s.itype) not supported")) - elseif s.xtype != xtyp(Tv) && s.xtype != PATTERN - free!(ptr) - throw(CHOLMODException("xtype=$(s.xtype) not supported")) - elseif s.dtype != dtyp(Tv) - free!(ptr) - throw(CHOLMODException("dtype=$(s.dtype) not supported")) - end - F = new(ptr) - if register_finalizer - finalizer(free!, F) - end - return F - end -end -Factor(ptr::Ptr{C_Factor{Tv}}) where {Tv<:VTypes} = Factor{Tv}(ptr) -Factor(x::Factor) = x - -Base.adjoint(F::Factor) = Adjoint(F) -Base.transpose(F::Factor) = Transpose(F) - -# All pointer loads should be checked to make sure that SuiteSparse is not called with -# a C_NULL pointer which could cause a segfault. Pointers are set to null -# when serialized so this can happen when multiple processes are in use. -function Base.unsafe_convert(::Type{Ptr{T}}, x::Union{Dense,Sparse,Factor}) where T<:SuiteSparseStruct - xp = getfield(x, :ptr) - if xp == C_NULL - throw(ArgumentError("pointer to the $T object is null. This can " * - "happen if the object has been serialized.")) - else - return xp - end -end -Base.pointer(x::Dense{Tv}) where {Tv} = Base.unsafe_convert(Ptr{C_Dense{Tv}}, x) -Base.pointer(x::Sparse{Tv}) where {Tv} = Base.unsafe_convert(Ptr{C_Sparse{Tv}}, x) -Base.pointer(x::Factor{Tv}) where {Tv} = Base.unsafe_convert(Ptr{C_Factor{Tv}}, x) - -# FactorComponent, for encoding particular factors from a factorization -mutable struct FactorComponent{Tv,S} <: AbstractMatrix{Tv} - F::Factor{Tv} - - function FactorComponent{Tv,S}(F::Factor{Tv}) where {Tv,S} - s = unsafe_load(pointer(F)) - if s.is_ll != 0 - if !(S === :L || S === :U || S === :PtL || S === :UP) - throw(CHOLMODException(string(S, " not supported for sparse ", - "LLt matrices; try :L, :U, :PtL, or :UP"))) - end - elseif !(S === :L || S === :U || S === :PtL || S === :UP || - S === :D || S === :LD || S === :DU || S === :PtLD || S === :DUP) - throw(CHOLMODException(string(S, " not supported for sparse LDLt ", - "matrices; try :L, :U, :PtL, :UP, :D, :LD, :DU, :PtLD, or :DUP"))) - end - new(F) - end -end -function FactorComponent(F::Factor{Tv}, sym::Symbol) where Tv - FactorComponent{Tv,sym}(F) -end - -Factor(FC::FactorComponent) = Factor(FC.F) - -################# -# Thin wrappers # -################# - -# Dense wrappers - -### cholmod_core_h ### -function allocate_dense(m::Integer, n::Integer, d::Integer, ::Type{Tv}) where {Tv<:VTypes} - Dense(ccall((@cholmod_name("allocate_dense"), :libcholmod), Ptr{C_Dense{Tv}}, - (Csize_t, Csize_t, Csize_t, Cint, Ptr{Common}), - m, n, d, xtyp(Tv), common[Threads.threadid()])) -end - -function free!(p::Ptr{C_Dense{Tv}}) where {Tv<:VTypes} - ccall((@cholmod_name("free_dense"), :libcholmod), Cint, - (Ref{Ptr{C_Dense{Tv}}}, Ptr{Common}), - p, common[Threads.threadid()]) == TRUE -end -function zeros(m::Integer, n::Integer, ::Type{Tv}) where Tv<:VTypes - Dense(ccall((@cholmod_name("zeros"), :libcholmod), Ptr{C_Dense{Tv}}, - (Csize_t, Csize_t, Cint, Ptr{Common}), - m, n, xtyp(Tv), common[Threads.threadid()])) -end -zeros(m::Integer, n::Integer) = zeros(m, n, Float64) - -function ones(m::Integer, n::Integer, ::Type{Tv}) where Tv<:VTypes - Dense(ccall((@cholmod_name("ones"), :libcholmod), Ptr{C_Dense{Tv}}, - (Csize_t, Csize_t, Cint, Ptr{Common}), - m, n, xtyp(Tv), common[Threads.threadid()])) -end -ones(m::Integer, n::Integer) = ones(m, n, Float64) - -function eye(m::Integer, n::Integer, ::Type{Tv}) where Tv<:VTypes - Dense(ccall((@cholmod_name("eye"), :libcholmod), Ptr{C_Dense{Tv}}, - (Csize_t, Csize_t, Cint, Ptr{Common}), - m, n, xtyp(Tv), common[Threads.threadid()])) -end -eye(m::Integer, n::Integer) = eye(m, n, Float64) -eye(n::Integer) = eye(n, n, Float64) - -function copy(A::Dense{Tv}) where Tv<:VTypes - Dense(ccall((@cholmod_name("copy_dense"), :libcholmod), Ptr{C_Dense{Tv}}, - (Ptr{C_Dense{Tv}}, Ptr{Common}), - A, common[Threads.threadid()])) -end - -function sort!(S::Sparse{Tv}) where Tv<:VTypes - ccall((@cholmod_name("sort"), :libcholmod), Cint, - (Ptr{C_Sparse{Tv}}, Ptr{Common}), - S, common[Threads.threadid()]) - return S -end - -### cholmod_matrixops.h ### -function norm_dense(D::Dense{Tv}, p::Integer) where Tv<:VTypes - s = unsafe_load(pointer(D)) - if p == 2 - if s.ncol > 1 - throw(ArgumentError("2 norm only supported when matrix has one column")) - end - elseif p != 0 && p != 1 - throw(ArgumentError("second argument must be either 0 (Inf norm), 1, or 2")) - end - ccall((@cholmod_name("norm_dense"), :libcholmod), Cdouble, - (Ptr{C_Dense{Tv}}, Cint, Ptr{Common}), - D, p, common[Threads.threadid()]) -end - -### cholmod_check.h ### -function check_dense(A::Dense{Tv}) where Tv<:VTypes - ccall((@cholmod_name("check_dense"), :libcholmod), Cint, - (Ptr{C_Dense{Tv}}, Ptr{Common}), - pointer(A), common[Threads.threadid()]) != 0 -end - -# Non-Dense wrappers -### cholmod_core.h ### -function allocate_sparse(nrow::Integer, ncol::Integer, nzmax::Integer, - sorted::Bool, packed::Bool, stype::Integer, ::Type{Tv}) where {Tv<:VTypes} - Sparse(ccall((@cholmod_name("allocate_sparse"), :libcholmod), - Ptr{C_Sparse{Tv}}, - (Csize_t, Csize_t, Csize_t, Cint, - Cint, Cint, Cint, Ptr{Common}), - nrow, ncol, nzmax, sorted, - packed, stype, xtyp(Tv), common[Threads.threadid()])) -end - -function free!(ptr::Ptr{C_Sparse{Tv}}) where Tv<:VTypes - ccall((@cholmod_name("free_sparse"), :libcholmod), Cint, - (Ref{Ptr{C_Sparse{Tv}}}, Ptr{Common}), - ptr, common[Threads.threadid()]) == TRUE -end - -function free!(ptr::Ptr{C_Factor{Tv}}) where Tv<:VTypes - # Warning! Important that finalizer doesn't modify the global Common struct. - ccall((@cholmod_name("free_factor"), :libcholmod), Cint, - (Ref{Ptr{C_Factor{Tv}}}, Ptr{Common}), - ptr, common[Threads.threadid()]) == TRUE -end - -function aat(A::Sparse{Tv}, fset::Vector{SuiteSparse_long}, mode::Integer) where Tv<:VRealTypes - Sparse(ccall((@cholmod_name("aat"), :libcholmod), - Ptr{C_Sparse{Tv}}, - (Ptr{C_Sparse{Tv}}, Ptr{SuiteSparse_long}, Csize_t, Cint, Ptr{Common}), - A, fset, length(fset), mode, common[Threads.threadid()])) -end - -function sparse_to_dense(A::Sparse{Tv}) where Tv<:VTypes - Dense(ccall((@cholmod_name("sparse_to_dense"),:libcholmod), - Ptr{C_Dense{Tv}}, - (Ptr{C_Sparse{Tv}}, Ptr{Common}), - A, common[Threads.threadid()])) -end -function dense_to_sparse(D::Dense{Tv}, ::Type{SuiteSparse_long}) where Tv<:VTypes - Sparse(ccall((@cholmod_name("dense_to_sparse"),:libcholmod), - Ptr{C_Sparse{Tv}}, - (Ptr{C_Dense{Tv}}, Cint, Ptr{Common}), - D, true, common[Threads.threadid()])) -end - -function factor_to_sparse!(F::Factor{Tv}) where Tv<:VTypes - ss = unsafe_load(pointer(F)) - ss.xtype == PATTERN && throw(CHOLMODException("only numeric factors are supported")) - Sparse(ccall((@cholmod_name("factor_to_sparse"),:libcholmod), - Ptr{C_Sparse{Tv}}, - (Ptr{C_Factor{Tv}}, Ptr{Common}), - F, common[Threads.threadid()])) -end - -function change_factor!(F::Factor{Tv}, to_ll::Bool, to_super::Bool, to_packed::Bool, - to_monotonic::Bool) where Tv<:VTypes - ccall((@cholmod_name("change_factor"),:libcholmod), Cint, - (Cint, Cint, Cint, Cint, Cint, Ptr{C_Factor{Tv}}, Ptr{Common}), - xtyp(Tv), to_ll, to_super, to_packed, to_monotonic, F, common[Threads.threadid()]) == TRUE -end - -function check_sparse(A::Sparse{Tv}) where Tv<:VTypes - ccall((@cholmod_name("check_sparse"),:libcholmod), Cint, - (Ptr{C_Sparse{Tv}}, Ptr{Common}), - A, common[Threads.threadid()]) != 0 -end - -function check_factor(F::Factor{Tv}) where Tv<:VTypes - ccall((@cholmod_name("check_factor"),:libcholmod), Cint, - (Ptr{C_Factor{Tv}}, Ptr{Common}), - F, common[Threads.threadid()]) != 0 -end - -function nnz(A::Sparse{Tv}) where Tv<:VTypes - ccall((@cholmod_name("nnz"),:libcholmod), Int, - (Ptr{C_Sparse{Tv}}, Ptr{Common}), - A, common[Threads.threadid()]) -end - -function speye(m::Integer, n::Integer, ::Type{Tv}) where Tv<:VTypes - Sparse(ccall((@cholmod_name("speye"), :libcholmod), - Ptr{C_Sparse{Tv}}, - (Csize_t, Csize_t, Cint, Ptr{Common}), - m, n, xtyp(Tv), common[Threads.threadid()])) -end - -function spzeros(m::Integer, n::Integer, nzmax::Integer, ::Type{Tv}) where Tv<:VTypes - Sparse(ccall((@cholmod_name("spzeros"), :libcholmod), - Ptr{C_Sparse{Tv}}, - (Csize_t, Csize_t, Csize_t, Cint, Ptr{Common}), - m, n, nzmax, xtyp(Tv), common[Threads.threadid()])) -end - -function transpose_(A::Sparse{Tv}, values::Integer) where Tv<:VTypes - Sparse(ccall((@cholmod_name("transpose"),:libcholmod), - Ptr{C_Sparse{Tv}}, - (Ptr{C_Sparse{Tv}}, Cint, Ptr{Common}), - A, values, common[Threads.threadid()])) -end - -function copy(F::Factor{Tv}) where Tv<:VTypes - Factor(ccall((@cholmod_name("copy_factor"),:libcholmod), - Ptr{C_Factor{Tv}}, - (Ptr{C_Factor{Tv}}, Ptr{Common}), - F, common[Threads.threadid()])) -end -function copy(A::Sparse{Tv}) where Tv<:VTypes - Sparse(ccall((@cholmod_name("copy_sparse"),:libcholmod), - Ptr{C_Sparse{Tv}}, - (Ptr{C_Sparse{Tv}}, Ptr{Common}), - A, common[Threads.threadid()])) -end -function copy(A::Sparse{Tv}, stype::Integer, mode::Integer) where Tv<:VRealTypes - Sparse(ccall((@cholmod_name("copy"),:libcholmod), - Ptr{C_Sparse{Tv}}, - (Ptr{C_Sparse{Tv}}, Cint, Cint, Ptr{Common}), - A, stype, mode, common[Threads.threadid()])) -end - -### cholmod_check.h ### -function print_sparse(A::Sparse{Tv}, name::String) where Tv<:VTypes - isascii(name) || error("non-ASCII name: $name") - @cholmod_param print = 3 begin - ccall((@cholmod_name("print_sparse"),:libcholmod), Cint, - (Ptr{C_Sparse{Tv}}, Ptr{UInt8}, Ptr{Common}), - A, name, common[Threads.threadid()]) - end - nothing -end -function print_factor(F::Factor{Tv}, name::String) where Tv<:VTypes - @cholmod_param print = 3 begin - ccall((@cholmod_name("print_factor"),:libcholmod), Cint, - (Ptr{C_Factor{Tv}}, Ptr{UInt8}, Ptr{Common}), - F, name, common[Threads.threadid()]) - end - nothing -end - -### cholmod_matrixops.h ### -function ssmult(A::Sparse{Tv}, B::Sparse{Tv}, stype::Integer, - values::Bool, sorted::Bool) where Tv<:VRealTypes - lA = unsafe_load(pointer(A)) - lB = unsafe_load(pointer(B)) - if lA.ncol != lB.nrow - throw(DimensionMismatch("inner matrix dimensions do not fit")) - end - Sparse(ccall((@cholmod_name("ssmult"),:libcholmod), - Ptr{C_Sparse{Tv}}, - (Ptr{C_Sparse{Tv}}, Ptr{C_Sparse{Tv}}, Cint, Cint, - Cint, Ptr{Common}), - A, B, stype, values, - sorted, common[Threads.threadid()])) -end - -function norm_sparse(A::Sparse{Tv}, norm::Integer) where Tv<:VTypes - if norm != 0 && norm != 1 - throw(ArgumentError("norm argument must be either 0 or 1")) - end - ccall((@cholmod_name("norm_sparse"), :libcholmod), Cdouble, - (Ptr{C_Sparse{Tv}}, Cint, Ptr{Common}), - A, norm, common[Threads.threadid()]) -end - -function horzcat(A::Sparse{Tv}, B::Sparse{Tv}, values::Bool) where Tv<:VRealTypes - Sparse(ccall((@cholmod_name("horzcat"), :libcholmod), - Ptr{C_Sparse{Tv}}, - (Ptr{C_Sparse{Tv}}, Ptr{C_Sparse{Tv}}, Cint, Ptr{Common}), - A, B, values, common[Threads.threadid()])) -end - -function scale!(S::Dense{Tv}, scale::Integer, A::Sparse{Tv}) where Tv<:VRealTypes - sS = unsafe_load(pointer(S)) - sA = unsafe_load(pointer(A)) - if sS.ncol != 1 && sS.nrow != 1 - throw(DimensionMismatch("first argument must be a vector")) - end - if scale == SCALAR && sS.nrow != 1 - throw(DimensionMismatch("scaling argument must have length one")) - elseif scale == ROW && sS.nrow*sS.ncol != sA.nrow - throw(DimensionMismatch("scaling vector has length $(sS.nrow*sS.ncol), " * - "but matrix has $(sA.nrow) rows.")) - elseif scale == COL && sS.nrow*sS.ncol != sA.ncol - throw(DimensionMismatch("scaling vector has length $(sS.nrow*sS.ncol), " * - "but matrix has $(sA.ncol) columns")) - elseif scale == SYM - if sA.nrow != sA.ncol - throw(DimensionMismatch("matrix must be square")) - elseif sS.nrow*sS.ncol != sA.nrow - throw(DimensionMismatch("scaling vector has length $(sS.nrow*sS.ncol), " * - "but matrix has $(sA.ncol) columns and rows")) - end - end - - sA = unsafe_load(pointer(A)) - ccall((@cholmod_name("scale"),:libcholmod), Cint, - (Ptr{C_Dense{Tv}}, Cint, Ptr{C_Sparse{Tv}}, Ptr{Common}), - S, scale, A, common[Threads.threadid()]) - A -end - -function sdmult!(A::Sparse{Tv}, transpose::Bool, - α::Number, β::Number, X::Dense{Tv}, Y::Dense{Tv}) where Tv<:VTypes - m, n = size(A) - nc = transpose ? m : n - nr = transpose ? n : m - if nc != size(X, 1) - throw(DimensionMismatch("incompatible dimensions, $nc and $(size(X,1))")) - end - ccall((@cholmod_name("sdmult"),:libcholmod), Cint, - (Ptr{C_Sparse{Tv}}, Cint, - Ref{ComplexF64}, Ref{ComplexF64}, - Ptr{C_Dense{Tv}}, Ptr{C_Dense{Tv}}, Ptr{Common}), - A, transpose, α, β, X, Y, common[Threads.threadid()]) - Y -end - -function vertcat(A::Sparse{Tv}, B::Sparse{Tv}, values::Bool) where Tv<:VRealTypes - Sparse(ccall((@cholmod_name("vertcat"), :libcholmod), - Ptr{C_Sparse{Tv}}, - (Ptr{C_Sparse{Tv}}, Ptr{C_Sparse{Tv}}, Cint, Ptr{Common}), - A, B, values, common[Threads.threadid()])) -end - -function symmetry(A::Sparse{Tv}, option::Integer) where Tv<:VTypes - xmatched = Ref{SuiteSparse_long}() - pmatched = Ref{SuiteSparse_long}() - nzoffdiag = Ref{SuiteSparse_long}() - nzdiag = Ref{SuiteSparse_long}() - rv = ccall((@cholmod_name("symmetry"), :libcholmod), Cint, - (Ptr{C_Sparse{Tv}}, Cint, Ptr{SuiteSparse_long}, Ptr{SuiteSparse_long}, - Ptr{SuiteSparse_long}, Ptr{SuiteSparse_long}, Ptr{Common}), - A, option, xmatched, pmatched, - nzoffdiag, nzdiag, common[Threads.threadid()]) - rv, xmatched[], pmatched[], nzoffdiag[], nzdiag[] -end - -# cholmod_cholesky.h -# For analyze, analyze_p, and factorize_p!, the Common argument must be -# supplied in order to control if the factorization is LLt or LDLt -function analyze(A::Sparse{Tv}) where Tv<:VTypes - Factor(ccall((@cholmod_name("analyze"),:libcholmod), - Ptr{C_Factor{Tv}}, - (Ptr{C_Sparse{Tv}}, Ptr{Common}), - A, common[Threads.threadid()])) -end -function analyze_p(A::Sparse{Tv}, perm::Vector{SuiteSparse_long}) where Tv<:VTypes - length(perm) != size(A,1) && throw(BoundsError()) - Factor(ccall((@cholmod_name("analyze_p"),:libcholmod), - Ptr{C_Factor{Tv}}, - (Ptr{C_Sparse{Tv}}, Ptr{SuiteSparse_long}, Ptr{SuiteSparse_long}, - Csize_t, Ptr{Common}), - A, perm, C_NULL, 0, common[Threads.threadid()])) -end -function factorize!(A::Sparse{Tv}, F::Factor{Tv}) where Tv<:VTypes - ccall((@cholmod_name("factorize"),:libcholmod), Cint, - (Ptr{C_Sparse{Tv}}, Ptr{C_Factor{Tv}}, Ptr{Common}), - A, F, common[Threads.threadid()]) - F -end -function factorize_p!(A::Sparse{Tv}, β::Real, F::Factor{Tv}) where Tv<:VTypes - # note that β is passed as a complex number (double beta[2]), - # but the CHOLMOD manual says that only beta[0] (real part) is used - ccall((@cholmod_name("factorize_p"),:libcholmod), Cint, - (Ptr{C_Sparse{Tv}}, Ref{ComplexF64}, Ptr{SuiteSparse_long}, Csize_t, - Ptr{C_Factor{Tv}}, Ptr{Common}), - A, β, C_NULL, 0, F, common[Threads.threadid()]) - F -end - -function solve(sys::Integer, F::Factor{Tv}, B::Dense{Tv}) where Tv<:VTypes - if size(F,1) != size(B,1) - throw(DimensionMismatch("LHS and RHS should have the same number of rows. " * - "LHS has $(size(F,1)) rows, but RHS has $(size(B,1)) rows.")) - end - if !issuccess(F) - s = unsafe_load(pointer(F)) - if s.is_ll == 1 - throw(LinearAlgebra.PosDefException(s.minor)) - else - throw(LinearAlgebra.ZeroPivotException(s.minor)) - end - end - Dense(ccall((@cholmod_name("solve"),:libcholmod), Ptr{C_Dense{Tv}}, - (Cint, Ptr{C_Factor{Tv}}, Ptr{C_Dense{Tv}}, Ptr{Common}), - sys, F, B, common[Threads.threadid()])) -end - -function spsolve(sys::Integer, F::Factor{Tv}, B::Sparse{Tv}) where Tv<:VTypes - if size(F,1) != size(B,1) - throw(DimensionMismatch("LHS and RHS should have the same number of rows. " * - "LHS has $(size(F,1)) rows, but RHS has $(size(B,1)) rows.")) - end - Sparse(ccall((@cholmod_name("spsolve"),:libcholmod), - Ptr{C_Sparse{Tv}}, - (Cint, Ptr{C_Factor{Tv}}, Ptr{C_Sparse{Tv}}, Ptr{Common}), - sys, F, B, common[Threads.threadid()])) -end - -# Autodetects the types -function read_sparse(file::Libc.FILE, ::Type{SuiteSparse_long}) - Sparse(ccall((@cholmod_name("read_sparse"), :libcholmod), - Ptr{C_Sparse{Cvoid}}, - (Ptr{Cvoid}, Ptr{Common}), - file.ptr, common[Threads.threadid()])) -end - -function read_sparse(file::IO, T) - cfile = Libc.FILE(file) - try return read_sparse(cfile, T) - finally close(cfile) - end -end - -function get_perm(F::Factor) - s = unsafe_load(pointer(F)) - p = unsafe_wrap(Array, s.Perm, s.n, own = false) - p .+ 1 -end -get_perm(FC::FactorComponent) = get_perm(Factor(FC)) - -######################### -# High level interfaces # -######################### - -# Conversion/construction -function Dense{T}(A::StridedVecOrMat) where T<:VTypes - d = allocate_dense(size(A, 1), size(A, 2), stride(A, 2), T) - GC.@preserve d begin - s = unsafe_load(pointer(d)) - for (i, c) in enumerate(eachindex(A)) - unsafe_store!(s.x, A[c], i) - end - end - d -end -function Dense{T}(A::Union{Adjoint{<:Any, <:StridedVecOrMat}, Transpose{<:Any, <:StridedVecOrMat}}) where T<:VTypes - d = allocate_dense(size(A, 1), size(A, 2), size(A, 1), T) - GC.@preserve d begin - s = unsafe_load(pointer(d)) - for (i, c) in enumerate(eachindex(A)) - unsafe_store!(s.x, A[c], i) - end - end - d -end -function Dense(A::Union{StridedVecOrMat, Adjoint{<:Any, <:StridedVecOrMat}, Transpose{<:Any, <:StridedVecOrMat}}) - T = promote_type(eltype(A), Float64) - return Dense{T}(A) -end -Dense(A::Sparse) = sparse_to_dense(A) - -# This constructior assumes zero based colptr and rowval -function Sparse(m::Integer, n::Integer, - colptr0::Vector{SuiteSparse_long}, rowval0::Vector{SuiteSparse_long}, - nzval::Vector{Tv}, stype) where Tv<:VTypes - # checks - ## length of input - if length(colptr0) <= n - throw(ArgumentError("length of colptr0 must be at least n + 1 = $(n + 1) but was $(length(colptr0))")) - end - if colptr0[n + 1] > length(rowval0) - throw(ArgumentError("length of rowval0 is $(length(rowval0)) but value of colptr0 requires length to be at least $(colptr0[n + 1])")) - end - if colptr0[n + 1] > length(nzval) - throw(ArgumentError("length of nzval is $(length(nzval)) but value of colptr0 requires length to be at least $(colptr0[n + 1])")) - end - ## columns are sorted - iss = true - for i = 2:length(colptr0) - if !issorted(view(rowval0, colptr0[i - 1] + 1:colptr0[i])) - iss = false - break - end - end - - o = allocate_sparse(m, n, colptr0[n + 1], iss, true, stype, Tv) - s = unsafe_load(pointer(o)) - - unsafe_copyto!(s.p, pointer(colptr0), n + 1) - unsafe_copyto!(s.i, pointer(rowval0), colptr0[n + 1]) - unsafe_copyto!(s.x, pointer(nzval) , colptr0[n + 1]) - - check_sparse(o) - - return o -end - -function Sparse(m::Integer, n::Integer, - colptr0::Vector{SuiteSparse_long}, - rowval0::Vector{SuiteSparse_long}, - nzval::Vector{<:VTypes}) - o = Sparse(m, n, colptr0, rowval0, nzval, 0) - - # sort indices - sort!(o) - - # check if array is symmetric and change stype if it is - if ishermitian(o) - change_stype!(o, -1) - end - o -end - -function Sparse{Tv}(A::SparseMatrixCSC, stype::Integer) where Tv<:VTypes - ## Check length of input. This should never fail but see #20024 - if length(getcolptr(A)) <= size(A, 2) - throw(ArgumentError("length of colptr must be at least size(A,2) + 1 = $(size(A, 2) + 1) but was $(length(getcolptr(A)))")) - end - if nnz(A) > length(rowvals(A)) - throw(ArgumentError("length of rowval is $(length(rowvals(A))) but value of colptr requires length to be at least $(nnz(A))")) - end - if nnz(A) > length(nonzeros(A)) - throw(ArgumentError("length of nzval is $(length(nonzeros(A))) but value of colptr requires length to be at least $(nnz(A))")) - end - - o = allocate_sparse(size(A, 1), size(A, 2), nnz(A), true, true, stype, Tv) - s = unsafe_load(pointer(o)) - for i = 1:(size(A, 2) + 1) - unsafe_store!(s.p, getcolptr(A)[i] - 1, i) - end - for i = 1:nnz(A) - unsafe_store!(s.i, rowvals(A)[i] - 1, i) - end - if Tv <: Complex && stype != 0 - # Need to remove any non real elements in the diagonal because, in contrast to - # BLAS/LAPACK these are not ignored by CHOLMOD. If even tiny imaginary parts are - # present CHOLMOD will fail with a non-positive definite/zero pivot error. - for j = 1:size(A, 2) - for ip = getcolptr(A)[j]:getcolptr(A)[j + 1] - 1 - v = nonzeros(A)[ip] - unsafe_store!(s.x, rowvals(A)[ip] == j ? Complex(real(v)) : v, ip) - end - end - elseif Tv == eltype(nonzeros(A)) - unsafe_copyto!(s.x, pointer(nonzeros(A)), nnz(A)) - else - for i = 1:nnz(A) - unsafe_store!(s.x, nonzeros(A)[i], i) - end - end - - check_sparse(o) - - return o -end - -# handle promotion -function Sparse(A::SparseMatrixCSC{Tv,SuiteSparse_long}, stype::Integer) where {Tv} - T = promote_type(Tv, Float64) - return Sparse{T}(A, stype) -end - -# convert SparseVectors into CHOLMOD Sparse types through a mx1 CSC matrix -Sparse(A::SparseVector) = Sparse(SparseMatrixCSC(A)) -function Sparse(A::SparseMatrixCSC) - o = Sparse(A, 0) - # check if array is symmetric and change stype if it is - if ishermitian(o) - change_stype!(o, -1) - end - o -end - -Sparse(A::Symmetric{Tv, SparseMatrixCSC{Tv,Ti}}) where {Tv<:Real, Ti} = - Sparse(A.data, A.uplo == 'L' ? -1 : 1) -Sparse(A::Hermitian{Tv,SparseMatrixCSC{Tv,Ti}}) where {Tv, Ti} = - Sparse(A.data, A.uplo == 'L' ? -1 : 1) - -Sparse(A::Dense) = dense_to_sparse(A, SuiteSparse_long) -Sparse(L::Factor) = factor_to_sparse!(copy(L)) -function Sparse(filename::String) - open(filename) do f - return read_sparse(f, SuiteSparse_long) - end -end - -## conversion back to base Julia types -function Matrix{T}(D::Dense{T}) where T - s = unsafe_load(pointer(D)) - a = Matrix{T}(undef, s.nrow, s.ncol) - copyto!(a, D) -end - -Base.copyto!(dest::Base.PermutedDimsArrays.PermutedDimsArray, src::Dense) = _copy!(dest, src) # ambig -Base.copyto!(dest::Dense{T}, D::Dense{T}) where {T<:VTypes} = _copy!(dest, D) -Base.copyto!(dest::AbstractArray{T}, D::Dense{T}) where {T<:VTypes} = _copy!(dest, D) -Base.copyto!(dest::AbstractArray{T,2}, D::Dense{T}) where {T<:VTypes} = _copy!(dest, D) -Base.copyto!(dest::AbstractArray, D::Dense) = _copy!(dest, D) - -function _copy!(dest::AbstractArray, D::Dense) - require_one_based_indexing(dest) - s = unsafe_load(pointer(D)) - n = s.nrow*s.ncol - n <= length(dest) || throw(BoundsError(dest, n)) - if s.d == s.nrow && isa(dest, Array) - unsafe_copyto!(pointer(dest), s.x, s.d*s.ncol) - else - k = 0 - for j = 1:s.ncol - for i = 1:s.nrow - dest[k+=1] = unsafe_load(s.x, i + (j - 1)*s.d) - end - end - end - dest -end -Matrix(D::Dense{T}) where {T} = Matrix{T}(D) -function Vector{T}(D::Dense{T}) where T - if size(D, 2) > 1 - throw(DimensionMismatch("input must be a vector but had $(size(D, 2)) columns")) - end - copyto!(Vector{T}(undef, size(D, 1)), D) -end -Vector(D::Dense{T}) where {T} = Vector{T}(D) - -function _extract_args(s) - return (s.nrow, s.ncol, increment(unsafe_wrap(Array, s.p, (s.ncol + 1,), own = false)), - increment(unsafe_wrap(Array, s.i, (s.nzmax,), own = false)), - copy(unsafe_wrap(Array, s.x, (s.nzmax,), own = false))) -end - -# Trim extra elements in rowval and nzval left around sometimes by CHOLMOD rutines -function _trim_nz_builder!(m, n, colptr, rowval, nzval) - l = colptr[end] - 1 - resize!(rowval, l) - resize!(nzval, l) - SparseMatrixCSC(m, n, colptr, rowval, nzval) -end - -function SparseMatrixCSC{Tv,SuiteSparse_long}(A::Sparse{Tv}) where Tv - s = unsafe_load(pointer(A)) - if s.stype != 0 - throw(ArgumentError("matrix has stype != 0. Convert to matrix " * - "with stype == 0 before converting to SparseMatrixCSC")) - end - args = _extract_args(s) - s.sorted == 0 && _sort_buffers!(args...); - return _trim_nz_builder!(args...) -end - -function Symmetric{Float64,SparseMatrixCSC{Float64,SuiteSparse_long}}(A::Sparse{Float64}) - s = unsafe_load(pointer(A)) - issymmetric(A) || throw(ArgumentError("matrix is not symmetric")) - args = _extract_args(s) - s.sorted == 0 && _sort_buffers!(args...) - Symmetric(_trim_nz_builder!(args...), s.stype > 0 ? :U : :L) -end -convert(T::Type{Symmetric{Float64,SparseMatrixCSC{Float64,SuiteSparse_long}}}, A::Sparse{Float64}) = T(A) - -function Hermitian{Tv,SparseMatrixCSC{Tv,SuiteSparse_long}}(A::Sparse{Tv}) where Tv<:VTypes - s = unsafe_load(pointer(A)) - ishermitian(A) || throw(ArgumentError("matrix is not Hermitian")) - args = _extract_args(s) - s.sorted == 0 && _sort_buffers!(args...) - Hermitian(_trim_nz_builder!(args...), s.stype > 0 ? :U : :L) -end -convert(T::Type{Hermitian{Tv,SparseMatrixCSC{Tv,SuiteSparse_long}}}, A::Sparse{Tv}) where {Tv<:VTypes} = T(A) - -function sparse(A::Sparse{Float64}) # Notice! Cannot be type stable because of stype - s = unsafe_load(pointer(A)) - if s.stype == 0 - return SparseMatrixCSC{Float64,SuiteSparse_long}(A) - end - Symmetric{Float64,SparseMatrixCSC{Float64,SuiteSparse_long}}(A) -end -function sparse(A::Sparse{ComplexF64}) # Notice! Cannot be type stable because of stype - s = unsafe_load(pointer(A)) - if s.stype == 0 - return SparseMatrixCSC{ComplexF64,SuiteSparse_long}(A) - end - Hermitian{ComplexF64,SparseMatrixCSC{ComplexF64,SuiteSparse_long}}(A) -end -function sparse(F::Factor) - s = unsafe_load(pointer(F)) - if s.is_ll != 0 - L = Sparse(F) - A = sparse(L*L') - else - LD = sparse(F.LD) - L, d = getLd!(LD) - A = (L * Diagonal(d)) * L' - end - # no need to sort buffers here, as A isa SparseMatrixCSC - # and it is taken care in sparse - p = get_perm(F) - if p != [1:s.n;] - pinv = Vector{Int}(undef, length(p)) - for k = 1:length(p) - pinv[p[k]] = k - end - A = A[pinv,pinv] - end - A -end - -sparse(D::Dense) = sparse(Sparse(D)) - -function sparse(FC::FactorComponent{Tv,:L}) where Tv - F = Factor(FC) - s = unsafe_load(pointer(F)) - if s.is_ll == 0 - throw(CHOLMODException("sparse: supported only for :LD on LDLt factorizations")) - end - sparse(Sparse(F)) -end -sparse(FC::FactorComponent{Tv,:LD}) where {Tv} = sparse(Sparse(Factor(FC))) - -# Calculate the offset into the stype field of the cholmod_sparse_struct and -# change the value -let offset = fieldoffset(C_Sparse{Float64}, findfirst(name -> name === :stype, fieldnames(C_Sparse{Float64}))::Int) - global change_stype! - function change_stype!(A::Sparse, i::Integer) - unsafe_store!(convert(Ptr{Cint}, pointer(A)), i, div(offset, 4) + 1) - return A - end -end - -free!(A::Dense) = free!(pointer(A)) -free!(A::Sparse) = free!(pointer(A)) -free!(F::Factor) = free!(pointer(F)) - -eltype(::Type{Dense{T}}) where {T<:VTypes} = T -eltype(::Type{Factor{T}}) where {T<:VTypes} = T -eltype(::Type{Sparse{T}}) where {T<:VTypes} = T - -nnz(F::Factor) = nnz(Sparse(F)) - -function show(io::IO, F::Factor) - println(io, typeof(F)) - showfactor(io, F) -end - -function show(io::IO, FC::FactorComponent) - println(io, typeof(FC)) - showfactor(io, Factor(FC)) -end - -function showfactor(io::IO, F::Factor) - s = unsafe_load(pointer(F)) - print(io, """ - type: $(s.is_ll!=0 ? "LLt" : "LDLt") - method: $(s.is_super!=0 ? "supernodal" : "simplicial") - maxnnz: $(Int(s.nzmax)) - nnz: $(nnz(F)) - success: $(s.minor == size(F, 1)) - """) -end - -# getindex not defined for these, so don't use the normal array printer -show(io::IO, ::MIME"text/plain", FC::FactorComponent) = show(io, FC) -show(io::IO, ::MIME"text/plain", F::Factor) = show(io, F) - -isvalid(A::Dense) = check_dense(A) -isvalid(A::Sparse) = check_sparse(A) -isvalid(A::Factor) = check_factor(A) - -function size(A::Union{Dense,Sparse}) - s = unsafe_load(pointer(A)) - return (Int(s.nrow), Int(s.ncol)) -end -function size(F::Factor, i::Integer) - if i < 1 - throw(ArgumentError("dimension must be positive")) - end - s = unsafe_load(pointer(F)) - if i <= 2 - return Int(s.n) - end - return 1 -end -size(F::Factor) = (size(F, 1), size(F, 2)) -axes(A::Union{Dense,Sparse,Factor}) = map(Base.OneTo, size(A)) - -IndexStyle(::Dense) = IndexLinear() - -size(FC::FactorComponent, i::Integer) = size(FC.F, i) -size(FC::FactorComponent) = size(FC.F) - -adjoint(FC::FactorComponent{Tv,:L}) where {Tv} = FactorComponent{Tv,:U}(FC.F) -adjoint(FC::FactorComponent{Tv,:U}) where {Tv} = FactorComponent{Tv,:L}(FC.F) -adjoint(FC::FactorComponent{Tv,:PtL}) where {Tv} = FactorComponent{Tv,:UP}(FC.F) -adjoint(FC::FactorComponent{Tv,:UP}) where {Tv} = FactorComponent{Tv,:PtL}(FC.F) -adjoint(FC::FactorComponent{Tv,:D}) where {Tv} = FC -adjoint(FC::FactorComponent{Tv,:LD}) where {Tv} = FactorComponent{Tv,:DU}(FC.F) -adjoint(FC::FactorComponent{Tv,:DU}) where {Tv} = FactorComponent{Tv,:LD}(FC.F) -adjoint(FC::FactorComponent{Tv,:PtLD}) where {Tv} = FactorComponent{Tv,:DUP}(FC.F) -adjoint(FC::FactorComponent{Tv,:DUP}) where {Tv} = FactorComponent{Tv,:PtLD}(FC.F) - -function getindex(A::Dense, i::Integer) - s = unsafe_load(pointer(A)) - 0 < i <= s.nrow*s.ncol || throw(BoundsError()) - unsafe_load(s.x, i) -end - -IndexStyle(::Sparse) = IndexCartesian() -function getindex(A::Sparse{T}, i0::Integer, i1::Integer) where T - s = unsafe_load(pointer(A)) - !(1 <= i0 <= s.nrow && 1 <= i1 <= s.ncol) && throw(BoundsError()) - s.stype < 0 && i0 < i1 && return conj(A[i1,i0]) - s.stype > 0 && i0 > i1 && return conj(A[i1,i0]) - - r1 = Int(unsafe_load(s.p, i1) + 1) - r2 = Int(unsafe_load(s.p, i1 + 1)) - (r1 > r2) && return zero(T) - r1 = Int(searchsortedfirst(unsafe_wrap(Array, s.i, (s.nzmax,), own = false), - i0 - 1, r1, r2, Base.Order.Forward)) - ((r1 > r2) || (unsafe_load(s.i, r1) + 1 != i0)) ? zero(T) : unsafe_load(s.x, r1) -end - -@inline function getproperty(F::Factor, sym::Symbol) - if sym === :p - return get_perm(F) - elseif sym === :ptr - return getfield(F, :ptr) - else - return FactorComponent(F, sym) - end -end - -function getLd!(S::SparseMatrixCSC) - d = Vector{eltype(S)}(undef, size(S, 1)) - fill!(d, 0) - col = 1 - for k = 1:nnz(S) - while k >= getcolptr(S)[col+1] - col += 1 - end - if rowvals(S)[k] == col - d[col] = nonzeros(S)[k] - nonzeros(S)[k] = 1 - end - end - S, d -end - -## Multiplication -(*)(A::Sparse, B::Sparse) = ssmult(A, B, 0, true, true) -(*)(A::Sparse, B::Dense) = sdmult!(A, false, 1., 0., B, zeros(size(A, 1), size(B, 2))) -(*)(A::Sparse, B::VecOrMat) = (*)(A, Dense(B)) - -function *(A::Sparse{Tv}, adjB::Adjoint{Tv,Sparse{Tv}}) where Tv<:VRealTypes - B = adjB.parent - if A !== B - aa1 = transpose_(B, 2) - ## result of ssmult will have stype==0, contain numerical values and be sorted - return ssmult(A, aa1, 0, true, true) - end - - ## The A*A' case is handled by cholmod_aat. This routine requires - ## A->stype == 0 (storage of upper and lower parts). If necessary - ## the matrix A is first converted to stype == 0 - s = unsafe_load(pointer(A)) - fset = s.ncol == 0 ? SuiteSparse_long[] : SuiteSparse_long[0:s.ncol-1;] - if s.stype != 0 - aa1 = copy(A, 0, 1) - return aat(aa1, fset, 1) - else - return aat(A, fset, 1) - end -end - -function *(adjA::Adjoint{<:Any,<:Sparse}, B::Sparse) - A = adjA.parent - aa1 = transpose_(A, 2) - if A === B - return *(aa1, adjoint(aa1)) - end - ## result of ssmult will have stype==0, contain numerical values and be sorted - return ssmult(aa1, B, 0, true, true) -end - -*(adjA::Adjoint{<:Any,<:Sparse}, B::Dense) = - (A = adjA.parent; sdmult!(A, true, 1., 0., B, zeros(size(A, 2), size(B, 2)))) -*(adjA::Adjoint{<:Any,<:Sparse}, B::VecOrMat) = - (A = adjA.parent; *(adjoint(A), Dense(B))) - - -## Factorization methods - -## Compute that symbolic factorization only -function symbolic(A::Sparse{<:VTypes}; - perm::Union{Nothing,AbstractVector{SuiteSparse_long}}=nothing, - postorder::Bool=isnothing(perm)||isempty(perm), userperm_only::Bool=true) - - sA = unsafe_load(pointer(A)) - sA.stype == 0 && throw(ArgumentError("sparse matrix is not symmetric/Hermitian")) - - @cholmod_param postorder = postorder begin - if perm === nothing || isempty(perm) # TODO: deprecate empty perm - return analyze(A) - else # user permutation provided - if userperm_only # use perm even if it is worse than AMD - @cholmod_param nmethods = 1 begin - return analyze_p(A, SuiteSparse_long[p-1 for p in perm]) - end - else - return analyze_p(A, SuiteSparse_long[p-1 for p in perm]) - end - end - end -end - -function cholesky!(F::Factor{Tv}, A::Sparse{Tv}; - shift::Real=0.0, check::Bool = true) where Tv - # Compute the numerical factorization - @cholmod_param final_ll = true begin - factorize_p!(A, shift, F) - end - - check && (issuccess(F) || throw(LinearAlgebra.PosDefException(1))) - return F -end - -""" - cholesky!(F::CHOLMOD.Factor, A::SparseMatrixCSC; shift = 0.0, check = true) -> CHOLMOD.Factor - -Compute the Cholesky (``LL'``) factorization of `A`, reusing the symbolic -factorization `F`. `A` must be a [`SparseMatrixCSC`](@ref) or a [`Symmetric`](@ref)/ -[`Hermitian`](@ref) view of a `SparseMatrixCSC`. Note that even if `A` doesn't -have the type tag, it must still be symmetric or Hermitian. - -See also [`cholesky`](@ref). - -!!! note - This method uses the CHOLMOD library from SuiteSparse, which only supports - doubles or complex doubles. Input matrices not of those element types will - be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` - as appropriate. -""" -cholesky!(F::Factor, A::Union{SparseMatrixCSC{T}, - SparseMatrixCSC{Complex{T}}, - Symmetric{T,SparseMatrixCSC{T,SuiteSparse_long}}, - Hermitian{Complex{T},SparseMatrixCSC{Complex{T},SuiteSparse_long}}, - Hermitian{T,SparseMatrixCSC{T,SuiteSparse_long}}}; - shift = 0.0, check::Bool = true) where {T<:Real} = - cholesky!(F, Sparse(A); shift = shift, check = check) - -function cholesky(A::Sparse; shift::Real=0.0, check::Bool = true, - perm::Union{Nothing,AbstractVector{SuiteSparse_long}}=nothing) - - # Compute the symbolic factorization - F = symbolic(A; perm = perm) - - # Compute the numerical factorization - cholesky!(F, A; shift = shift, check = check) - - return F -end - -""" - cholesky(A::SparseMatrixCSC; shift = 0.0, check = true, perm = nothing) -> CHOLMOD.Factor - -Compute the Cholesky factorization of a sparse positive definite matrix `A`. -`A` must be a [`SparseMatrixCSC`](@ref) or a [`Symmetric`](@ref)/[`Hermitian`](@ref) -view of a `SparseMatrixCSC`. Note that even if `A` doesn't -have the type tag, it must still be symmetric or Hermitian. -If `perm` is not given, a fill-reducing permutation is used. -`F = cholesky(A)` is most frequently used to solve systems of equations with `F\\b`, -but also the methods [`diag`](@ref), [`det`](@ref), and -[`logdet`](@ref) are defined for `F`. -You can also extract individual factors from `F`, using `F.L`. -However, since pivoting is on by default, the factorization is internally -represented as `A == P'*L*L'*P` with a permutation matrix `P`; -using just `L` without accounting for `P` will give incorrect answers. -To include the effects of permutation, -it's typically preferable to extract "combined" factors like `PtL = F.PtL` -(the equivalent of `P'*L`) and `LtP = F.UP` (the equivalent of `L'*P`). - -When `check = true`, an error is thrown if the decomposition fails. -When `check = false`, responsibility for checking the decomposition's -validity (via [`issuccess`](@ref)) lies with the user. - -Setting the optional `shift` keyword argument computes the factorization of -`A+shift*I` instead of `A`. If the `perm` argument is provided, -it should be a permutation of `1:size(A,1)` giving the ordering to use -(instead of CHOLMOD's default AMD ordering). - -# Examples - -In the following example, the fill-reducing permutation used is `[3, 2, 1]`. -If `perm` is set to `1:3` to enforce no permutation, the number of nonzero -elements in the factor is 6. -```jldoctest -julia> A = [2 1 1; 1 2 0; 1 0 2] -3×3 Matrix{Int64}: - 2 1 1 - 1 2 0 - 1 0 2 - -julia> C = cholesky(sparse(A)) -SuiteSparse.CHOLMOD.Factor{Float64} -type: LLt -method: simplicial -maxnnz: 5 -nnz: 5 -success: true - -julia> C.p -3-element Vector{Int64}: - 3 - 2 - 1 - -julia> L = sparse(C.L); - -julia> Matrix(L) -3×3 Matrix{Float64}: - 1.41421 0.0 0.0 - 0.0 1.41421 0.0 - 0.707107 0.707107 1.0 - -julia> L * L' ≈ A[C.p, C.p] -true - -julia> P = sparse(1:3, C.p, ones(3)) -3×3 SparseMatrixCSC{Float64, Int64} with 3 stored entries: - ⋅ ⋅ 1.0 - ⋅ 1.0 ⋅ - 1.0 ⋅ ⋅ - -julia> P' * L * L' * P ≈ A -true - -julia> C = cholesky(sparse(A), perm=1:3) -SuiteSparse.CHOLMOD.Factor{Float64} -type: LLt -method: simplicial -maxnnz: 6 -nnz: 6 -success: true - -julia> L = sparse(C.L); - -julia> Matrix(L) -3×3 Matrix{Float64}: - 1.41421 0.0 0.0 - 0.707107 1.22474 0.0 - 0.707107 -0.408248 1.1547 - -julia> L * L' ≈ A -true -``` - -!!! note - This method uses the CHOLMOD library from SuiteSparse, which only supports - doubles or complex doubles. Input matrices not of those element types will - be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` - as appropriate. - - Many other functions from CHOLMOD are wrapped but not exported from the - `Base.SparseArrays.CHOLMOD` module. -""" -cholesky(A::Union{SparseMatrixCSC{T}, SparseMatrixCSC{Complex{T}}, - Symmetric{T,SparseMatrixCSC{T,SuiteSparse_long}}, - Hermitian{Complex{T},SparseMatrixCSC{Complex{T},SuiteSparse_long}}, - Hermitian{T,SparseMatrixCSC{T,SuiteSparse_long}}}; - kws...) where {T<:Real} = cholesky(Sparse(A); kws...) - - -function ldlt!(F::Factor{Tv}, A::Sparse{Tv}; - shift::Real=0.0, check::Bool = true) where Tv - # Makes it an LDLt - change_factor!(F, false, false, true, false) - - # Compute the numerical factorization - factorize_p!(A, shift, F) - - check && (issuccess(F) || throw(LinearAlgebra.ZeroPivotException(1))) - return F -end - -""" - ldlt!(F::CHOLMOD.Factor, A::SparseMatrixCSC; shift = 0.0, check = true) -> CHOLMOD.Factor - -Compute the ``LDL'`` factorization of `A`, reusing the symbolic factorization `F`. -`A` must be a [`SparseMatrixCSC`](@ref) or a [`Symmetric`](@ref)/[`Hermitian`](@ref) -view of a `SparseMatrixCSC`. Note that even if `A` doesn't -have the type tag, it must still be symmetric or Hermitian. - -See also [`ldlt`](@ref). - -!!! note - This method uses the CHOLMOD library from SuiteSparse, which only supports - doubles or complex doubles. Input matrices not of those element types will - be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` - as appropriate. -""" -ldlt!(F::Factor, A::Union{SparseMatrixCSC{T}, - SparseMatrixCSC{Complex{T}}, - Symmetric{T,SparseMatrixCSC{T,SuiteSparse_long}}, - Hermitian{Complex{T},SparseMatrixCSC{Complex{T},SuiteSparse_long}}, - Hermitian{T,SparseMatrixCSC{T,SuiteSparse_long}}}; - shift = 0.0, check::Bool = true) where {T<:Real} = - ldlt!(F, Sparse(A), shift = shift, check = check) - -function ldlt(A::Sparse; shift::Real=0.0, check::Bool = true, - perm::Union{Nothing,AbstractVector{SuiteSparse_long}}=nothing) - - # Makes it an LDLt - @cholmod_param final_ll = false begin - # Really make sure it's an LDLt by avoiding supernodal factorization - @cholmod_param supernodal = 0 begin - # Compute the symbolic factorization - F = symbolic(A; perm = perm) - - # Compute the numerical factorization - ldlt!(F, A; shift = shift, check = check) - - return F - end - end -end - -""" - ldlt(A::SparseMatrixCSC; shift = 0.0, check = true, perm=nothing) -> CHOLMOD.Factor - -Compute the ``LDL'`` factorization of a sparse matrix `A`. -`A` must be a [`SparseMatrixCSC`](@ref) or a [`Symmetric`](@ref)/[`Hermitian`](@ref) -view of a `SparseMatrixCSC`. Note that even if `A` doesn't -have the type tag, it must still be symmetric or Hermitian. -A fill-reducing permutation is used. `F = ldlt(A)` is most frequently -used to solve systems of equations `A*x = b` with `F\\b`. The returned -factorization object `F` also supports the methods [`diag`](@ref), -[`det`](@ref), [`logdet`](@ref), and [`inv`](@ref). -You can extract individual factors from `F` using `F.L`. -However, since pivoting is on by default, the factorization is internally -represented as `A == P'*L*D*L'*P` with a permutation matrix `P`; -using just `L` without accounting for `P` will give incorrect answers. -To include the effects of permutation, it is typically preferable to extract -"combined" factors like `PtL = F.PtL` (the equivalent of -`P'*L`) and `LtP = F.UP` (the equivalent of `L'*P`). -The complete list of supported factors is `:L, :PtL, :D, :UP, :U, :LD, :DU, :PtLD, :DUP`. - -When `check = true`, an error is thrown if the decomposition fails. -When `check = false`, responsibility for checking the decomposition's -validity (via [`issuccess`](@ref)) lies with the user. - -Setting the optional `shift` keyword argument computes the factorization of -`A+shift*I` instead of `A`. If the `perm` argument is provided, -it should be a permutation of `1:size(A,1)` giving the ordering to use -(instead of CHOLMOD's default AMD ordering). - -!!! note - This method uses the CHOLMOD library from SuiteSparse, which only supports - doubles or complex doubles. Input matrices not of those element types will - be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` - as appropriate. - - Many other functions from CHOLMOD are wrapped but not exported from the - `Base.SparseArrays.CHOLMOD` module. -""" -ldlt(A::Union{SparseMatrixCSC{T},SparseMatrixCSC{Complex{T}}, - Symmetric{T,SparseMatrixCSC{T,SuiteSparse_long}}, - Hermitian{Complex{T},SparseMatrixCSC{Complex{T},SuiteSparse_long}}, - Hermitian{T,SparseMatrixCSC{T,SuiteSparse_long}}}; - kws...) where {T<:Real} = ldlt(Sparse(A); kws...) - -## Rank updates - -""" - lowrankupdowndate!(F::CHOLMOD.Factor, C::Sparse, update::Cint) - -Update an `LDLt` or `LLt` Factorization `F` of `A` to a factorization of `A ± C*C'`. - -If sparsity preserving factorization is used, i.e. `L*L' == P*A*P'` then the new -factor will be `L*L' == P*A*P' + C'*C` - -`update`: `Cint(1)` for `A + CC'`, `Cint(0)` for `A - CC'` -""" -function lowrankupdowndate!(F::Factor{Tv}, C::Sparse{Tv}, update::Cint) where Tv<:VTypes - lF = unsafe_load(pointer(F)) - lC = unsafe_load(pointer(C)) - if lF.n != lC.nrow - throw(DimensionMismatch("matrix dimensions do not fit")) - end - ccall((@cholmod_name("updown"), :libcholmod), Cint, - (Cint, Ptr{C_Sparse{Tv}}, Ptr{C_Factor{Tv}}, Ptr{Common}), - update, C, F, common[Threads.threadid()]) - F -end - -#Helper functions for rank updates -lowrank_reorder(V::AbstractArray,p) = Sparse(sparse(V[p,:])) -lowrank_reorder(V::AbstractSparseArray,p) = Sparse(V[p,:]) - -""" - lowrankupdate!(F::CHOLMOD.Factor, C::AbstractArray) - -Update an `LDLt` or `LLt` Factorization `F` of `A` to a factorization of `A + C*C'`. - -`LLt` factorizations are converted to `LDLt`. - -See also [`lowrankupdate`](@ref), [`lowrankdowndate`](@ref), [`lowrankdowndate!`](@ref). -""" -function lowrankupdate!(F::Factor{Tv}, V::AbstractArray{Tv}) where Tv<:VTypes - #Reorder and copy V to account for permutation - C = lowrank_reorder(V, get_perm(F)) - lowrankupdowndate!(F, C, Cint(1)) -end - -""" - lowrankdowndate!(F::CHOLMOD.Factor, C::AbstractArray) - -Update an `LDLt` or `LLt` Factorization `F` of `A` to a factorization of `A - C*C'`. - -`LLt` factorizations are converted to `LDLt`. - -See also [`lowrankdowndate`](@ref), [`lowrankupdate`](@ref), [`lowrankupdate!`](@ref). -""" -function lowrankdowndate!(F::Factor{Tv}, V::AbstractArray{Tv}) where Tv<:VTypes - #Reorder and copy V to account for permutation - C = lowrank_reorder(V, get_perm(F)) - lowrankupdowndate!(F, C, Cint(0)) -end - -""" - lowrankupdate(F::CHOLMOD.Factor, C::AbstractArray) -> FF::CHOLMOD.Factor - -Get an `LDLt` Factorization of `A + C*C'` given an `LDLt` or `LLt` factorization `F` of `A`. - -The returned factor is always an `LDLt` factorization. - -See also [`lowrankupdate!`](@ref), [`lowrankdowndate`](@ref), [`lowrankdowndate!`](@ref). -""" -lowrankupdate(F::Factor{Tv}, V::AbstractArray{Tv}) where {Tv<:VTypes} = - lowrankupdate!(copy(F), V) - -""" - lowrankupdate(F::CHOLMOD.Factor, C::AbstractArray) -> FF::CHOLMOD.Factor - -Get an `LDLt` Factorization of `A + C*C'` given an `LDLt` or `LLt` factorization `F` of `A`. - -The returned factor is always an `LDLt` factorization. - -See also [`lowrankdowndate!`](@ref), [`lowrankupdate`](@ref), [`lowrankupdate!`](@ref). -""" -lowrankdowndate(F::Factor{Tv}, V::AbstractArray{Tv}) where {Tv<:VTypes} = - lowrankdowndate!(copy(F), V) - -## Solvers - -for (T, f) in ((:Dense, :solve), (:Sparse, :spsolve)) - @eval begin - # Solve Lx = b and L'x=b where A = L*L' - function (\)(L::FactorComponent{T,:L}, B::$T) where T - ($f)(CHOLMOD_L, Factor(L), B) - end - function (\)(L::FactorComponent{T,:U}, B::$T) where T - ($f)(CHOLMOD_Lt, Factor(L), B) - end - # Solve PLx = b and L'P'x=b where A = P*L*L'*P' - function (\)(L::FactorComponent{T,:PtL}, B::$T) where T - F = Factor(L) - ($f)(CHOLMOD_L, F, ($f)(CHOLMOD_P, F, B)) # Confusingly, CHOLMOD_P solves P'x = b - end - function (\)(L::FactorComponent{T,:UP}, B::$T) where T - F = Factor(L) - ($f)(CHOLMOD_Pt, F, ($f)(CHOLMOD_Lt, F, B)) - end - # Solve various equations for A = L*D*L' and A = P*L*D*L'*P' - function (\)(L::FactorComponent{T,:D}, B::$T) where T - ($f)(CHOLMOD_D, Factor(L), B) - end - function (\)(L::FactorComponent{T,:LD}, B::$T) where T - ($f)(CHOLMOD_LD, Factor(L), B) - end - function (\)(L::FactorComponent{T,:DU}, B::$T) where T - ($f)(CHOLMOD_DLt, Factor(L), B) - end - function (\)(L::FactorComponent{T,:PtLD}, B::$T) where T - F = Factor(L) - ($f)(CHOLMOD_LD, F, ($f)(CHOLMOD_P, F, B)) - end - function (\)(L::FactorComponent{T,:DUP}, B::$T) where T - F = Factor(L) - ($f)(CHOLMOD_Pt, F, ($f)(CHOLMOD_DLt, F, B)) - end - end -end - -SparseVecOrMat{Tv,Ti} = Union{SparseVector{Tv,Ti}, SparseMatrixCSC{Tv,Ti}} - -function (\)(L::FactorComponent, b::Vector) - reshape(Matrix(L\Dense(b)), length(b)) -end -function (\)(L::FactorComponent, B::Matrix) - Matrix(L\Dense(B)) -end -function (\)(L::FactorComponent, B::SparseVecOrMat) - sparse(L\Sparse(B,0)) -end -(\)(L::FactorComponent, B::Adjoint{<:Any,<:SparseMatrixCSC}) = L \ copy(B) -(\)(L::FactorComponent, B::Transpose{<:Any,<:SparseMatrixCSC}) = L \ copy(B) - -\(adjL::Adjoint{<:Any,<:FactorComponent}, B::Union{VecOrMat,SparseVecOrMat}) = (L = adjL.parent; adjoint(L)\B) - -(\)(L::Factor{T}, B::Dense{T}) where {T<:VTypes} = solve(CHOLMOD_A, L, B) -# Explicit typevars are necessary to avoid ambiguities with defs in linalg/factorizations.jl -# Likewise the two following explicit Vector and Matrix defs (rather than a single VecOrMat) -(\)(L::Factor{T}, B::Vector{Complex{T}}) where {T<:Float64} = complex.(L\real(B), L\imag(B)) -(\)(L::Factor{T}, B::Matrix{Complex{T}}) where {T<:Float64} = complex.(L\real(B), L\imag(B)) -(\)(L::Factor{T}, B::Adjoint{<:Any, <:Matrix{Complex{T}}}) where {T<:Float64} = complex.(L\real(B), L\imag(B)) -(\)(L::Factor{T}, B::Transpose{<:Any, <:Matrix{Complex{T}}}) where {T<:Float64} = complex.(L\real(B), L\imag(B)) - -(\)(L::Factor{T}, b::StridedVector) where {T<:VTypes} = Vector(L\Dense{T}(b)) -(\)(L::Factor{T}, B::StridedMatrix) where {T<:VTypes} = Matrix(L\Dense{T}(B)) -(\)(L::Factor{T}, B::Adjoint{<:Any, <:StridedMatrix}) where {T<:VTypes} = Matrix(L\Dense{T}(B)) -(\)(L::Factor{T}, B::Transpose{<:Any, <:StridedMatrix}) where {T<:VTypes} = Matrix(L\Dense{T}(B)) - -(\)(L::Factor, B::Sparse) = spsolve(CHOLMOD_A, L, B) -# When right hand side is sparse, we have to ensure that the rhs is not marked as symmetric. -(\)(L::Factor, B::SparseMatrixCSC) = sparse(spsolve(CHOLMOD_A, L, Sparse(B, 0))) -(\)(L::Factor, B::Adjoint{<:Any,<:SparseMatrixCSC}) = L \ copy(B) -(\)(L::Factor, B::Transpose{<:Any,<:SparseMatrixCSC}) = L \ copy(B) -(\)(L::Factor, B::SparseVector) = sparse(spsolve(CHOLMOD_A, L, Sparse(B))) - -\(adjL::Adjoint{<:Any,<:Factor}, B::Dense) = (L = adjL.parent; solve(CHOLMOD_A, L, B)) -\(adjL::Adjoint{<:Any,<:Factor}, B::Sparse) = (L = adjL.parent; spsolve(CHOLMOD_A, L, B)) -\(adjL::Adjoint{<:Any,<:Factor}, B::SparseVecOrMat) = (L = adjL.parent; \(adjoint(L), Sparse(B))) - -function \(adjL::Adjoint{<:Any,<:Factor}, b::StridedVector) - L = adjL.parent - return Vector(solve(CHOLMOD_A, L, Dense(b))) -end -function \(adjL::Adjoint{<:Any,<:Factor}, B::StridedMatrix) - L = adjL.parent - return Matrix(solve(CHOLMOD_A, L, Dense(B))) -end - -const RealHermSymComplexHermF64SSL = Union{ - Symmetric{Float64,SparseMatrixCSC{Float64,SuiteSparse_long}}, - Hermitian{Float64,SparseMatrixCSC{Float64,SuiteSparse_long}}, - Hermitian{ComplexF64,SparseMatrixCSC{ComplexF64,SuiteSparse_long}}} -const StridedVecOrMatInclAdjAndTrans = Union{StridedVecOrMat, Adjoint{<:Any, <:StridedVecOrMat}, Transpose{<:Any, <:StridedVecOrMat}} -function \(A::RealHermSymComplexHermF64SSL, B::StridedVecOrMatInclAdjAndTrans) - F = cholesky(A; check = false) - if issuccess(F) - return \(F, B) - else - ldlt!(F, A; check = false) - if issuccess(F) - return \(F, B) - else - return \(lu(SparseMatrixCSC{eltype(A), SuiteSparse_long}(A)), B) - end - end -end -function \(adjA::Adjoint{<:Any,<:RealHermSymComplexHermF64SSL}, B::StridedVecOrMatInclAdjAndTrans) - A = adjA.parent - F = cholesky(A; check = false) - if issuccess(F) - return \(adjoint(F), B) - else - ldlt!(F, A; check = false) - if issuccess(F) - return \(adjoint(F), B) - else - return \(adjoint(lu(SparseMatrixCSC{eltype(A), SuiteSparse_long}(A))), B) - end - end -end - -## Other convenience methods -function diag(F::Factor{Tv}) where Tv - f = unsafe_load(pointer(F)) - fsuper = f.super - fpi = f.pi - res = Base.zeros(Tv, Int(f.n)) - xv = f.x - if f.is_super!=0 - px = f.px - pos = 1 - for i in 1:f.nsuper - base = unsafe_load(px, i) + 1 - res[pos] = unsafe_load(xv, base) - pos += 1 - for j in 1:unsafe_load(fsuper, i + 1) - unsafe_load(fsuper, i) - 1 - res[pos] = unsafe_load(xv, base + j*(unsafe_load(fpi, i + 1) - - unsafe_load(fpi, i) + 1)) - pos += 1 - end - end - else - c0 = f.p - r0 = f.i - xv = f.x - for j in 1:f.n - jj = unsafe_load(c0, j) + 1 - @assert(unsafe_load(r0, jj) == j - 1) - res[j] = unsafe_load(xv, jj) - end - end - res -end - -function logdet(F::Factor{Tv}) where Tv<:VTypes - f = unsafe_load(pointer(F)) - res = zero(Tv) - for d in diag(F); res += log(abs(d)) end - f.is_ll != 0 ? 2res : res -end - -det(L::Factor) = exp(logdet(L)) - -function issuccess(F::Factor) - s = unsafe_load(pointer(F)) - return s.minor == size(F, 1) -end - -function isposdef(F::Factor) - if issuccess(F) - s = unsafe_load(pointer(F)) - if s.is_ll == 1 - return true - else - # try conversion to LLt - change_factor!(F, true, s.is_super, true, s.is_monotonic) - b = issuccess(F) - # convert back - change_factor!(F, false, s.is_super, true, s.is_monotonic) - return b - end - else - return false - end -end - -function ishermitian(A::Sparse{Float64}) - s = unsafe_load(pointer(A)) - if s.stype != 0 - return true - else - i = symmetry(A, 1)[1] - if i < 0 - throw(CHOLMODException("negative value returned from CHOLMOD's symmetry function. This - is either because the indices are not sorted or because of a memory error")) - end - return i == MM_SYMMETRIC || i == MM_SYMMETRIC_POSDIAG - end -end -function ishermitian(A::Sparse{ComplexF64}) - s = unsafe_load(pointer(A)) - if s.stype != 0 - return true - else - i = symmetry(A, 1)[1] - if i < 0 - throw(CHOLMODException("negative value returned from CHOLMOD's symmetry function. This - is either because the indices are not sorted or because of a memory error")) - end - return i == MM_HERMITIAN || i == MM_HERMITIAN_POSDIAG - end -end - -(*)(A::Symmetric{Float64,SparseMatrixCSC{Float64,Ti}}, - B::SparseVecOrMat{Float64,Ti}) where {Ti} = sparse(Sparse(A)*Sparse(B)) -(*)(A::Hermitian{ComplexF64,SparseMatrixCSC{ComplexF64,Ti}}, - B::SparseVecOrMat{ComplexF64,Ti}) where {Ti} = sparse(Sparse(A)*Sparse(B)) -(*)(A::Hermitian{Float64,SparseMatrixCSC{Float64,Ti}}, - B::SparseVecOrMat{Float64,Ti}) where {Ti} = sparse(Sparse(A)*Sparse(B)) - -(*)(A::SparseVecOrMat{Float64,Ti}, - B::Symmetric{Float64,SparseMatrixCSC{Float64,Ti}}) where {Ti} = sparse(Sparse(A)*Sparse(B)) -(*)(A::SparseVecOrMat{ComplexF64,Ti}, - B::Hermitian{ComplexF64,SparseMatrixCSC{ComplexF64,Ti}}) where {Ti} = sparse(Sparse(A)*Sparse(B)) -(*)(A::SparseVecOrMat{Float64,Ti}, - B::Hermitian{Float64,SparseMatrixCSC{Float64,Ti}}) where {Ti} = sparse(Sparse(A)*Sparse(B)) - -# Sort all the indices in each column for the construction of a CSC sparse matrix -function _sort_buffers!(m, n, colptr::Vector{Ti}, rowval::Vector{Ti}, nzval::Vector{Tv}) where {Ti <: Integer, Tv} - index = Base.zeros(Ti, m) - row = Base.zeros(Ti, m) - val = Base.zeros(Tv, m) - - perm = Base.Perm(Base.ord(isless, identity, false, Base.Order.Forward), row) - - @inbounds for i = 1:n - nzr = colptr[i]:colptr[i+1]-1 - numrows = length(nzr) - if numrows <= 1 - continue - elseif numrows == 2 - f = first(nzr) - s = f+1 - if rowval[f] > rowval[s] - rowval[f], rowval[s] = rowval[s], rowval[f] - nzval[f], nzval[s] = nzval[s], nzval[f] - end - continue - end - resize!(row, numrows) - resize!(index, numrows) - - jj = 1 - @simd for j = nzr - row[jj] = rowval[j] - val[jj] = nzval[j] - jj += 1 - end - - if numrows <= 16 - alg = Base.Sort.InsertionSort - else - alg = Base.Sort.QuickSort - end - - # Reset permutation - index .= 1:numrows - - Base.sort!(index, alg, perm) - - jj = 1 - @simd for j = nzr - rowval[j] = row[index[jj]] - nzval[j] = val[index[jj]] - jj += 1 - end - end -end - - -end #module diff --git a/stdlib/SuiteSparse/src/cholmod_h.jl b/stdlib/SuiteSparse/src/cholmod_h.jl deleted file mode 100644 index 0528b736ba9e75..00000000000000 --- a/stdlib/SuiteSparse/src/cholmod_h.jl +++ /dev/null @@ -1,80 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -## CHOLMOD -const TRUE = Int32(1) -const FALSE = Int32(0) - -## itype defines the types of integer used: -const INT = Int32(0) # all integer arrays are int -const INTLONG = Int32(1) # most are int, some are SuiteSparse_long -const LONG = Int32(2) # all integer arrays are SuiteSparse_long - -## dtype defines what the numerical type is (double or float): -const DOUBLE = Int32(0) # all numerical values are double -const SINGLE = Int32(1) # all numerical values are float -dtyp(::Type{Float32}) = SINGLE -dtyp(::Type{Float64}) = DOUBLE -dtyp(::Type{ComplexF32}) = SINGLE -dtyp(::Type{ComplexF64}) = DOUBLE - -## xtype defines the kind of numerical values used: -const PATTERN = Int32(0) # pattern only, no numerical values -const REAL = Int32(1) # a real matrix -const COMPLEX = Int32(2) # a complex matrix (ANSI C99 compatible) -const ZOMPLEX = Int32(3) # a complex matrix (MATLAB compatible) -xtyp(::Type{Float32}) = REAL -xtyp(::Type{Float64}) = REAL -xtyp(::Type{ComplexF32}) = COMPLEX -xtyp(::Type{ComplexF64}) = COMPLEX - -## Scaling modes, selected by the scale input parameter: -const SCALAR = Int32(0) # A = s*A -const ROW = Int32(1) # A = diag(s)*A -const COL = Int32(2) # A = A*diag(s) -const SYM = Int32(3) # A = diag(s)*A*diag(s) - -## Types of systems to solve -const CHOLMOD_A = Int32(0) # solve Ax=b -const CHOLMOD_LDLt = Int32(1) # solve LDL'x=b -const CHOLMOD_LD = Int32(2) # solve LDx=b -const CHOLMOD_DLt = Int32(3) # solve DL'x=b -const CHOLMOD_L = Int32(4) # solve Lx=b -const CHOLMOD_Lt = Int32(5) # solve L'x=b -const CHOLMOD_D = Int32(6) # solve Dx=b -const CHOLMOD_P = Int32(7) # permute x=Px -const CHOLMOD_Pt = Int32(8) # permute x=P'x - -# Symmetry types -const EMPTY =-1 -const MM_RECTANGULAR = 1 -const MM_UNSYMMETRIC = 2 -const MM_SYMMETRIC = 3 -const MM_HERMITIAN = 4 -const MM_SKEW_SYMMETRIC = 5 -const MM_SYMMETRIC_POSDIAG = 6 -const MM_HERMITIAN_POSDIAG = 7 - -# check the size of SuiteSparse_long -if Int(ccall((:jl_cholmod_sizeof_long, :libsuitesparse_wrapper),Csize_t,())) == 4 - const SuiteSparse_long = Int32 - const IndexTypes = (:Int32,) - const ITypes = Union{Int32} -else - const SuiteSparse_long = Int64 - const IndexTypes = (:Int32, :Int64) - const ITypes = Union{Int32, Int64} -end -ityp(::Type{SuiteSparse_long}) = LONG - - -const VTypes = Union{ComplexF64, Float64} -const VRealTypes = Union{Float64} - -struct CHOLMODException <: Exception - msg::String -end - -function error_handler(status::Cint, file::Cstring, line::Cint, message::Cstring)::Cvoid - status < 0 && throw(CHOLMODException(unsafe_string(message))) - nothing -end diff --git a/stdlib/SuiteSparse/src/deprecated.jl b/stdlib/SuiteSparse/src/deprecated.jl deleted file mode 100644 index ee28d60dc44066..00000000000000 --- a/stdlib/SuiteSparse/src/deprecated.jl +++ /dev/null @@ -1 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license diff --git a/stdlib/SuiteSparse/src/spqr.jl b/stdlib/SuiteSparse/src/spqr.jl deleted file mode 100644 index 0cb0d470fc897c..00000000000000 --- a/stdlib/SuiteSparse/src/spqr.jl +++ /dev/null @@ -1,416 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -module SPQR - -import Base: \ -using Base: require_one_based_indexing -using LinearAlgebra - -# ordering options */ -const ORDERING_FIXED = Int32(0) -const ORDERING_NATURAL = Int32(1) -const ORDERING_COLAMD = Int32(2) -const ORDERING_GIVEN = Int32(3) # only used for C/C++ interface -const ORDERING_CHOLMOD = Int32(4) # CHOLMOD best-effort (COLAMD, METIS,...) -const ORDERING_AMD = Int32(5) # AMD(A'*A) -const ORDERING_METIS = Int32(6) # metis(A'*A) -const ORDERING_DEFAULT = Int32(7) # SuiteSparseQR default ordering -const ORDERING_BEST = Int32(8) # try COLAMD, AMD, and METIS; pick best -const ORDERING_BESTAMD = Int32(9) # try COLAMD and AMD; pick best# -const ORDERINGS = [ORDERING_FIXED, ORDERING_NATURAL, ORDERING_COLAMD, ORDERING_CHOLMOD, - ORDERING_AMD, ORDERING_METIS, ORDERING_DEFAULT, ORDERING_BEST, - ORDERING_BESTAMD] - -# Let [m n] = size of the matrix after pruning singletons. The default -# ordering strategy is to use COLAMD if m <= 2*n. Otherwise, AMD(A'A) is -# tried. If there is a high fill-in with AMD then try METIS(A'A) and take -# the best of AMD and METIS. METIS is not tried if it isn't installed. - -using SparseArrays -using SparseArrays: getcolptr -using ..SuiteSparse.CHOLMOD -using ..SuiteSparse.CHOLMOD: change_stype!, free! - -function _qr!(ordering::Integer, tol::Real, econ::Integer, getCTX::Integer, - A::Sparse{Tv}, - Bsparse::Union{Sparse{Tv} , Ptr{Cvoid}} = C_NULL, - Bdense::Union{Dense{Tv} , Ptr{Cvoid}} = C_NULL, - Zsparse::Union{Ref{Ptr{CHOLMOD.C_Sparse{Tv}}} , Ptr{Cvoid}} = C_NULL, - Zdense::Union{Ref{Ptr{CHOLMOD.C_Dense{Tv}}} , Ptr{Cvoid}} = C_NULL, - R::Union{Ref{Ptr{CHOLMOD.C_Sparse{Tv}}} , Ptr{Cvoid}} = C_NULL, - E::Union{Ref{Ptr{CHOLMOD.SuiteSparse_long}} , Ptr{Cvoid}} = C_NULL, - H::Union{Ref{Ptr{CHOLMOD.C_Sparse{Tv}}} , Ptr{Cvoid}} = C_NULL, - HPinv::Union{Ref{Ptr{CHOLMOD.SuiteSparse_long}}, Ptr{Cvoid}} = C_NULL, - HTau::Union{Ref{Ptr{CHOLMOD.C_Dense{Tv}}} , Ptr{Cvoid}} = C_NULL) where {Tv<:CHOLMOD.VTypes} - - ordering ∈ ORDERINGS || error("unknown ordering $ordering") - - AA = unsafe_load(pointer(A)) - m, n = AA.nrow, AA.ncol - rnk = ccall((:SuiteSparseQR_C, :libspqr), CHOLMOD.SuiteSparse_long, - (Cint, Cdouble, CHOLMOD.SuiteSparse_long, Cint, - Ptr{CHOLMOD.C_Sparse{Tv}}, Ptr{CHOLMOD.C_Sparse{Tv}}, Ptr{CHOLMOD.C_Dense{Tv}}, - Ptr{Ptr{CHOLMOD.C_Sparse{Tv}}}, Ptr{Ptr{CHOLMOD.C_Dense{Tv}}}, Ptr{Ptr{CHOLMOD.C_Sparse{Tv}}}, - Ptr{Ptr{CHOLMOD.SuiteSparse_long}}, Ptr{Ptr{CHOLMOD.C_Sparse{Tv}}}, Ptr{Ptr{CHOLMOD.SuiteSparse_long}}, - Ptr{Ptr{CHOLMOD.C_Dense{Tv}}}, Ptr{CHOLMOD.Common}), - ordering, # all, except 3:given treated as 0:fixed - tol, # columns with 2-norm <= tol treated as 0 - econ, # e = max(min(m,econ),rank(A)) - getCTX, # 0: Z=C (e-by-k), 1: Z=C', 2: Z=X (e-by-k) - A, # m-by-n sparse matrix to factorize - Bsparse, # sparse m-by-k B - Bdense, # dense m-by-k B - # /* outputs: */ - Zsparse, # sparse Z - Zdense, # dense Z - R, # e-by-n sparse matrix */ - E, # size n column perm, NULL if identity */ - H, # m-by-nh Householder vectors - HPinv, # size m row permutation - HTau, # 1-by-nh Householder coefficients - CHOLMOD.common[Threads.threadid()]) # /* workspace and parameters */ - - if rnk < 0 - error("Sparse QR factorization failed") - end - - e = E[] - if e == C_NULL - _E = Vector{CHOLMOD.SuiteSparse_long}() - else - _E = Vector{CHOLMOD.SuiteSparse_long}(undef, n) - for i in 1:n - @inbounds _E[i] = unsafe_load(e, i) + 1 - end - # Free memory allocated by SPQR. This call will make sure that the - # correct deallocator function is called and that the memory count in - # the common struct is updated - ccall((:cholmod_l_free, :libcholmod), Cvoid, - (Csize_t, Cint, Ptr{CHOLMOD.SuiteSparse_long}, Ptr{CHOLMOD.Common}), - n, sizeof(CHOLMOD.SuiteSparse_long), e, CHOLMOD.common[Threads.threadid()]) - end - hpinv = HPinv[] - if hpinv == C_NULL - _HPinv = Vector{CHOLMOD.SuiteSparse_long}() - else - _HPinv = Vector{CHOLMOD.SuiteSparse_long}(undef, m) - for i in 1:m - @inbounds _HPinv[i] = unsafe_load(hpinv, i) + 1 - end - # Free memory allocated by SPQR. This call will make sure that the - # correct deallocator function is called and that the memory count in - # the common struct is updated - ccall((:cholmod_l_free, :libcholmod), Cvoid, - (Csize_t, Cint, Ptr{CHOLMOD.SuiteSparse_long}, Ptr{CHOLMOD.Common}), - m, sizeof(CHOLMOD.SuiteSparse_long), hpinv, CHOLMOD.common[Threads.threadid()]) - end - - return rnk, _E, _HPinv -end - -# Struct for storing sparse QR from SPQR such that -# A[invperm(rpivinv), cpiv] = (I - factors[:,1]*τ[1]*factors[:,1]')*...*(I - factors[:,k]*τ[k]*factors[:,k]')*R -# with k = size(factors, 2). -struct QRSparse{Tv,Ti} <: LinearAlgebra.Factorization{Tv} - factors::SparseMatrixCSC{Tv,Ti} - τ::Vector{Tv} - R::SparseMatrixCSC{Tv,Ti} - cpiv::Vector{Ti} - rpivinv::Vector{Ti} -end - -Base.size(F::QRSparse) = (size(F.factors, 1), size(F.R, 2)) -function Base.size(F::QRSparse, i::Integer) - if i == 1 - return size(F.factors, 1) - elseif i == 2 - return size(F.R, 2) - elseif i > 2 - return 1 - else - throw(ArgumentError("second argument must be positive")) - end -end -Base.axes(F::QRSparse) = map(Base.OneTo, size(F)) - -struct QRSparseQ{Tv<:CHOLMOD.VTypes,Ti<:Integer} <: LinearAlgebra.AbstractQ{Tv} - factors::SparseMatrixCSC{Tv,Ti} - τ::Vector{Tv} - n::Int # Number of columns in original matrix -end - -Base.size(Q::QRSparseQ) = (size(Q.factors, 1), size(Q.factors, 1)) -Base.axes(Q::QRSparseQ) = map(Base.OneTo, size(Q)) - -Matrix{T}(Q::QRSparseQ) where {T} = lmul!(Q, Matrix{T}(I, size(Q, 1), min(size(Q, 1), Q.n))) - -# From SPQR manual p. 6 -_default_tol(A::SparseMatrixCSC) = - 20*sum(size(A))*eps(real(eltype(A)))*maximum(norm(view(A, :, i)) for i in 1:size(A, 2)) - -""" - qr(A::SparseMatrixCSC; tol=_default_tol(A), ordering=ORDERING_DEFAULT) -> QRSparse - -Compute the `QR` factorization of a sparse matrix `A`. Fill-reducing row and column permutations -are used such that `F.R = F.Q'*A[F.prow,F.pcol]`. The main application of this type is to -solve least squares or underdetermined problems with [`\\`](@ref). The function calls the C library SPQR. - -!!! note - `qr(A::SparseMatrixCSC)` uses the SPQR library that is part of SuiteSparse. - As this library only supports sparse matrices with [`Float64`](@ref) or - `ComplexF64` elements, as of Julia v1.4 `qr` converts `A` into a copy that is - of type `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` as appropriate. - -# Examples -```jldoctest -julia> A = sparse([1,2,3,4], [1,1,2,2], [1.0,1.0,1.0,1.0]) -4×2 SparseMatrixCSC{Float64, Int64} with 4 stored entries: - 1.0 ⋅ - 1.0 ⋅ - ⋅ 1.0 - ⋅ 1.0 - -julia> qr(A) -SuiteSparse.SPQR.QRSparse{Float64, Int64} -Q factor: -4×4 SuiteSparse.SPQR.QRSparseQ{Float64, Int64}: - -0.707107 0.0 0.0 -0.707107 - 0.0 -0.707107 -0.707107 0.0 - 0.0 -0.707107 0.707107 0.0 - -0.707107 0.0 0.0 0.707107 -R factor: -2×2 SparseMatrixCSC{Float64, Int64} with 2 stored entries: - -1.41421 ⋅ - ⋅ -1.41421 -Row permutation: -4-element Vector{Int64}: - 1 - 3 - 4 - 2 -Column permutation: -2-element Vector{Int64}: - 1 - 2 -``` -""" -function LinearAlgebra.qr(A::SparseMatrixCSC{Tv}; tol=_default_tol(A), ordering=ORDERING_DEFAULT) where {Tv <: CHOLMOD.VTypes} - R = Ref{Ptr{CHOLMOD.C_Sparse{Tv}}}() - E = Ref{Ptr{CHOLMOD.SuiteSparse_long}}() - H = Ref{Ptr{CHOLMOD.C_Sparse{Tv}}}() - HPinv = Ref{Ptr{CHOLMOD.SuiteSparse_long}}() - HTau = Ref{Ptr{CHOLMOD.C_Dense{Tv}}}(C_NULL) - - # SPQR doesn't accept symmetric matrices so we explicitly set the stype - r, p, hpinv = _qr!(ordering, tol, 0, 0, Sparse(A, 0), - C_NULL, C_NULL, C_NULL, C_NULL, - R, E, H, HPinv, HTau) - - R_ = SparseMatrixCSC(Sparse(R[])) - return QRSparse(SparseMatrixCSC(Sparse(H[])), - vec(Array(CHOLMOD.Dense(HTau[]))), - SparseMatrixCSC(min(size(A)...), - size(R_, 2), - getcolptr(R_), - rowvals(R_), - nonzeros(R_)), - p, hpinv) -end -LinearAlgebra.qr(A::SparseMatrixCSC{<:Union{Float16,Float32}}; tol=_default_tol(A)) = - qr(convert(SparseMatrixCSC{Float64}, A); tol=tol) -LinearAlgebra.qr(A::SparseMatrixCSC{<:Union{ComplexF16,ComplexF32}}; tol=_default_tol(A)) = - qr(convert(SparseMatrixCSC{ComplexF64}, A); tol=tol) -LinearAlgebra.qr(A::Union{SparseMatrixCSC{T},SparseMatrixCSC{Complex{T}}}; - tol=_default_tol(A)) where {T<:AbstractFloat} = - throw(ArgumentError(string("matrix type ", typeof(A), "not supported. ", - "Try qr(convert(SparseMatrixCSC{Float64/ComplexF64, Int}, A)) for ", - "sparse floating point QR using SPQR or qr(Array(A)) for generic ", - "dense QR."))) -LinearAlgebra.qr(A::SparseMatrixCSC; tol=_default_tol(A)) = qr(float(A); tol=tol) - -function LinearAlgebra.lmul!(Q::QRSparseQ, A::StridedVecOrMat) - if size(A, 1) != size(Q, 1) - throw(DimensionMismatch("size(Q) = $(size(Q)) but size(A) = $(size(A))")) - end - for l in size(Q.factors, 2):-1:1 - τl = -Q.τ[l] - h = view(Q.factors, :, l) - for j in 1:size(A, 2) - a = view(A, :, j) - LinearAlgebra.axpy!(τl*dot(h, a), h, a) - end - end - return A -end - -function LinearAlgebra.rmul!(A::StridedMatrix, Q::QRSparseQ) - if size(A, 2) != size(Q, 1) - throw(DimensionMismatch("size(Q) = $(size(Q)) but size(A) = $(size(A))")) - end - tmp = similar(A, size(A, 1)) - for l in 1:size(Q.factors, 2) - τl = -Q.τ[l] - h = view(Q.factors, :, l) - LinearAlgebra.mul!(tmp, A, h) - LinearAlgebra.lowrankupdate!(A, tmp, h, τl) - end - return A -end - -function LinearAlgebra.lmul!(adjQ::Adjoint{<:Any,<:QRSparseQ}, A::StridedVecOrMat) - Q = adjQ.parent - if size(A, 1) != size(Q, 1) - throw(DimensionMismatch("size(Q) = $(size(Q)) but size(A) = $(size(A))")) - end - for l in 1:size(Q.factors, 2) - τl = -Q.τ[l] - h = view(Q.factors, :, l) - for j in 1:size(A, 2) - a = view(A, :, j) - LinearAlgebra.axpy!(τl'*dot(h, a), h, a) - end - end - return A -end - -function LinearAlgebra.rmul!(A::StridedMatrix, adjQ::Adjoint{<:Any,<:QRSparseQ}) - Q = adjQ.parent - if size(A, 2) != size(Q, 1) - throw(DimensionMismatch("size(Q) = $(size(Q)) but size(A) = $(size(A))")) - end - tmp = similar(A, size(A, 1)) - for l in size(Q.factors, 2):-1:1 - τl = -Q.τ[l] - h = view(Q.factors, :, l) - LinearAlgebra.mul!(tmp, A, h) - LinearAlgebra.lowrankupdate!(A, tmp, h, τl') - end - return A -end - -@inline function Base.getproperty(F::QRSparse, d::Symbol) - if d === :Q - return QRSparseQ(F.factors, F.τ, size(F, 2)) - elseif d === :prow - return invperm(F.rpivinv) - elseif d === :pcol - return F.cpiv - else - getfield(F, d) - end -end - -function Base.propertynames(F::QRSparse, private::Bool=false) - public = (:R, :Q, :prow, :pcol) - private ? ((public ∪ fieldnames(typeof(F)))...,) : public -end - -function Base.show(io::IO, mime::MIME{Symbol("text/plain")}, F::QRSparse) - summary(io, F); println(io) - println(io, "Q factor:") - show(io, mime, F.Q) - println(io, "\nR factor:") - show(io, mime, F.R) - println(io, "\nRow permutation:") - show(io, mime, F.prow) - println(io, "\nColumn permutation:") - show(io, mime, F.pcol) -end - -# With a real lhs and complex rhs with the same precision, we can reinterpret -# the complex rhs as a real rhs with twice the number of columns -# -# This definition is similar to the definition in factorization.jl except that -# here we have to use \ instead of ldiv! because of limitations in SPQR - -## Two helper methods -_ret_size(F::QRSparse, b::AbstractVector) = (size(F, 2),) -_ret_size(F::QRSparse, B::AbstractMatrix) = (size(F, 2), size(B, 2)) - -LinearAlgebra.rank(F::QRSparse) = reduce(max, view(rowvals(F.R), 1:nnz(F.R)), init = eltype(rowvals(F.R))(0)) -LinearAlgebra.rank(S::SparseMatrixCSC) = rank(qr(S)) - -function (\)(F::QRSparse{T}, B::VecOrMat{Complex{T}}) where T<:LinearAlgebra.BlasReal -# |z1|z3| reinterpret |x1|x2|x3|x4| transpose |x1|y1| reshape |x1|y1|x3|y3| -# |z2|z4| -> |y1|y2|y3|y4| -> |x2|y2| -> |x2|y2|x4|y4| -# |x3|y3| -# |x4|y4| - require_one_based_indexing(F, B) - c2r = reshape(copy(transpose(reinterpret(T, reshape(B, (1, length(B)))))), size(B, 1), 2*size(B, 2)) - x = F\c2r - -# |z1|z3| reinterpret |x1|x2|x3|x4| transpose |x1|y1| reshape |x1|y1|x3|y3| -# |z2|z4| <- |y1|y2|y3|y4| <- |x2|y2| <- |x2|y2|x4|y4| -# |x3|y3| -# |x4|y4| - return collect(reshape(reinterpret(Complex{T}, copy(transpose(reshape(x, (length(x) >> 1), 2)))), _ret_size(F, B))) -end - -function _ldiv_basic(F::QRSparse, B::StridedVecOrMat) - if size(F, 1) != size(B, 1) - throw(DimensionMismatch("size(F) = $(size(F)) but size(B) = $(size(B))")) - end - - # The rank of F equal might be reduced - rnk = rank(F) - - # allocate an array for the return value large enough to hold B and X - # For overdetermined problem, B is larger than X and vice versa - X = similar(B, ntuple(i -> i == 1 ? max(size(F, 2), size(B, 1)) : size(B, 2), Val(ndims(B)))) - - # Fill will zeros. These will eventually become the zeros in the basic solution - # fill!(X, 0) - # Apply left permutation to the solution and store in X - for j in 1:size(B, 2) - for i in 1:length(F.rpivinv) - @inbounds X[F.rpivinv[i], j] = B[i, j] - end - end - - # Make a view into X corresponding to the size of B - X0 = view(X, 1:size(B, 1), :) - - # Apply Q' to B - LinearAlgebra.lmul!(adjoint(F.Q), X0) - - # Zero out to get basic solution - X[rnk + 1:end, :] .= 0 - - # Solve R*X = B - LinearAlgebra.ldiv!(UpperTriangular(F.R[Base.OneTo(rnk), Base.OneTo(rnk)]), - view(X0, Base.OneTo(rnk), :)) - - # Apply right permutation and extract solution from X - # NB: cpiv == [] if SPQR was called with ORDERING_FIXED - if length(F.cpiv) == 0 - return getindex(X, ntuple(i -> i == 1 ? (1:size(F,2)) : :, Val(ndims(B)))...) - end - return getindex(X, ntuple(i -> i == 1 ? invperm(F.cpiv) : :, Val(ndims(B)))...) -end - -(\)(F::QRSparse{T}, B::StridedVecOrMat{T}) where {T} = _ldiv_basic(F, B) -""" - (\\)(F::QRSparse, B::StridedVecOrMat) - -Solve the least squares problem ``\\min\\|Ax - b\\|^2`` or the linear system of equations -``Ax=b`` when `F` is the sparse QR factorization of ``A``. A basic solution is returned -when the problem is underdetermined. - -# Examples -```jldoctest -julia> A = sparse([1,2,4], [1,1,1], [1.0,1.0,1.0], 4, 2) -4×2 SparseMatrixCSC{Float64, Int64} with 3 stored entries: - 1.0 ⋅ - 1.0 ⋅ - ⋅ ⋅ - 1.0 ⋅ - -julia> qr(A)\\fill(1.0, 4) -2-element Vector{Float64}: - 1.0 - 0.0 -``` -""" -(\)(F::QRSparse, B::StridedVecOrMat) = F\convert(AbstractArray{eltype(F)}, B) - -end # module diff --git a/stdlib/SuiteSparse/src/umfpack.jl b/stdlib/SuiteSparse/src/umfpack.jl deleted file mode 100644 index 61cb2a035a5b9c..00000000000000 --- a/stdlib/SuiteSparse/src/umfpack.jl +++ /dev/null @@ -1,833 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -module UMFPACK - -export UmfpackLU - -import Base: (\), getproperty, show, size -using LinearAlgebra -import LinearAlgebra: Factorization, checksquare, det, logabsdet, lu, lu!, ldiv! - -using SparseArrays -using SparseArrays: getcolptr -import SparseArrays: nnz - -import Serialization: AbstractSerializer, deserialize - -import ..increment, ..increment!, ..decrement, ..decrement! - -include("umfpack_h.jl") -struct MatrixIllConditionedException <: Exception - msg::String -end - -function umferror(status::Integer) - if status==UMFPACK_OK - return - elseif status==UMFPACK_WARNING_singular_matrix - throw(LinearAlgebra.SingularException(0)) - elseif status==UMFPACK_WARNING_determinant_underflow - throw(MatrixIllConditionedException("the determinant is nonzero but underflowed")) - elseif status==UMFPACK_WARNING_determinant_overflow - throw(MatrixIllConditionedException("the determinant overflowed")) - elseif status==UMFPACK_ERROR_out_of_memory - throw(OutOfMemoryError()) - elseif status==UMFPACK_ERROR_invalid_Numeric_object - throw(ArgumentError("invalid UMFPack numeric object")) - elseif status==UMFPACK_ERROR_invalid_Symbolic_object - throw(ArgumentError("invalid UMFPack symbolic object")) - elseif status==UMFPACK_ERROR_argument_missing - throw(ArgumentError("a required argument to UMFPack is missing")) - elseif status==UMFPACK_ERROR_n_nonpositive - throw(ArgumentError("the number of rows or columns of the matrix must be greater than zero")) - elseif status==UMFPACK_ERROR_invalid_matrix - throw(ArgumentError("invalid matrix")) - elseif status==UMFPACK_ERROR_different_pattern - throw(ArgumentError("pattern of the matrix changed")) - elseif status==UMFPACK_ERROR_invalid_system - throw(ArgumentError("invalid sys argument provided to UMFPack solver")) - elseif status==UMFPACK_ERROR_invalid_permutation - throw(ArgumentError("invalid permutation")) - elseif status==UMFPACK_ERROR_file_IO - throw(ErrorException("error saving / loading UMFPack decomposition")) - elseif status==UMFPACK_ERROR_ordering_failed - throw(ErrorException("the ordering method failed")) - elseif status==UMFPACK_ERROR_internal_error - throw(ErrorException("an internal error has occurred, of unknown cause")) - else - throw(ErrorException("unknown UMFPack error code: $status")) - end -end - -macro isok(A) - :(umferror($(esc(A)))) -end - -# check the size of SuiteSparse_long -if Int(ccall((:jl_cholmod_sizeof_long,:libsuitesparse_wrapper),Csize_t,())) == 4 - const UmfpackIndexTypes = (:Int32,) - const UMFITypes = Int32 -else - const UmfpackIndexTypes = (:Int32, :Int64) - const UMFITypes = Union{Int32, Int64} -end - -const UMFVTypes = Union{Float64,ComplexF64} - -## UMFPACK - -# the control and info arrays -const umf_ctrl = Vector{Float64}(undef, UMFPACK_CONTROL) -ccall((:umfpack_dl_defaults,:libumfpack), Cvoid, (Ptr{Float64},), umf_ctrl) -const umf_info = Vector{Float64}(undef, UMFPACK_INFO) - -function show_umf_ctrl(level::Real = 2.0) - old_prt::Float64 = umf_ctrl[1] - umf_ctrl[1] = Float64(level) - ccall((:umfpack_dl_report_control, :libumfpack), Cvoid, (Ptr{Float64},), umf_ctrl) - umf_ctrl[1] = old_prt -end - -function show_umf_info(level::Real = 2.0) - old_prt::Float64 = umf_ctrl[1] - umf_ctrl[1] = Float64(level) - ccall((:umfpack_dl_report_info, :libumfpack), Cvoid, - (Ptr{Float64}, Ptr{Float64}), umf_ctrl, umf_info) - umf_ctrl[1] = old_prt -end - -## Should this type be immutable? -mutable struct UmfpackLU{Tv<:UMFVTypes,Ti<:UMFITypes} <: Factorization{Tv} - symbolic::Ptr{Cvoid} - numeric::Ptr{Cvoid} - m::Int - n::Int - colptr::Vector{Ti} # 0-based column pointers - rowval::Vector{Ti} # 0-based row indices - nzval::Vector{Tv} - status::Int -end - -Base.adjoint(F::UmfpackLU) = Adjoint(F) -Base.transpose(F::UmfpackLU) = Transpose(F) - -""" - lu(A::SparseMatrixCSC; check = true) -> F::UmfpackLU - -Compute the LU factorization of a sparse matrix `A`. - -For sparse `A` with real or complex element type, the return type of `F` is -`UmfpackLU{Tv, Ti}`, with `Tv` = [`Float64`](@ref) or `ComplexF64` respectively and -`Ti` is an integer type ([`Int32`](@ref) or [`Int64`](@ref)). - -When `check = true`, an error is thrown if the decomposition fails. -When `check = false`, responsibility for checking the decomposition's -validity (via [`issuccess`](@ref)) lies with the user. - -The individual components of the factorization `F` can be accessed by indexing: - -| Component | Description | -|:----------|:------------------------------------| -| `L` | `L` (lower triangular) part of `LU` | -| `U` | `U` (upper triangular) part of `LU` | -| `p` | right permutation `Vector` | -| `q` | left permutation `Vector` | -| `Rs` | `Vector` of scaling factors | -| `:` | `(L,U,p,q,Rs)` components | - -The relation between `F` and `A` is - -`F.L*F.U == (F.Rs .* A)[F.p, F.q]` - -`F` further supports the following functions: - -- [`\\`](@ref) -- [`cond`](@ref) -- [`det`](@ref) - -!!! note - `lu(A::SparseMatrixCSC)` uses the UMFPACK library that is part of - SuiteSparse. As this library only supports sparse matrices with [`Float64`](@ref) or - `ComplexF64` elements, `lu` converts `A` into a copy that is of type - `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` as appropriate. -""" -function lu(S::SparseMatrixCSC{<:UMFVTypes,<:UMFITypes}; check::Bool = true) - zerobased = getcolptr(S)[1] == 0 - res = UmfpackLU(C_NULL, C_NULL, size(S, 1), size(S, 2), - zerobased ? copy(getcolptr(S)) : decrement(getcolptr(S)), - zerobased ? copy(rowvals(S)) : decrement(rowvals(S)), - copy(nonzeros(S)), 0) - finalizer(umfpack_free_symbolic, res) - umfpack_numeric!(res) - check && (issuccess(res) || throw(LinearAlgebra.SingularException(0))) - return res -end -lu(A::SparseMatrixCSC{<:Union{Float16,Float32},Ti}; - check::Bool = true) where {Ti<:UMFITypes} = - lu(convert(SparseMatrixCSC{Float64,Ti}, A); check = check) -lu(A::SparseMatrixCSC{<:Union{ComplexF16,ComplexF32},Ti}; - check::Bool = true) where {Ti<:UMFITypes} = - lu(convert(SparseMatrixCSC{ComplexF64,Ti}, A); check = check) -lu(A::Union{SparseMatrixCSC{T},SparseMatrixCSC{Complex{T}}}; - check::Bool = true) where {T<:AbstractFloat} = - throw(ArgumentError(string("matrix type ", typeof(A), "not supported. ", - "Try lu(convert(SparseMatrixCSC{Float64/ComplexF64,Int}, A)) for ", - "sparse floating point LU using UMFPACK or lu(Array(A)) for generic ", - "dense LU."))) -lu(A::SparseMatrixCSC; check::Bool = true) = lu(float(A); check = check) - -""" - lu!(F::UmfpackLU, A::SparseMatrixCSC; check=true) -> F::UmfpackLU - -Compute the LU factorization of a sparse matrix `A`, reusing the symbolic -factorization of an already existing LU factorization stored in `F`. The -sparse matrix `A` must have an identical nonzero pattern as the matrix used -to create the LU factorization `F`, otherwise an error is thrown. - -When `check = true`, an error is thrown if the decomposition fails. -When `check = false`, responsibility for checking the decomposition's -validity (via [`issuccess`](@ref)) lies with the user. - -!!! note - `lu!(F::UmfpackLU, A::SparseMatrixCSC)` uses the UMFPACK library that is part of - SuiteSparse. As this library only supports sparse matrices with [`Float64`](@ref) or - `ComplexF64` elements, `lu!` converts `A` into a copy that is of type - `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` as appropriate. - -!!! compat "Julia 1.5" - `lu!` for `UmfpackLU` requires at least Julia 1.5. - -# Examples -```jldoctest -julia> A = sparse(Float64[1.0 2.0; 0.0 3.0]); - -julia> F = lu(A); - -julia> B = sparse(Float64[1.0 1.0; 0.0 1.0]); - -julia> lu!(F, B); - -julia> F \\ ones(2) -2-element Vector{Float64}: - 0.0 - 1.0 -``` -""" -function lu!(F::UmfpackLU, S::SparseMatrixCSC{<:UMFVTypes,<:UMFITypes}; check::Bool=true) - zerobased = getcolptr(S)[1] == 0 - F.m = size(S, 1) - F.n = size(S, 2) - F.colptr = zerobased ? copy(getcolptr(S)) : decrement(getcolptr(S)) - F.rowval = zerobased ? copy(rowvals(S)) : decrement(rowvals(S)) - F.nzval = copy(nonzeros(S)) - - umfpack_numeric!(F, reuse_numeric = false) - check && (issuccess(F) || throw(LinearAlgebra.SingularException(0))) - return F -end -lu!(F::UmfpackLU, A::SparseMatrixCSC{<:Union{Float16,Float32},Ti}; - check::Bool = true) where {Ti<:UMFITypes} = - lu!(F, convert(SparseMatrixCSC{Float64,Ti}, A); check = check) -lu!(F::UmfpackLU, A::SparseMatrixCSC{<:Union{ComplexF16,ComplexF32},Ti}; - check::Bool = true) where {Ti<:UMFITypes} = - lu!(F, convert(SparseMatrixCSC{ComplexF64,Ti}, A); check = check) -lu!(F::UmfpackLU, A::Union{SparseMatrixCSC{T},SparseMatrixCSC{Complex{T}}}; - check::Bool = true) where {T<:AbstractFloat} = - throw(ArgumentError(string("matrix type ", typeof(A), "not supported."))) -lu!(F::UmfpackLU, A::SparseMatrixCSC; check::Bool = true) = lu!(F, float(A); check = check) - -size(F::UmfpackLU) = (F.m, F.n) -function size(F::UmfpackLU, dim::Integer) - if dim < 1 - throw(ArgumentError("size: dimension $dim out of range")) - elseif dim == 1 - return Int(F.m) - elseif dim == 2 - return Int(F.n) - else - return 1 - end -end - -function show(io::IO, mime::MIME{Symbol("text/plain")}, F::UmfpackLU) - if F.numeric != C_NULL - if issuccess(F) - summary(io, F); println(io) - println(io, "L factor:") - show(io, mime, F.L) - println(io, "\nU factor:") - show(io, mime, F.U) - else - print(io, "Failed factorization of type $(typeof(F))") - end - end -end - -function deserialize(s::AbstractSerializer, t::Type{UmfpackLU{Tv,Ti}}) where {Tv,Ti} - symbolic = deserialize(s) - numeric = deserialize(s) - m = deserialize(s) - n = deserialize(s) - colptr = deserialize(s) - rowval = deserialize(s) - nzval = deserialize(s) - status = deserialize(s) - obj = UmfpackLU{Tv,Ti}(symbolic, numeric, m, n, colptr, rowval, nzval, status) - - finalizer(umfpack_free_symbolic, obj) - - return obj -end - -# compute the sign/parity of a permutation -function _signperm(p) - n = length(p) - result = 0 - todo = trues(n) - while any(todo) - k = findfirst(todo) - todo[k] = false - result += 1 # increment element count - j = p[k] - while j != k - result += 1 # increment element count - todo[j] = false - j = p[j] - end - result += 1 # increment cycle count - end - return ifelse(isodd(result), -1, 1) -end - -## Wrappers for UMFPACK functions - -# generate the name of the C function according to the value and integer types -umf_nm(nm,Tv,Ti) = "umfpack_" * (Tv === :Float64 ? "d" : "z") * (Ti === :Int64 ? "l_" : "i_") * nm - -for itype in UmfpackIndexTypes - sym_r = umf_nm("symbolic", :Float64, itype) - sym_c = umf_nm("symbolic", :ComplexF64, itype) - num_r = umf_nm("numeric", :Float64, itype) - num_c = umf_nm("numeric", :ComplexF64, itype) - sol_r = umf_nm("solve", :Float64, itype) - sol_c = umf_nm("solve", :ComplexF64, itype) - det_r = umf_nm("get_determinant", :Float64, itype) - det_z = umf_nm("get_determinant", :ComplexF64, itype) - lunz_r = umf_nm("get_lunz", :Float64, itype) - lunz_z = umf_nm("get_lunz", :ComplexF64, itype) - get_num_r = umf_nm("get_numeric", :Float64, itype) - get_num_z = umf_nm("get_numeric", :ComplexF64, itype) - @eval begin - function umfpack_symbolic!(U::UmfpackLU{Float64,$itype}) - if U.symbolic != C_NULL return U end - tmp = Vector{Ptr{Cvoid}}(undef, 1) - @isok ccall(($sym_r, :libumfpack), $itype, - ($itype, $itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Cvoid}, - Ptr{Float64}, Ptr{Float64}), - U.m, U.n, U.colptr, U.rowval, U.nzval, tmp, - umf_ctrl, umf_info) - U.symbolic = tmp[1] - return U - end - function umfpack_symbolic!(U::UmfpackLU{ComplexF64,$itype}) - if U.symbolic != C_NULL return U end - tmp = Vector{Ptr{Cvoid}}(undef, 1) - @isok ccall(($sym_c, :libumfpack), $itype, - ($itype, $itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, Ptr{Cvoid}, - Ptr{Float64}, Ptr{Float64}), - U.m, U.n, U.colptr, U.rowval, real(U.nzval), imag(U.nzval), tmp, - umf_ctrl, umf_info) - U.symbolic = tmp[1] - return U - end - function umfpack_numeric!(U::UmfpackLU{Float64,$itype}; reuse_numeric = true) - if (reuse_numeric && U.numeric != C_NULL) return U end - if U.symbolic == C_NULL umfpack_symbolic!(U) end - tmp = Vector{Ptr{Cvoid}}(undef, 1) - status = ccall(($num_r, :libumfpack), $itype, - (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Float64}, Ptr{Float64}), - U.colptr, U.rowval, U.nzval, U.symbolic, tmp, - umf_ctrl, umf_info) - U.status = status - if status != UMFPACK_WARNING_singular_matrix - umferror(status) - end - U.numeric != C_NULL && umfpack_free_numeric(U) - U.numeric = tmp[1] - return U - end - function umfpack_numeric!(U::UmfpackLU{ComplexF64,$itype}; reuse_numeric = true) - if (reuse_numeric && U.numeric != C_NULL) return U end - if U.symbolic == C_NULL umfpack_symbolic!(U) end - tmp = Vector{Ptr{Cvoid}}(undef, 1) - status = ccall(($num_c, :libumfpack), $itype, - (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Float64}, Ptr{Float64}), - U.colptr, U.rowval, real(U.nzval), imag(U.nzval), U.symbolic, tmp, - umf_ctrl, umf_info) - U.status = status - if status != UMFPACK_WARNING_singular_matrix - umferror(status) - end - U.numeric != C_NULL && umfpack_free_numeric(U) - U.numeric = tmp[1] - return U - end - function solve!(x::StridedVector{Float64}, lu::UmfpackLU{Float64,$itype}, b::StridedVector{Float64}, typ::Integer) - if x === b - throw(ArgumentError("output array must not be aliased with input array")) - end - if stride(x, 1) != 1 || stride(b, 1) != 1 - throw(ArgumentError("in and output vectors must have unit strides")) - end - umfpack_numeric!(lu) - (size(b,1) == lu.m) && (size(b) == size(x)) || throw(DimensionMismatch()) - @isok ccall(($sol_r, :libumfpack), $itype, - ($itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, - Ptr{Float64}, Ptr{Float64}, Ptr{Cvoid}, Ptr{Float64}, - Ptr{Float64}), - typ, lu.colptr, lu.rowval, lu.nzval, - x, b, lu.numeric, umf_ctrl, - umf_info) - return x - end - function solve!(x::StridedVector{ComplexF64}, lu::UmfpackLU{ComplexF64,$itype}, b::StridedVector{ComplexF64}, typ::Integer) - if x === b - throw(ArgumentError("output array must not be aliased with input array")) - end - if stride(x, 1) != 1 || stride(b, 1) != 1 - throw(ArgumentError("in and output vectors must have unit strides")) - end - umfpack_numeric!(lu) - (size(b, 1) == lu.m) && (size(b) == size(x)) || throw(DimensionMismatch()) - n = size(b, 1) - @isok ccall(($sol_c, :libumfpack), $itype, - ($itype, Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, - Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, - Ptr{Float64}, Ptr{Cvoid}, Ptr{Float64}, Ptr{Float64}), - typ, lu.colptr, lu.rowval, lu.nzval, - C_NULL, x, C_NULL, b, - C_NULL, lu.numeric, umf_ctrl, umf_info) - return x - end - function det(lu::UmfpackLU{Float64,$itype}) - mx = Ref{Float64}() - @isok ccall(($det_r,:libumfpack), $itype, - (Ptr{Float64},Ptr{Float64},Ptr{Cvoid},Ptr{Float64}), - mx, C_NULL, lu.numeric, umf_info) - mx[] - end - function det(lu::UmfpackLU{ComplexF64,$itype}) - mx = Ref{Float64}() - mz = Ref{Float64}() - @isok ccall(($det_z,:libumfpack), $itype, - (Ptr{Float64},Ptr{Float64},Ptr{Float64},Ptr{Cvoid},Ptr{Float64}), - mx, mz, C_NULL, lu.numeric, umf_info) - complex(mx[], mz[]) - end - function logabsdet(F::UmfpackLU{T, $itype}) where {T<:Union{Float64,ComplexF64}} # return log(abs(det)) and sign(det) - n = checksquare(F) - issuccess(F) || return log(zero(real(T))), zero(T) - U = F.U - Rs = F.Rs - p = F.p - q = F.q - s = _signperm(p)*_signperm(q)*one(real(T)) - P = one(T) - abs_det = zero(real(T)) - @inbounds for i in 1:n - dg_ii = U[i, i] / Rs[i] - P *= sign(dg_ii) - abs_det += log(abs(dg_ii)) - end - return abs_det, s * P - end - function umf_lunz(lu::UmfpackLU{Float64,$itype}) - lnz = Ref{$itype}() - unz = Ref{$itype}() - n_row = Ref{$itype}() - n_col = Ref{$itype}() - nz_diag = Ref{$itype}() - @isok ccall(($lunz_r,:libumfpack), $itype, - (Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{Cvoid}), - lnz, unz, n_row, n_col, nz_diag, lu.numeric) - (lnz[], unz[], n_row[], n_col[], nz_diag[]) - end - function umf_lunz(lu::UmfpackLU{ComplexF64,$itype}) - lnz = Ref{$itype}() - unz = Ref{$itype}() - n_row = Ref{$itype}() - n_col = Ref{$itype}() - nz_diag = Ref{$itype}() - @isok ccall(($lunz_z,:libumfpack), $itype, - (Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{$itype},Ptr{Cvoid}), - lnz, unz, n_row, n_col, nz_diag, lu.numeric) - (lnz[], unz[], n_row[], n_col[], nz_diag[]) - end - function getproperty(lu::UmfpackLU{Float64, $itype}, d::Symbol) - if d === :L - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Lp = Vector{$itype}(undef, n_row + 1) - # L is returned in CSR (compressed sparse row) format - Lj = Vector{$itype}(undef, lnz) - Lx = Vector{Float64}(undef, lnz) - @isok ccall(($get_num_r, :libumfpack), $itype, - (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), - Lp, Lj, Lx, - C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, lu.numeric) - return copy(transpose(SparseMatrixCSC(min(n_row, n_col), n_row, - increment!(Lp), increment!(Lj), Lx))) - elseif d === :U - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Up = Vector{$itype}(undef, n_col + 1) - Ui = Vector{$itype}(undef, unz) - Ux = Vector{Float64}(undef, unz) - @isok ccall(($get_num_r, :libumfpack), $itype, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), - C_NULL, C_NULL, C_NULL, - Up, Ui, Ux, - C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, lu.numeric) - return SparseMatrixCSC(min(n_row, n_col), n_col, increment!(Up), - increment!(Ui), Ux) - elseif d === :p - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - P = Vector{$itype}(undef, n_row) - @isok ccall(($get_num_r, :libumfpack), $itype, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{$itype}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), - C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, - P, C_NULL, C_NULL, - C_NULL, C_NULL, lu.numeric) - return increment!(P) - elseif d === :q - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Q = Vector{$itype}(undef, n_col) - @isok ccall(($get_num_r, :libumfpack), $itype, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{$itype}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), - C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, - C_NULL, Q, C_NULL, - C_NULL, C_NULL, lu.numeric) - return increment!(Q) - elseif d === :Rs - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Rs = Vector{Float64}(undef, n_row) - @isok ccall(($get_num_r, :libumfpack), $itype, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Float64}, Ptr{Cvoid}), - C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, - C_NULL, Rs, lu.numeric) - return Rs - elseif d === :(:) - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Lp = Vector{$itype}(undef, n_row + 1) - # L is returned in CSR (compressed sparse row) format - Lj = Vector{$itype}(undef, lnz) - Lx = Vector{Float64}(undef, lnz) - Up = Vector{$itype}(undef, n_col + 1) - Ui = Vector{$itype}(undef, unz) - Ux = Vector{Float64}(undef, unz) - P = Vector{$itype}(undef, n_row) - Q = Vector{$itype}(undef, n_col) - Rs = Vector{Float64}(undef, n_row) - @isok ccall(($get_num_r, :libumfpack), $itype, - (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, - Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, - Ptr{$itype}, Ptr{$itype}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Float64}, Ptr{Cvoid}), - Lp, Lj, Lx, - Up, Ui, Ux, - P, Q, C_NULL, - C_NULL, Rs, lu.numeric) - return (copy(transpose(SparseMatrixCSC(min(n_row, n_col), n_row, - increment!(Lp), increment!(Lj), - Lx))), - SparseMatrixCSC(min(n_row, n_col), n_col, increment!(Up), - increment!(Ui), Ux), - increment!(P), increment!(Q), Rs) - else - return getfield(lu, d) - end - end - function getproperty(lu::UmfpackLU{ComplexF64, $itype}, d::Symbol) - if d === :L - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Lp = Vector{$itype}(undef, n_row + 1) - # L is returned in CSR (compressed sparse row) format - Lj = Vector{$itype}(undef, lnz) - Lx = Vector{Float64}(undef, lnz) - Lz = Vector{Float64}(undef, lnz) - @isok ccall(($get_num_z, :libumfpack), $itype, - (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), - Lp, Lj, Lx, Lz, - C_NULL, C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, lu.numeric) - return copy(transpose(SparseMatrixCSC(min(n_row, n_col), n_row, - increment!(Lp), increment!(Lj), - complex.(Lx, Lz)))) - elseif d === :U - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Up = Vector{$itype}(undef, n_col + 1) - Ui = Vector{$itype}(undef, unz) - Ux = Vector{Float64}(undef, unz) - Uz = Vector{Float64}(undef, unz) - @isok ccall(($get_num_z, :libumfpack), $itype, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), - C_NULL, C_NULL, C_NULL, C_NULL, - Up, Ui, Ux, Uz, - C_NULL, C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, lu.numeric) - return SparseMatrixCSC(min(n_row, n_col), n_col, increment!(Up), - increment!(Ui), complex.(Ux, Uz)) - elseif d === :p - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - P = Vector{$itype}(undef, n_row) - @isok ccall(($get_num_z, :libumfpack), $itype, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{$itype}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Float64}, Ptr{Cvoid}), - C_NULL, C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, C_NULL, - P, C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, lu.numeric) - return increment!(P) - elseif d === :q - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Q = Vector{$itype}(undef, n_col) - @isok ccall(($get_num_z, :libumfpack), $itype, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{$itype}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), - C_NULL, C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, C_NULL, - C_NULL, Q, C_NULL, C_NULL, - C_NULL, C_NULL, lu.numeric) - return increment!(Q) - elseif d === :Rs - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Rs = Vector{Float64}(undef, n_row) - @isok ccall(($get_num_z, :libumfpack), $itype, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Float64}, Ptr{Cvoid}), - C_NULL, C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, C_NULL, - C_NULL, C_NULL, C_NULL, C_NULL, - C_NULL, Rs, lu.numeric) - return Rs - elseif d === :(:) - umfpack_numeric!(lu) # ensure the numeric decomposition exists - (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) - Lp = Vector{$itype}(undef, n_row + 1) - # L is returned in CSR (compressed sparse row) format - Lj = Vector{$itype}(undef, lnz) - Lx = Vector{Float64}(undef, lnz) - Lz = Vector{Float64}(undef, lnz) - Up = Vector{$itype}(undef, n_col + 1) - Ui = Vector{$itype}(undef, unz) - Ux = Vector{Float64}(undef, unz) - Uz = Vector{Float64}(undef, unz) - P = Vector{$itype}(undef, n_row) - Q = Vector{$itype}(undef, n_col) - Rs = Vector{Float64}(undef, n_row) - @isok ccall(($get_num_z, :libumfpack), $itype, - (Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, - Ptr{$itype}, Ptr{$itype}, Ptr{Float64}, Ptr{Float64}, - Ptr{$itype}, Ptr{$itype}, Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cvoid}, Ptr{Float64}, Ptr{Cvoid}), - Lp, Lj, Lx, Lz, - Up, Ui, Ux, Uz, - P, Q, C_NULL, C_NULL, - C_NULL, Rs, lu.numeric) - return (copy(transpose(SparseMatrixCSC(min(n_row, n_col), n_row, - increment!(Lp), increment!(Lj), - complex.(Lx, Lz)))), - SparseMatrixCSC(min(n_row, n_col), n_col, increment!(Up), - increment!(Ui), complex.(Ux, Uz)), - increment!(P), increment!(Q), Rs) - else - return getfield(lu, d) - end - end - end -end - -# backward compatibility -umfpack_extract(lu::UmfpackLU) = getproperty(lu, :(:)) - -function nnz(lu::UmfpackLU) - lnz, unz, = umf_lunz(lu) - return Int(lnz + unz) -end - -LinearAlgebra.issuccess(lu::UmfpackLU) = lu.status == UMFPACK_OK - -### Solve with Factorization - -import LinearAlgebra.ldiv! - -ldiv!(lu::UmfpackLU{T}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} = - ldiv!(B, lu, copy(B)) -ldiv!(translu::Transpose{T,<:UmfpackLU{T}}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} = - (lu = translu.parent; ldiv!(B, transpose(lu), copy(B))) -ldiv!(adjlu::Adjoint{T,<:UmfpackLU{T}}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} = - (lu = adjlu.parent; ldiv!(B, adjoint(lu), copy(B))) -ldiv!(lu::UmfpackLU{Float64}, B::StridedVecOrMat{<:Complex}) = - ldiv!(B, lu, copy(B)) -ldiv!(translu::Transpose{Float64,<:UmfpackLU{Float64}}, B::StridedVecOrMat{<:Complex}) = - (lu = translu.parent; ldiv!(B, transpose(lu), copy(B))) -ldiv!(adjlu::Adjoint{Float64,<:UmfpackLU{Float64}}, B::StridedVecOrMat{<:Complex}) = - (lu = adjlu.parent; ldiv!(B, adjoint(lu), copy(B))) - -ldiv!(X::StridedVecOrMat{T}, lu::UmfpackLU{T}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} = - _Aq_ldiv_B!(X, lu, B, UMFPACK_A) -ldiv!(X::StridedVecOrMat{T}, translu::Transpose{T,<:UmfpackLU{T}}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} = - (lu = translu.parent; _Aq_ldiv_B!(X, lu, B, UMFPACK_Aat)) -ldiv!(X::StridedVecOrMat{T}, adjlu::Adjoint{T,<:UmfpackLU{T}}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} = - (lu = adjlu.parent; _Aq_ldiv_B!(X, lu, B, UMFPACK_At)) -ldiv!(X::StridedVecOrMat{Tb}, lu::UmfpackLU{Float64}, B::StridedVecOrMat{Tb}) where {Tb<:Complex} = - _Aq_ldiv_B!(X, lu, B, UMFPACK_A) -ldiv!(X::StridedVecOrMat{Tb}, translu::Transpose{Float64,<:UmfpackLU{Float64}}, B::StridedVecOrMat{Tb}) where {Tb<:Complex} = - (lu = translu.parent; _Aq_ldiv_B!(X, lu, B, UMFPACK_Aat)) -ldiv!(X::StridedVecOrMat{Tb}, adjlu::Adjoint{Float64,<:UmfpackLU{Float64}}, B::StridedVecOrMat{Tb}) where {Tb<:Complex} = - (lu = adjlu.parent; _Aq_ldiv_B!(X, lu, B, UMFPACK_At)) - -function _Aq_ldiv_B!(X::StridedVecOrMat, lu::UmfpackLU, B::StridedVecOrMat, transposeoptype) - if size(X, 2) != size(B, 2) - throw(DimensionMismatch("input and output arrays must have same number of columns")) - end - _AqldivB_kernel!(X, lu, B, transposeoptype) - return X -end -function _AqldivB_kernel!(x::StridedVector{T}, lu::UmfpackLU{T}, - b::StridedVector{T}, transposeoptype) where T<:UMFVTypes - solve!(x, lu, b, transposeoptype) -end -function _AqldivB_kernel!(X::StridedMatrix{T}, lu::UmfpackLU{T}, - B::StridedMatrix{T}, transposeoptype) where T<:UMFVTypes - for col in 1:size(X, 2) - solve!(view(X, :, col), lu, view(B, :, col), transposeoptype) - end -end -function _AqldivB_kernel!(x::StridedVector{Tb}, lu::UmfpackLU{Float64}, - b::StridedVector{Tb}, transposeoptype) where Tb<:Complex - r, i = similar(b, Float64), similar(b, Float64) - solve!(r, lu, Vector{Float64}(real(b)), transposeoptype) - solve!(i, lu, Vector{Float64}(imag(b)), transposeoptype) - map!(complex, x, r, i) -end -function _AqldivB_kernel!(X::StridedMatrix{Tb}, lu::UmfpackLU{Float64}, - B::StridedMatrix{Tb}, transposeoptype) where Tb<:Complex - r = similar(B, Float64, size(B, 1)) - i = similar(B, Float64, size(B, 1)) - for j in 1:size(B, 2) - solve!(r, lu, Vector{Float64}(real(view(B, :, j))), transposeoptype) - solve!(i, lu, Vector{Float64}(imag(view(B, :, j))), transposeoptype) - map!(complex, view(X, :, j), r, i) - end -end - -for Tv in (:Float64, :ComplexF64), Ti in UmfpackIndexTypes - f = Symbol(umf_nm("free_symbolic", Tv, Ti)) - @eval begin - function ($f)(symb::Ptr{Cvoid}) - tmp = [symb] - ccall(($(string(f)), :libumfpack), Cvoid, (Ptr{Cvoid},), tmp) - end - - function umfpack_free_symbolic(lu::UmfpackLU{$Tv,$Ti}) - if lu.symbolic == C_NULL return lu end - umfpack_free_numeric(lu) - ($f)(lu.symbolic) - lu.symbolic = C_NULL - return lu - end - end - - f = Symbol(umf_nm("free_numeric", Tv, Ti)) - @eval begin - function ($f)(num::Ptr{Cvoid}) - tmp = [num] - ccall(($(string(f)), :libumfpack), Cvoid, (Ptr{Cvoid},), tmp) - end - function umfpack_free_numeric(lu::UmfpackLU{$Tv,$Ti}) - if lu.numeric == C_NULL return lu end - ($f)(lu.numeric) - lu.numeric = C_NULL - return lu - end - end -end - -function umfpack_report_symbolic(symb::Ptr{Cvoid}, level::Real) - old_prl::Float64 = umf_ctrl[UMFPACK_PRL] - umf_ctrl[UMFPACK_PRL] = Float64(level) - @isok ccall((:umfpack_dl_report_symbolic, :libumfpack), Int, - (Ptr{Cvoid}, Ptr{Float64}), symb, umf_ctrl) - umf_ctrl[UMFPACK_PRL] = old_prl -end - -umfpack_report_symbolic(symb::Ptr{Cvoid}) = umfpack_report_symbolic(symb, 4.) - -function umfpack_report_symbolic(lu::UmfpackLU, level::Real) - umfpack_report_symbolic(umfpack_symbolic!(lu).symbolic, level) -end - -umfpack_report_symbolic(lu::UmfpackLU) = umfpack_report_symbolic(lu.symbolic,4.) -function umfpack_report_numeric(num::Ptr{Cvoid}, level::Real) - old_prl::Float64 = umf_ctrl[UMFPACK_PRL] - umf_ctrl[UMFPACK_PRL] = Float64(level) - @isok ccall((:umfpack_dl_report_numeric, :libumfpack), Int, - (Ptr{Cvoid}, Ptr{Float64}), num, umf_ctrl) - umf_ctrl[UMFPACK_PRL] = old_prl -end - -umfpack_report_numeric(num::Ptr{Cvoid}) = umfpack_report_numeric(num, 4.) -function umfpack_report_numeric(lu::UmfpackLU, level::Real) - umfpack_report_numeric(umfpack_numeric!(lu).numeric, level) -end - -umfpack_report_numeric(lu::UmfpackLU) = umfpack_report_numeric(lu,4.) - -end # UMFPACK module diff --git a/stdlib/SuiteSparse/src/umfpack_h.jl b/stdlib/SuiteSparse/src/umfpack_h.jl deleted file mode 100644 index 985f9387fcc756..00000000000000 --- a/stdlib/SuiteSparse/src/umfpack_h.jl +++ /dev/null @@ -1,43 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -## UMFPACK - -## Type of solve -const UMFPACK_A = 0 # Ax=b -const UMFPACK_At = 1 # adjoint(A)x=b -const UMFPACK_Aat = 2 # transpose(A)x=b -const UMFPACK_Pt_L = 3 # adjoint(P)Lx=b -const UMFPACK_L = 4 # Lx=b -const UMFPACK_Lt_P = 5 # adjoint(L)Px=b -const UMFPACK_Lat_P = 6 # transpose(L)Px=b -const UMFPACK_Lt = 7 # adjoint(L)x=b -const UMFPACK_Lat = 8 # transpose(L)x=b -const UMFPACK_U_Qt = 9 # U*adjoint(Q)x=b -const UMFPACK_U = 10 # Ux=b -const UMFPACK_Q_Ut = 11 # Q*adjoint(U)x=b -const UMFPACK_Q_Uat = 12 # Q*transpose(U)x=b -const UMFPACK_Ut = 13 # adjoint(U)x=b -const UMFPACK_Uat = 14 # transpose(U)x=b - -## Sizes of Control and Info arrays for returning information from solver -const UMFPACK_INFO = 90 -const UMFPACK_CONTROL = 20 -const UMFPACK_PRL = 1 - -## Status codes -const UMFPACK_OK = 0 -const UMFPACK_WARNING_singular_matrix = 1 -const UMFPACK_WARNING_determinant_underflow = 2 -const UMFPACK_WARNING_determinant_overflow = 3 -const UMFPACK_ERROR_out_of_memory = -1 -const UMFPACK_ERROR_invalid_Numeric_object = -3 -const UMFPACK_ERROR_invalid_Symbolic_object = -4 -const UMFPACK_ERROR_argument_missing = -5 -const UMFPACK_ERROR_n_nonpositive = -6 -const UMFPACK_ERROR_invalid_matrix = -8 -const UMFPACK_ERROR_different_pattern = -11 -const UMFPACK_ERROR_invalid_system = -13 -const UMFPACK_ERROR_invalid_permutation = -15 -const UMFPACK_ERROR_internal_error = -911 -const UMFPACK_ERROR_file_IO = -17 -const UMFPACK_ERROR_ordering_failed = -18 diff --git a/stdlib/SuiteSparse/test/cholmod.jl b/stdlib/SuiteSparse/test/cholmod.jl deleted file mode 100644 index 8e2fb231587f1b..00000000000000 --- a/stdlib/SuiteSparse/test/cholmod.jl +++ /dev/null @@ -1,945 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -using SuiteSparse.CHOLMOD -using SuiteSparse -using DelimitedFiles -using Test -using Random -using Serialization -using LinearAlgebra: - I, cholesky, cholesky!, det, diag, eigmax, ishermitian, isposdef, issuccess, - issymmetric, ldlt, ldlt!, logdet, norm, opnorm, Diagonal, Hermitian, Symmetric, - PosDefException, ZeroPivotException -using SparseArrays -using SparseArrays: getcolptr - -# CHOLMOD tests -Random.seed!(123) - -@testset "Check that the Common and Method Julia structs are consistent with their C counterparts" begin - common_size = ccall((:jl_cholmod_common_size, :libsuitesparse_wrapper), Csize_t, ()) - @test common_size == sizeof(CHOLMOD.Common) - - method_offsets = Vector{Csize_t}(undef,15) - ccall((:jl_cholmod_method_offsets, :libsuitesparse_wrapper), - Nothing, (Ptr{Csize_t},), method_offsets) - @test method_offsets == fieldoffset.(CHOLMOD.Method,1:length(method_offsets)) - - common_offsets = Vector{Csize_t}(undef,107) - ccall((:jl_cholmod_common_offsets, :libsuitesparse_wrapper), - Nothing, (Ptr{Csize_t},), common_offsets) - @test common_offsets == fieldoffset.(CHOLMOD.Common,1:length(common_offsets)) -end - -@testset "based on deps/SuiteSparse-4.0.2/CHOLMOD/Demo/" begin - -# chm_rdsp(joinpath(Sys.BINDIR, "../../deps/SuiteSparse-4.0.2/CHOLMOD/Demo/Matrix/bcsstk01.tri")) -# because the file may not exist in binary distributions and when a system suitesparse library -# is used - -## Result from C program -## ---------------------------------- cholmod_demo: -## norm (A,inf) = 3.57095e+09 -## norm (A,1) = 3.57095e+09 -## CHOLMOD sparse: A: 48-by-48, nz 224, upper. OK -## CHOLMOD dense: B: 48-by-1, OK -## bnorm 1.97917 -## Analyze: flop 6009 lnz 489 -## Factorizing A -## CHOLMOD factor: L: 48-by-48 simplicial, LDL'. nzmax 489. nz 489 OK -## Ordering: AMD fl/lnz 12.3 lnz/anz 2.2 -## ints in L: 782, doubles in L: 489 -## factor flops 6009 nnz(L) 489 (w/no amalgamation) -## nnz(A*A'): 224 -## flops / nnz(L): 12.3 -## nnz(L) / nnz(A): 2.2 -## analyze cputime: 0.0000 -## factor cputime: 0.0000 mflop: 0.0 -## solve cputime: 0.0000 mflop: 0.0 -## overall cputime: 0.0000 mflop: 0.0 -## peak memory usage: 0 (MB) -## residual 2.5e-19 (|Ax-b|/(|A||x|+|b|)) -## residual 1.3e-19 (|Ax-b|/(|A||x|+|b|)) after iterative refinement -## rcond 9.5e-06 - - n = 48 - A = CHOLMOD.Sparse(n, n, - CHOLMOD.SuiteSparse_long[0,1,2,3,6,9,12,15,18,20,25,30,34,36,39,43,47,52,58, - 62,67,71,77,84,90,93,95,98,103,106,110,115,119,123,130,136,142,146,150,155, - 161,167,174,182,189,197,207,215,224], # zero-based column pointers - CHOLMOD.SuiteSparse_long[0,1,2,1,2,3,0,2,4,0,1,5,0,4,6,1,3,7,2,8,1,3,7,8,9, - 0,4,6,8,10,5,6,7,11,6,12,7,11,13,8,10,13,14,9,13,14,15,8,10,12,14,16,7,11, - 12,13,16,17,0,12,16,18,1,5,13,15,19,2,4,14,20,3,13,15,19,20,21,2,4,12,16,18, - 20,22,1,5,17,18,19,23,0,5,24,1,25,2,3,26,2,3,25,26,27,4,24,28,0,5,24,29,6, - 11,24,28,30,7,25,27,31,8,9,26,32,8,9,25,27,31,32,33,10,24,28,30,32,34,6,11, - 29,30,31,35,12,17,30,36,13,31,35,37,14,15,32,34,38,14,15,33,37,38,39,16,32, - 34,36,38,40,12,17,31,35,36,37,41,12,16,17,18,23,36,40,42,13,14,15,19,37,39, - 43,13,14,15,20,21,38,43,44,13,14,15,20,21,37,39,43,44,45,12,16,17,22,36,40, - 42,46,12,16,17,18,23,41,42,46,47], - [2.83226851852e6,1.63544753086e6,1.72436728395e6,-2.0e6,-2.08333333333e6, - 1.00333333333e9,1.0e6,-2.77777777778e6,1.0675e9,2.08333333333e6, - 5.55555555555e6,1.53533333333e9,-3333.33333333,-1.0e6,2.83226851852e6, - -6666.66666667,2.0e6,1.63544753086e6,-1.68e6,1.72436728395e6,-2.0e6,4.0e8, - 2.0e6,-2.08333333333e6,1.00333333333e9,1.0e6,2.0e8,-1.0e6,-2.77777777778e6, - 1.0675e9,-2.0e6,2.08333333333e6,5.55555555555e6,1.53533333333e9,-2.8e6, - 2.8360994695e6,-30864.1975309,-5.55555555555e6,1.76741074446e6, - -15432.0987654,2.77777777778e6,517922.131816,3.89003806848e6, - -3.33333333333e6,4.29857058902e6,-2.6349902747e6,1.97572063531e9, - -2.77777777778e6,3.33333333333e8,-2.14928529451e6,2.77777777778e6, - 1.52734651547e9,5.55555555555e6,6.66666666667e8,2.35916180402e6, - -5.55555555555e6,-1.09779731332e8,1.56411143711e9,-2.8e6,-3333.33333333, - 1.0e6,2.83226851852e6,-30864.1975309,-5.55555555555e6,-6666.66666667, - -2.0e6,1.63544753086e6,-15432.0987654,2.77777777778e6,-1.68e6, - 1.72436728395e6,-3.33333333333e6,2.0e6,4.0e8,-2.0e6,-2.08333333333e6, - 1.00333333333e9,-2.77777777778e6,3.33333333333e8,-1.0e6,2.0e8,1.0e6, - 2.77777777778e6,1.0675e9,5.55555555555e6,6.66666666667e8,-2.0e6, - 2.08333333333e6,-5.55555555555e6,1.53533333333e9,-28935.1851852, - -2.08333333333e6,60879.6296296,-1.59791666667e6,3.37291666667e6, - -28935.1851852,2.08333333333e6,2.41171296296e6,-2.08333333333e6, - 1.0e8,-2.5e6,-416666.666667,1.5e9,-833333.333333,1.25e6,5.01833333333e8, - 2.08333333333e6,1.0e8,416666.666667,5.025e8,-28935.1851852, - -2.08333333333e6,-4166.66666667,-1.25e6,3.98587962963e6,-1.59791666667e6, - -8333.33333333,2.5e6,3.41149691358e6,-28935.1851852,2.08333333333e6, - -2.355e6,2.43100308642e6,-2.08333333333e6,1.0e8,-2.5e6,5.0e8,2.5e6, - -416666.666667,1.50416666667e9,-833333.333333,1.25e6,2.5e8,-1.25e6, - -3.47222222222e6,1.33516666667e9,2.08333333333e6,1.0e8,-2.5e6, - 416666.666667,6.94444444444e6,2.16916666667e9,-28935.1851852, - -2.08333333333e6,-3.925e6,3.98587962963e6,-1.59791666667e6, - -38580.2469136,-6.94444444444e6,3.41149691358e6,-28935.1851852, - 2.08333333333e6,-19290.1234568,3.47222222222e6,2.43100308642e6, - -2.08333333333e6,1.0e8,-4.16666666667e6,2.5e6,-416666.666667, - 1.50416666667e9,-833333.333333,-3.47222222222e6,4.16666666667e8, - -1.25e6,3.47222222222e6,1.33516666667e9,2.08333333333e6,1.0e8, - 6.94444444445e6,8.33333333333e8,416666.666667,-6.94444444445e6, - 2.16916666667e9,-3830.95098171,1.14928529451e6,-275828.470683, - -28935.1851852,-2.08333333333e6,-4166.66666667,1.25e6,64710.5806113, - -131963.213599,-517922.131816,-2.29857058902e6,-1.59791666667e6, - -8333.33333333,-2.5e6,3.50487988027e6,-517922.131816,-2.16567078453e6, - 551656.941366,-28935.1851852,2.08333333333e6,-2.355e6,517922.131816, - 4.57738374749e6,2.29857058902e6,-551656.941367,4.8619365099e8, - -2.08333333333e6,1.0e8,2.5e6,5.0e8,-4.79857058902e6,134990.2747, - 2.47238730198e9,-1.14928529451e6,2.29724661236e8,-5.57173510779e7, - -833333.333333,-1.25e6,2.5e8,2.39928529451e6,9.61679848804e8,275828.470683, - -5.57173510779e7,1.09411960038e7,2.08333333333e6,1.0e8,-2.5e6, - 140838.195984,-1.09779731332e8,5.31278103775e8], 1) - @test CHOLMOD.norm_sparse(A, 0) ≈ 3.570948074697437e9 - @test CHOLMOD.norm_sparse(A, 1) ≈ 3.570948074697437e9 - @test_throws ArgumentError CHOLMOD.norm_sparse(A, 2) - @test CHOLMOD.isvalid(A) - - x = fill(1., n) - b = A*x - - chma = ldlt(A) # LDL' form - @test CHOLMOD.isvalid(chma) - @test unsafe_load(pointer(chma)).is_ll == 0 # check that it is in fact an LDLt - @test chma\b ≈ x - @test nnz(ldlt(A, perm=1:size(A,1))) > nnz(chma) - @test size(chma) == size(A) - chmal = CHOLMOD.FactorComponent(chma, :L) - @test size(chmal) == size(A) - @test size(chmal, 1) == size(A, 1) - - chma = cholesky(A) # LL' form - @test CHOLMOD.isvalid(chma) - @test unsafe_load(pointer(chma)).is_ll == 1 # check that it is in fact an LLt - @test chma\b ≈ x - @test nnz(chma) == 489 - @test nnz(cholesky(A, perm=1:size(A,1))) > nnz(chma) - @test size(chma) == size(A) - chmal = CHOLMOD.FactorComponent(chma, :L) - @test size(chmal) == size(A) - @test size(chmal, 1) == size(A, 1) - - @testset "eltype" begin - @test eltype(Dense(fill(1., 3))) == Float64 - @test eltype(A) == Float64 - @test eltype(chma) == Float64 - end -end - -@testset "lp_afiro example" begin - afiro = CHOLMOD.Sparse(27, 51, - CHOLMOD.SuiteSparse_long[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, - 23,25,27,29,33,37,41,45,47,49,51,53,55,57,59,63,65,67,69,71,75,79,83,87,89, - 91,93,95,97,99,101,102], - CHOLMOD.SuiteSparse_long[2,3,6,7,8,9,12,13,16,17,18,19,20,21,22,23,24,25,26, - 0,1,2,23,0,3,0,21,1,25,4,5,6,24,4,5,7,24,4,5,8,24,4,5,9,24,6,20,7,20,8,20,9, - 20,3,4,4,22,5,26,10,11,12,21,10,13,10,23,10,20,11,25,14,15,16,22,14,15,17, - 22,14,15,18,22,14,15,19,22,16,20,17,20,18,20,19,20,13,15,15,24,14,26,15], - [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0, - 1.0,-1.0,-1.06,1.0,0.301,1.0,-1.0,1.0,-1.0,1.0,1.0,-1.0,-1.06,1.0,0.301, - -1.0,-1.06,1.0,0.313,-1.0,-0.96,1.0,0.313,-1.0,-0.86,1.0,0.326,-1.0,2.364, - -1.0,2.386,-1.0,2.408,-1.0,2.429,1.4,1.0,1.0,-1.0,1.0,1.0,-1.0,-0.43,1.0, - 0.109,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,1.0,-0.43,1.0,1.0,0.109,-0.43,1.0,1.0, - 0.108,-0.39,1.0,1.0,0.108,-0.37,1.0,1.0,0.107,-1.0,2.191,-1.0,2.219,-1.0, - 2.249,-1.0,2.279,1.4,-1.0,1.0,-1.0,1.0,1.0,1.0], 0) - afiro2 = CHOLMOD.aat(afiro, CHOLMOD.SuiteSparse_long[0:50;], CHOLMOD.SuiteSparse_long(1)) - CHOLMOD.change_stype!(afiro2, -1) - chmaf = cholesky(afiro2) - y = afiro'*fill(1., size(afiro,1)) - sol = chmaf\(afiro*y) # least squares solution - @test CHOLMOD.isvalid(sol) - pred = afiro'*sol - @test norm(afiro * (convert(Matrix, y) - convert(Matrix, pred))) < 1e-8 -end - -@testset "Issue 9160" begin - local A, B - A = sprand(10, 10, 0.1) - A = convert(SparseMatrixCSC{Float64,CHOLMOD.SuiteSparse_long}, A) - cmA = CHOLMOD.Sparse(A) - - B = sprand(10, 10, 0.1) - B = convert(SparseMatrixCSC{Float64,CHOLMOD.SuiteSparse_long}, B) - cmB = CHOLMOD.Sparse(B) - - # Ac_mul_B - @test sparse(cmA'*cmB) ≈ A'*B - - # A_mul_Bc - @test sparse(cmA*cmB') ≈ A*B' - - # A_mul_Ac - @test sparse(cmA*cmA') ≈ A*A' - - # Ac_mul_A - @test sparse(cmA'*cmA) ≈ A'*A - - # A_mul_Ac for symmetric A - A = 0.5*(A + copy(A')) - cmA = CHOLMOD.Sparse(A) - @test sparse(cmA*cmA') ≈ A*A' -end - -@testset "Issue #9915" begin - sparseI = sparse(1.0I, 2, 2) - @test sparseI \ sparseI == sparseI -end - -@testset "test Sparse constructor Symmetric and Hermitian input (and issymmetric and ishermitian)" begin - ACSC = sprandn(10, 10, 0.3) + I - @test issymmetric(Sparse(Symmetric(ACSC, :L))) - @test issymmetric(Sparse(Symmetric(ACSC, :U))) - @test ishermitian(Sparse(Hermitian(complex(ACSC), :L))) - @test ishermitian(Sparse(Hermitian(complex(ACSC), :U))) -end - -@testset "test Sparse constructor for C_Sparse{Cvoid} (and read_sparse)" begin - mktempdir() do temp_dir - testfile = joinpath(temp_dir, "tmp.mtx") - - writedlm(testfile, ["%%MatrixMarket matrix coordinate real symmetric","3 3 4","1 1 1","2 2 1","3 2 0.5","3 3 1"]) - @test sparse(CHOLMOD.Sparse(testfile)) == [1 0 0;0 1 0.5;0 0.5 1] - rm(testfile) - - writedlm(testfile, ["%%MatrixMarket matrix coordinate complex Hermitian", - "3 3 4","1 1 1.0 0.0","2 2 1.0 0.0","3 2 0.5 0.5","3 3 1.0 0.0"]) - @test sparse(CHOLMOD.Sparse(testfile)) == [1 0 0;0 1 0.5-0.5im;0 0.5+0.5im 1] - rm(testfile) - - # this also tests that the error message is correctly retrieved from the library - writedlm(testfile, ["%%MatrixMarket matrix coordinate real symmetric","%3 3 4","1 1 1","2 2 1","3 2 0.5","3 3 1"]) - @test_throws CHOLMOD.CHOLMODException("indices out of range") sparse(CHOLMOD.Sparse(testfile)) - rm(testfile) - end -end - -@testset "test that Sparse(Ptr) constructor throws the right places" begin - @test_throws ArgumentError CHOLMOD.Sparse(convert(Ptr{CHOLMOD.C_Sparse{Float64}}, C_NULL)) - @test_throws ArgumentError CHOLMOD.Sparse(convert(Ptr{CHOLMOD.C_Sparse{Cvoid}}, C_NULL)) -end - -## The struct pointer must be constructed by the library constructor and then modified afterwards to checks that the method throws -@testset "illegal dtype (for now but should be supported at some point)" begin - p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_Sparse{Cvoid}}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{CHOLMOD.Common}), - 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common[Threads.threadid()]) - puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, CHOLMOD.SINGLE, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 4) - @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) -end - -@testset "illegal dtype" begin - p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_Sparse{Cvoid}}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{CHOLMOD.Common}), - 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common[Threads.threadid()]) - puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, 5, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 4) - @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) -end - -@testset "illegal xtype" begin - p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_Sparse{Cvoid}}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{CHOLMOD.Common}), - 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common[Threads.threadid()]) - puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, 3, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 3) - @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) -end - -@testset "illegal itype I" begin - p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_Sparse{Cvoid}}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{CHOLMOD.Common}), - 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common[Threads.threadid()]) - puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, CHOLMOD.INTLONG, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 2) - @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) -end - -@testset "illegal itype II" begin - p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_Sparse{Cvoid}}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{CHOLMOD.Common}), - 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common[Threads.threadid()]) - puint = convert(Ptr{UInt32}, p) - unsafe_store!(puint, 5, 3*div(sizeof(Csize_t), 4) + 5*div(sizeof(Ptr{Cvoid}), 4) + 2) - @test_throws CHOLMOD.CHOLMODException CHOLMOD.Sparse(p) -end - -# Test Dense wrappers (only Float64 supported a present) - -@testset "High level interface" for elty in (Float64, ComplexF64) - local A, b - if elty == Float64 - A = randn(5, 5) - b = randn(5) - else - A = complex.(randn(5, 5), randn(5, 5)) - b = complex.(randn(5), randn(5)) - end - ADense = CHOLMOD.Dense(A) - bDense = CHOLMOD.Dense(b) - - @test_throws BoundsError ADense[6, 1] - @test_throws BoundsError ADense[1, 6] - @test copy(ADense) == ADense - @test CHOLMOD.norm_dense(ADense, 1) ≈ opnorm(A, 1) - @test CHOLMOD.norm_dense(ADense, 0) ≈ opnorm(A, Inf) - @test_throws ArgumentError CHOLMOD.norm_dense(ADense, 2) - @test_throws ArgumentError CHOLMOD.norm_dense(ADense, 3) - - @test CHOLMOD.norm_dense(bDense, 2) ≈ norm(b) - @test CHOLMOD.check_dense(bDense) - - AA = CHOLMOD.eye(3) - unsafe_store!(convert(Ptr{Csize_t}, pointer(AA)), 2, 1) # change size, but not stride, of Dense - @test convert(Matrix, AA) == Matrix(I, 2, 3) -end - -@testset "Low level interface" begin - @test isa(CHOLMOD.zeros(3, 3, Float64), CHOLMOD.Dense{Float64}) - @test isa(CHOLMOD.zeros(3, 3), CHOLMOD.Dense{Float64}) - @test isa(CHOLMOD.zeros(3, 3, Float64), CHOLMOD.Dense{Float64}) - @test isa(CHOLMOD.ones(3, 3), CHOLMOD.Dense{Float64}) - @test isa(CHOLMOD.eye(3, 4, Float64), CHOLMOD.Dense{Float64}) - @test isa(CHOLMOD.eye(3, 4), CHOLMOD.Dense{Float64}) - @test isa(CHOLMOD.eye(3), CHOLMOD.Dense{Float64}) - @test isa(copy(CHOLMOD.eye(3)), CHOLMOD.Dense{Float64}) -end - -# Test Sparse and Factor -@testset "test free!" begin - p = ccall((:cholmod_l_allocate_sparse, :libcholmod), Ptr{CHOLMOD.C_Sparse{Float64}}, - (Csize_t, Csize_t, Csize_t, Cint, Cint, Cint, Cint, Ptr{CHOLMOD.Common}), - 1, 1, 1, true, true, 0, CHOLMOD.REAL, CHOLMOD.common[Threads.threadid()]) - @test CHOLMOD.free!(p) -end - -@testset "Core functionality" for elty in (Float64, ComplexF64) - A1 = sparse([1:5; 1], [1:5; 2], elty == Float64 ? randn(6) : complex.(randn(6), randn(6))) - A2 = sparse([1:5; 1], [1:5; 2], elty == Float64 ? randn(6) : complex.(randn(6), randn(6))) - A1pd = A1'A1 - A1Sparse = CHOLMOD.Sparse(A1) - A2Sparse = CHOLMOD.Sparse(A2) - A1pdSparse = CHOLMOD.Sparse( - size(A1pd, 1), - size(A1pd, 2), - SuiteSparse.decrement(getcolptr(A1pd)), - SuiteSparse.decrement(rowvals(A1pd)), - nonzeros(A1pd)) - - ## High level interface - @test isa(CHOLMOD.Sparse(3, 3, [0,1,3,4], [0,2,1,2], fill(1., 4)), CHOLMOD.Sparse) # Sparse doesn't require columns to be sorted - @test_throws BoundsError A1Sparse[6, 1] - @test_throws BoundsError A1Sparse[1, 6] - @test sparse(A1Sparse) == A1 - for i = 1:size(A1, 1) - A1[i, i] = real(A1[i, i]) - end #Construct Hermitian matrix properly - @test CHOLMOD.sparse(CHOLMOD.Sparse(Hermitian(A1, :L))) == Hermitian(A1, :L) - @test CHOLMOD.sparse(CHOLMOD.Sparse(Hermitian(A1, :U))) == Hermitian(A1, :U) - @test_throws ArgumentError convert(SparseMatrixCSC{elty,Int}, A1pdSparse) - if elty <: Real - @test_throws ArgumentError convert(Symmetric{Float64,SparseMatrixCSC{Float64,Int}}, A1Sparse) - else - @test_throws ArgumentError convert(Hermitian{ComplexF64,SparseMatrixCSC{ComplexF64,Int}}, A1Sparse) - end - @test copy(A1Sparse) == A1Sparse - @test size(A1Sparse, 3) == 1 - if elty <: Real # multiplication only defined for real matrices in CHOLMOD - @test A1Sparse*A2Sparse ≈ A1*A2 - @test_throws DimensionMismatch CHOLMOD.Sparse(A1[:,1:4])*A2Sparse - @test A1Sparse'A2Sparse ≈ A1'A2 - @test A1Sparse*A2Sparse' ≈ A1*A2' - - @test A1Sparse*A1Sparse ≈ A1*A1 - @test A1Sparse'A1Sparse ≈ A1'A1 - @test A1Sparse*A1Sparse' ≈ A1*A1' - - @test A1pdSparse*A1pdSparse ≈ A1pd*A1pd - @test A1pdSparse'A1pdSparse ≈ A1pd'A1pd - @test A1pdSparse*A1pdSparse' ≈ A1pd*A1pd' - - @test_throws DimensionMismatch A1Sparse*CHOLMOD.eye(4, 5, elty) - end - - # Factor - @test_throws ArgumentError cholesky(A1) - @test_throws ArgumentError cholesky(A1) - @test_throws ArgumentError cholesky(A1, shift=1.0) - @test_throws ArgumentError ldlt(A1) - @test_throws ArgumentError ldlt(A1, shift=1.0) - C = A1 + copy(adjoint(A1)) - λmaxC = eigmax(Array(C)) - b = fill(1., size(A1, 1)) - @test_throws PosDefException cholesky(C - 2λmaxC*I) - @test_throws PosDefException cholesky(C, shift=-2λmaxC) - @test_throws ZeroPivotException ldlt(C - C[1,1]*I) - @test_throws ZeroPivotException ldlt(C, shift=-real(C[1,1])) - @test !isposdef(cholesky(C - 2λmaxC*I; check = false)) - @test !isposdef(cholesky(C, shift=-2λmaxC; check = false)) - @test !issuccess(ldlt(C - C[1,1]*I; check = false)) - @test !issuccess(ldlt(C, shift=-real(C[1,1]); check = false)) - F = cholesky(A1pd) - tmp = IOBuffer() - show(tmp, F) - @test tmp.size > 0 - @test isa(CHOLMOD.Sparse(F), CHOLMOD.Sparse{elty}) - @test_throws DimensionMismatch F\CHOLMOD.Dense(fill(elty(1), 4)) - @test_throws DimensionMismatch F\CHOLMOD.Sparse(sparse(fill(elty(1), 4))) - b = fill(1., 5) - bT = fill(elty(1), 5) - @test F'\bT ≈ Array(A1pd)'\b - @test F'\sparse(bT) ≈ Array(A1pd)'\b - @test transpose(F)\bT ≈ conj(A1pd)'\bT - @test F\CHOLMOD.Sparse(sparse(bT)) ≈ A1pd\b - @test logdet(F) ≈ logdet(Array(A1pd)) - @test det(F) == exp(logdet(F)) - let # to test supernodal, we must use a larger matrix - Ftmp = sprandn(100, 100, 0.1) - Ftmp = Ftmp'Ftmp + I - @test logdet(cholesky(Ftmp)) ≈ logdet(Array(Ftmp)) - end - @test logdet(ldlt(A1pd)) ≈ logdet(Array(A1pd)) - @test isposdef(A1pd) - @test !isposdef(A1) - @test !isposdef(A1 + copy(A1') |> t -> t - 2eigmax(Array(t))*I) - - if elty <: Real - @test CHOLMOD.issymmetric(Sparse(A1pd, 0)) - @test CHOLMOD.Sparse(cholesky(Symmetric(A1pd, :L))) == CHOLMOD.Sparse(cholesky(A1pd)) - F1 = CHOLMOD.Sparse(cholesky(Symmetric(A1pd, :L), shift=2)) - F2 = CHOLMOD.Sparse(cholesky(A1pd, shift=2)) - @test F1 == F2 - @test CHOLMOD.Sparse(ldlt(Symmetric(A1pd, :L))) == CHOLMOD.Sparse(ldlt(A1pd)) - F1 = CHOLMOD.Sparse(ldlt(Symmetric(A1pd, :L), shift=2)) - F2 = CHOLMOD.Sparse(ldlt(A1pd, shift=2)) - @test F1 == F2 - else - @test !CHOLMOD.issymmetric(Sparse(A1pd, 0)) - @test CHOLMOD.ishermitian(Sparse(A1pd, 0)) - @test CHOLMOD.Sparse(cholesky(Hermitian(A1pd, :L))) == CHOLMOD.Sparse(cholesky(A1pd)) - F1 = CHOLMOD.Sparse(cholesky(Hermitian(A1pd, :L), shift=2)) - F2 = CHOLMOD.Sparse(cholesky(A1pd, shift=2)) - @test F1 == F2 - @test CHOLMOD.Sparse(ldlt(Hermitian(A1pd, :L))) == CHOLMOD.Sparse(ldlt(A1pd)) - F1 = CHOLMOD.Sparse(ldlt(Hermitian(A1pd, :L), shift=2)) - F2 = CHOLMOD.Sparse(ldlt(A1pd, shift=2)) - @test F1 == F2 - end - - ### cholesky!/ldlt! - F = cholesky(A1pd) - CHOLMOD.change_factor!(F, false, false, true, true) - @test unsafe_load(pointer(F)).is_ll == 0 - CHOLMOD.change_factor!(F, true, false, true, true) - @test CHOLMOD.Sparse(cholesky!(copy(F), A1pd)) ≈ CHOLMOD.Sparse(F) # surprisingly, this can cause small ulp size changes so we cannot test exact equality - @test size(F, 2) == 5 - @test size(F, 3) == 1 - @test_throws ArgumentError size(F, 0) - - F = cholesky(A1pdSparse, shift=2) - @test isa(CHOLMOD.Sparse(F), CHOLMOD.Sparse{elty}) - @test CHOLMOD.Sparse(cholesky!(copy(F), A1pd, shift=2.0)) ≈ CHOLMOD.Sparse(F) # surprisingly, this can cause small ulp size changes so we cannot test exact equality - - F = ldlt(A1pd) - @test isa(CHOLMOD.Sparse(F), CHOLMOD.Sparse{elty}) - @test CHOLMOD.Sparse(ldlt!(copy(F), A1pd)) ≈ CHOLMOD.Sparse(F) # surprisingly, this can cause small ulp size changes so we cannot test exact equality - - F = ldlt(A1pdSparse, shift=2) - @test isa(CHOLMOD.Sparse(F), CHOLMOD.Sparse{elty}) - @test CHOLMOD.Sparse(ldlt!(copy(F), A1pd, shift=2.0)) ≈ CHOLMOD.Sparse(F) # surprisingly, this can cause small ulp size changes so we cannot test exact equality - - @test isa(CHOLMOD.factor_to_sparse!(F), CHOLMOD.Sparse) - @test_throws CHOLMOD.CHOLMODException CHOLMOD.factor_to_sparse!(F) - - ## Low level interface - @test CHOLMOD.nnz(A1Sparse) == nnz(A1) - @test CHOLMOD.speye(5, 5, elty) == Matrix(I, 5, 5) - @test CHOLMOD.spzeros(5, 5, 5, elty) == zeros(elty, 5, 5) - if elty <: Real - @test CHOLMOD.copy(A1Sparse, 0, 1) == A1Sparse - @test CHOLMOD.horzcat(A1Sparse, A2Sparse, true) == [A1 A2] - @test CHOLMOD.vertcat(A1Sparse, A2Sparse, true) == [A1; A2] - svec = fill(elty(1), 1) - @test CHOLMOD.scale!(CHOLMOD.Dense(svec), CHOLMOD.SCALAR, A1Sparse) == A1Sparse - svec = fill(elty(1), 5) - @test_throws DimensionMismatch CHOLMOD.scale!(CHOLMOD.Dense(svec), CHOLMOD.SCALAR, A1Sparse) - @test CHOLMOD.scale!(CHOLMOD.Dense(svec), CHOLMOD.ROW, A1Sparse) == A1Sparse - @test_throws DimensionMismatch CHOLMOD.scale!(CHOLMOD.Dense([svec; 1]), CHOLMOD.ROW, A1Sparse) - @test CHOLMOD.scale!(CHOLMOD.Dense(svec), CHOLMOD.COL, A1Sparse) == A1Sparse - @test_throws DimensionMismatch CHOLMOD.scale!(CHOLMOD.Dense([svec; 1]), CHOLMOD.COL, A1Sparse) - @test CHOLMOD.scale!(CHOLMOD.Dense(svec), CHOLMOD.SYM, A1Sparse) == A1Sparse - @test_throws DimensionMismatch CHOLMOD.scale!(CHOLMOD.Dense([svec; 1]), CHOLMOD.SYM, A1Sparse) - @test_throws DimensionMismatch CHOLMOD.scale!(CHOLMOD.Dense(svec), CHOLMOD.SYM, CHOLMOD.Sparse(A1[:,1:4])) - else - @test_throws MethodError CHOLMOD.copy(A1Sparse, 0, 1) == A1Sparse - @test_throws MethodError CHOLMOD.horzcat(A1Sparse, A2Sparse, true) == [A1 A2] - @test_throws MethodError CHOLMOD.vertcat(A1Sparse, A2Sparse, true) == [A1; A2] - end - - if elty <: Real - @test CHOLMOD.ssmult(A1Sparse, A2Sparse, 0, true, true) ≈ A1*A2 - @test CHOLMOD.aat(A1Sparse, [0:size(A1,2)-1;], 1) ≈ A1*A1' - @test CHOLMOD.aat(A1Sparse, [0:1;], 1) ≈ A1[:,1:2]*A1[:,1:2]' - @test CHOLMOD.copy(A1Sparse, 0, 1) == A1Sparse - end - - @test CHOLMOD.Sparse(CHOLMOD.Dense(A1Sparse)) == A1Sparse -end - -@testset "extract factors" begin - Af = float([4 12 -16; 12 37 -43; -16 -43 98]) - As = sparse(Af) - Lf = float([2 0 0; 6 1 0; -8 5 3]) - LDf = float([4 0 0; 3 1 0; -4 5 9]) # D is stored along the diagonal - L_f = float([1 0 0; 3 1 0; -4 5 1]) # L by itself in LDLt of Af - D_f = float([4 0 0; 0 1 0; 0 0 9]) - p = [2,3,1] - p_inv = [3,1,2] - - @testset "cholesky, no permutation" begin - Fs = cholesky(As, perm=[1:3;]) - @test Fs.p == [1:3;] - @test sparse(Fs.L) ≈ Lf - @test sparse(Fs) ≈ As - b = rand(3) - @test Fs\b ≈ Af\b - @test Fs.UP\(Fs.PtL\b) ≈ Af\b - @test Fs.L\b ≈ Lf\b - @test Fs.U\b ≈ Lf'\b - @test Fs.L'\b ≈ Lf'\b - @test Fs.U'\b ≈ Lf\b - @test Fs.PtL\b ≈ Lf\b - @test Fs.UP\b ≈ Lf'\b - @test Fs.PtL'\b ≈ Lf'\b - @test Fs.UP'\b ≈ Lf\b - @test_throws CHOLMOD.CHOLMODException Fs.D - @test_throws CHOLMOD.CHOLMODException Fs.LD - @test_throws CHOLMOD.CHOLMODException Fs.DU - @test_throws CHOLMOD.CHOLMODException Fs.PLD - @test_throws CHOLMOD.CHOLMODException Fs.DUPt - end - - @testset "cholesky, with permutation" begin - Fs = cholesky(As, perm=p) - @test Fs.p == p - Afp = Af[p,p] - Lfp = cholesky(Afp).L - Ls = sparse(Fs.L) - @test Ls ≈ Lfp - @test Ls * Ls' ≈ Afp - P = sparse(1:3, Fs.p, ones(3)) - @test P' * Ls * Ls' * P ≈ As - @test sparse(Fs) ≈ As - b = rand(3) - @test Fs\b ≈ Af\b - @test Fs.UP\(Fs.PtL\b) ≈ Af\b - @test Fs.L\b ≈ Lfp\b - @test Fs.U'\b ≈ Lfp\b - @test Fs.U\b ≈ Lfp'\b - @test Fs.L'\b ≈ Lfp'\b - @test Fs.PtL\b ≈ Lfp\b[p] - @test Fs.UP\b ≈ (Lfp'\b)[p_inv] - @test Fs.PtL'\b ≈ (Lfp'\b)[p_inv] - @test Fs.UP'\b ≈ Lfp\b[p] - @test_throws CHOLMOD.CHOLMODException Fs.PL - @test_throws CHOLMOD.CHOLMODException Fs.UPt - @test_throws CHOLMOD.CHOLMODException Fs.D - @test_throws CHOLMOD.CHOLMODException Fs.LD - @test_throws CHOLMOD.CHOLMODException Fs.DU - @test_throws CHOLMOD.CHOLMODException Fs.PLD - @test_throws CHOLMOD.CHOLMODException Fs.DUPt - end - - @testset "ldlt, no permutation" begin - Fs = ldlt(As, perm=[1:3;]) - @test Fs.p == [1:3;] - @test sparse(Fs.LD) ≈ LDf - @test sparse(Fs) ≈ As - b = rand(3) - @test Fs\b ≈ Af\b - @test Fs.UP\(Fs.PtLD\b) ≈ Af\b - @test Fs.DUP\(Fs.PtL\b) ≈ Af\b - @test Fs.L\b ≈ L_f\b - @test Fs.U\b ≈ L_f'\b - @test Fs.L'\b ≈ L_f'\b - @test Fs.U'\b ≈ L_f\b - @test Fs.PtL\b ≈ L_f\b - @test Fs.UP\b ≈ L_f'\b - @test Fs.PtL'\b ≈ L_f'\b - @test Fs.UP'\b ≈ L_f\b - @test Fs.D\b ≈ D_f\b - @test Fs.D'\b ≈ D_f\b - @test Fs.LD\b ≈ D_f\(L_f\b) - @test Fs.DU'\b ≈ D_f\(L_f\b) - @test Fs.LD'\b ≈ L_f'\(D_f\b) - @test Fs.DU\b ≈ L_f'\(D_f\b) - @test Fs.PtLD\b ≈ D_f\(L_f\b) - @test Fs.DUP'\b ≈ D_f\(L_f\b) - @test Fs.PtLD'\b ≈ L_f'\(D_f\b) - @test Fs.DUP\b ≈ L_f'\(D_f\b) - end - - @testset "ldlt, with permutation" begin - Fs = ldlt(As, perm=p) - @test Fs.p == p - @test sparse(Fs) ≈ As - b = rand(3) - Asp = As[p,p] - LDp = sparse(ldlt(Asp, perm=[1,2,3]).LD) - # LDp = sparse(Fs.LD) - Lp, dp = SuiteSparse.CHOLMOD.getLd!(copy(LDp)) - Dp = sparse(Diagonal(dp)) - @test Fs\b ≈ Af\b - @test Fs.UP\(Fs.PtLD\b) ≈ Af\b - @test Fs.DUP\(Fs.PtL\b) ≈ Af\b - @test Fs.L\b ≈ Lp\b - @test Fs.U\b ≈ Lp'\b - @test Fs.L'\b ≈ Lp'\b - @test Fs.U'\b ≈ Lp\b - @test Fs.PtL\b ≈ Lp\b[p] - @test Fs.UP\b ≈ (Lp'\b)[p_inv] - @test Fs.PtL'\b ≈ (Lp'\b)[p_inv] - @test Fs.UP'\b ≈ Lp\b[p] - @test Fs.LD\b ≈ Dp\(Lp\b) - @test Fs.DU'\b ≈ Dp\(Lp\b) - @test Fs.LD'\b ≈ Lp'\(Dp\b) - @test Fs.DU\b ≈ Lp'\(Dp\b) - @test Fs.PtLD\b ≈ Dp\(Lp\b[p]) - @test Fs.DUP'\b ≈ Dp\(Lp\b[p]) - @test Fs.PtLD'\b ≈ (Lp'\(Dp\b))[p_inv] - @test Fs.DUP\b ≈ (Lp'\(Dp\b))[p_inv] - @test_throws CHOLMOD.CHOLMODException Fs.DUPt - @test_throws CHOLMOD.CHOLMODException Fs.PLD - end - - @testset "Element promotion and type inference" begin - @inferred cholesky(As)\fill(1, size(As, 1)) - @inferred ldlt(As)\fill(1, size(As, 1)) - end -end - -@testset "Issue 11745 - row and column pointers were not sorted in sparse(Factor)" begin - A = Float64[10 1 1 1; 1 10 0 0; 1 0 10 0; 1 0 0 10] - @test sparse(cholesky(sparse(A))) ≈ A -end -GC.gc() - -@testset "Issue 11747 - Wrong show method defined for FactorComponent" begin - v = cholesky(sparse(Float64[ 10 1 1 1; 1 10 0 0; 1 0 10 0; 1 0 0 10])).L - for s in (sprint(show, MIME("text/plain"), v), sprint(show, v)) - @test occursin("method: simplicial", s) - @test !occursin("#undef", s) - end -end - -@testset "Issue 14076" begin - @test cholesky(sparse([1,2,3,4], [1,2,3,4], Float32[1,4,16,64]))\[1,4,16,64] == fill(1, 4) -end - -@testset "Issue 29367" begin - if Int != Int32 - @test_throws MethodError cholesky(sparse(Int32[1,2,3,4], Int32[1,2,3,4], Float64[1,4,16,64])) - @test_throws MethodError cholesky(sparse(Int32[1,2,3,4], Int32[1,2,3,4], Float32[1,4,16,64])) - @test_throws MethodError ldlt(sparse(Int32[1,2,3,4], Int32[1,2,3,4], Float64[1,4,16,64])) - @test_throws MethodError ldlt(sparse(Int32[1,2,3,4], Int32[1,2,3,4], Float32[1,4,16,64])) - end -end - -@testset "Issue 14134" begin - A = CHOLMOD.Sparse(sprandn(10,5,0.1) + I |> t -> t't) - b = IOBuffer() - serialize(b, A) - seekstart(b) - Anew = deserialize(b) - @test_throws ArgumentError show(Anew) - @test_throws ArgumentError size(Anew) - @test_throws ArgumentError Anew[1] - @test_throws ArgumentError Anew[2,1] - F = cholesky(A) - serialize(b, F) - seekstart(b) - Fnew = deserialize(b) - @test_throws ArgumentError Fnew\fill(1., 5) - @test_throws ArgumentError show(Fnew) - @test_throws ArgumentError size(Fnew) - @test_throws ArgumentError diag(Fnew) - @test_throws ArgumentError logdet(Fnew) -end - -@testset "Issue #28985" begin - @test typeof(cholesky(sparse(I, 4, 4))'\rand(4)) == Array{Float64, 1} - @test typeof(cholesky(sparse(I, 4, 4))'\rand(4,1)) == Array{Float64, 2} -end - -@testset "Issue with promotion during conversion to CHOLMOD.Dense" begin - @test CHOLMOD.Dense(fill(1, 5)) == fill(1, 5, 1) - @test CHOLMOD.Dense(fill(1f0, 5)) == fill(1, 5, 1) - @test CHOLMOD.Dense(fill(1f0 + 0im, 5, 2)) == fill(1, 5, 2) -end - -@testset "Further issue with promotion #14894" begin - x = fill(1., 5) - @test cholesky(sparse(Float16(1)I, 5, 5))\x == x - @test cholesky(Symmetric(sparse(Float16(1)I, 5, 5)))\x == x - @test cholesky(Hermitian(sparse(Complex{Float16}(1)I, 5, 5)))\x == x - @test_throws TypeError cholesky(sparse(BigFloat(1)I, 5, 5)) - @test_throws TypeError cholesky(Symmetric(sparse(BigFloat(1)I, 5, 5))) - @test_throws TypeError cholesky(Hermitian(sparse(Complex{BigFloat}(1)I, 5, 5))) -end - -@testset "test \\ for Factor and StridedVecOrMat" begin - x = rand(5) - A = cholesky(sparse(Diagonal(x.\1))) - @test A\view(fill(1.,10),1:2:10) ≈ x - @test A\view(Matrix(1.0I, 5, 5), :, :) ≈ Matrix(Diagonal(x)) -end - -@testset "Test \\ for Factor and SparseVecOrMat" begin - sparseI = sparse(1.0I, 100, 100) - sparseb = sprandn(100, 0.5) - sparseB = sprandn(100, 100, 0.5) - chI = cholesky(sparseI) - @test chI \ sparseb ≈ sparseb - @test chI \ sparseB ≈ sparseB - @test chI \ sparseI ≈ sparseI -end - -@testset "Real factorization and complex rhs" begin - A = sprandn(5, 5, 0.4) |> t -> t't + I - B = complex.(randn(5, 2), randn(5, 2)) - @test cholesky(A)\B ≈ A\B -end - -@testset "Make sure that ldlt performs an LDLt (Issue #19032)" begin - m, n = 400, 500 - A = sprandn(m, n, .2) - M = [I copy(A'); A -I] - b = M * fill(1., m+n) - F = ldlt(M) - s = unsafe_load(pointer(F)) - @test s.is_super == 0 - @test F\b ≈ fill(1., m+n) - F2 = cholesky(M; check = false) - @test !issuccess(F2) - ldlt!(F2, M) - @test issuccess(F2) - @test F2\b ≈ fill(1., m+n) -end - -@testset "Test that imaginary parts in Hermitian{T,SparseMatrixCSC{T}} are ignored" begin - A = sparse([1,2,3,4,1], [1,2,3,4,2], [complex(2.0,1),2,2,2,1]) - Fs = cholesky(Hermitian(A)) - Fd = cholesky(Hermitian(Array(A))) - @test sparse(Fs) ≈ Hermitian(A) - @test Fs\fill(1., 4) ≈ Fd\fill(1., 4) -end - -@testset "\\ '\\ and transpose(...)\\" begin - # Test that \ and '\ and transpose(...)\ work for Symmetric and Hermitian. This is just - # a dispatch exercise so it doesn't matter that the complex matrix has - # zero imaginary parts - Apre = sprandn(10, 10, 0.2) - I - for A in (Symmetric(Apre), Hermitian(Apre), - Symmetric(Apre + 10I), Hermitian(Apre + 10I), - Hermitian(complex(Apre)), Hermitian(complex(Apre) + 10I)) - local A, x, b - x = fill(1., 10) - b = A*x - @test x ≈ A\b - @test transpose(A)\b ≈ A'\b - end -end - -@testset "Check that Symmetric{SparseMatrixCSC} can be constructed from CHOLMOD.Sparse" begin - Int === Int32 && Random.seed!(124) - A = sprandn(10, 10, 0.1) - B = CHOLMOD.Sparse(A) - C = B'B - # Change internal representation to symmetric (upper/lower) - o = fieldoffset(CHOLMOD.C_Sparse{eltype(C)}, findall(fieldnames(CHOLMOD.C_Sparse{eltype(C)}) .== :stype)[1]) - for uplo in (1, -1) - unsafe_store!(Ptr{Int8}(pointer(C)), uplo, Int(o) + 1) - @test convert(Symmetric{Float64,SparseMatrixCSC{Float64,Int}}, C) ≈ Symmetric(A'A) - end -end - -@testset "Check inputs to Sparse. Related to #20024" for t_ in ( - (2, 2, [1, 2], CHOLMOD.SuiteSparse_long[], Float64[]), - (2, 2, [1, 2, 3], CHOLMOD.SuiteSparse_long[1], Float64[]), - (2, 2, [1, 2, 3], CHOLMOD.SuiteSparse_long[], Float64[1.0]), - (2, 2, [1, 2, 3], CHOLMOD.SuiteSparse_long[1], Float64[1.0])) - @test_throws ArgumentError SparseMatrixCSC(t_...) - @test_throws ArgumentError CHOLMOD.Sparse(t_[1], t_[2], t_[3] .- 1, t_[4] .- 1, t_[5]) -end - -@testset "sparse right multiplication of Symmetric and Hermitian matrices #21431" begin - S = sparse(1.0I, 2, 2) - @test issparse(S*S*S) - for T in (Symmetric, Hermitian) - @test issparse(S*T(S)*S) - @test issparse(S*(T(S)*S)) - @test issparse((S*T(S))*S) - end -end - -@testset "Test sparse low rank update for cholesky decomposion" begin - A = SparseMatrixCSC{Float64,CHOLMOD.SuiteSparse_long}(10, 5, [1,3,6,8,10,13], [6,7,1,2,9,3,5,1,7,6,7,9], - [-0.138843, 2.99571, -0.556814, 0.669704, -1.39252, 1.33814, - 1.02371, -0.502384, 1.10686, 0.262229, -1.6935, 0.525239]) - AtA = A'*A - C0 = [1., 2., 0, 0, 0] - # Test both cholesky and LDLt with and without automatic permutations - for F in (cholesky(AtA), cholesky(AtA, perm=1:5), ldlt(AtA), ldlt(AtA, perm=1:5)) - local F - x0 = F\(b = fill(1., 5)) - #Test both sparse/dense and vectors/matrices - for Ctest in (C0, sparse(C0), [C0 2*C0], sparse([C0 2*C0])) - local x, C, F1 - C = copy(Ctest) - F1 = copy(F) - x = (AtA+C*C')\b - - #Test update - F11 = CHOLMOD.lowrankupdate(F1, C) - @test Array(sparse(F11)) ≈ AtA+C*C' - @test F11\b ≈ x - #Make sure we get back the same factor again - F10 = CHOLMOD.lowrankdowndate(F11, C) - @test Array(sparse(F10)) ≈ AtA - @test F10\b ≈ x0 - - #Test in-place update - CHOLMOD.lowrankupdate!(F1, C) - @test Array(sparse(F1)) ≈ AtA+C*C' - @test F1\b ≈ x - #Test in-place downdate - CHOLMOD.lowrankdowndate!(F1, C) - @test Array(sparse(F1)) ≈ AtA - @test F1\b ≈ x0 - - @test C == Ctest #Make sure C didn't change - end - end -end - -@testset "Issue #22335" begin - local A, F - A = sparse(1.0I, 3, 3) - @test issuccess(cholesky(A)) - A[3, 3] = -1 - F = cholesky(A; check = false) - @test !issuccess(F) - @test issuccess(ldlt!(F, A)) - A[3, 3] = 1 - @test A[:, 3:-1:1]\fill(1., 3) == [1, 1, 1] -end - -@testset "Non-positive definite matrices" begin - A = sparse(Float64[1 2; 2 1]) - B = sparse(ComplexF64[1 2; 2 1]) - for M in (A, B, Symmetric(A), Hermitian(B)) - F = cholesky(M; check = false) - @test_throws PosDefException cholesky(M) - @test_throws PosDefException cholesky!(F, M) - @test !issuccess(cholesky(M; check = false)) - @test !issuccess(cholesky!(F, M; check = false)) - end - A = sparse(Float64[0 0; 0 0]) - B = sparse(ComplexF64[0 0; 0 0]) - for M in (A, B, Symmetric(A), Hermitian(B)) - F = ldlt(M; check = false) - @test_throws ZeroPivotException ldlt(M) - @test_throws ZeroPivotException ldlt!(F, M) - @test !issuccess(ldlt(M; check = false)) - @test !issuccess(ldlt!(F, M; check = false)) - end -end - -@testset "Issues #27860 & #28363" begin - for typeA in (Float64, ComplexF64), typeB in (Float64, ComplexF64), transform in (identity, adjoint, transpose) - A = sparse(typeA[2.0 0.1; 0.1 2.0]) - B = randn(typeB, 2, 2) - @test A \ transform(B) ≈ cholesky(A) \ transform(B) ≈ Matrix(A) \ transform(B) - C = randn(typeA, 2, 2) - sC = sparse(C) - sF = typeA <: Real ? cholesky(Symmetric(A)) : cholesky(Hermitian(A)) - @test cholesky(A) \ transform(sC) ≈ Matrix(A) \ transform(C) - @test sF.PtL \ transform(A) ≈ sF.PtL \ Matrix(transform(A)) - end -end - -@testset "Issue #33365" begin - A = Sparse(spzeros(0, 0)) - @test A * A' == A - @test A' * A == A - B = Sparse(spzeros(0, 4)) - @test B * B' == Sparse(spzeros(0, 0)) - @test B' * B == Sparse(spzeros(4, 4)) - C = Sparse(spzeros(3, 0)) - @test C * C' == Sparse(spzeros(3, 3)) - @test C' * C == Sparse(spzeros(0, 0)) -end - -@testset "permutation handling" begin - @testset "default permutation" begin - # Assemble arrow matrix - A = sparse(5I,3,3) - A[:,1] .= 1; A[1,:] .= A[:,1] - - # Ensure cholesky eliminates the fill-in - @test cholesky(A).p[1] != 1 - end - - @testset "user-specified permutation" begin - n = 100 - A = sprand(n,n,5/n) |> t -> t't + I - @test cholesky(A, perm=1:n).p == 1:n - end -end - -@testset "Check common is still in default state" begin - # This test intentially depends on all the above tests! - current_common = CHOLMOD.common[Threads.threadid()] - default_common = CHOLMOD.Common() - @test current_common.print == 0 - for name in ( - :nmethods, - :postorder, - :final_ll, - :supernodal, - ) - @test getproperty(current_common, name) == getproperty(default_common, name) - end -end diff --git a/stdlib/SuiteSparse/test/runtests.jl b/stdlib/SuiteSparse/test/runtests.jl deleted file mode 100644 index cde54e9488818b..00000000000000 --- a/stdlib/SuiteSparse/test/runtests.jl +++ /dev/null @@ -1,30 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -using Test, Random -using SuiteSparse, LinearAlgebra, SparseArrays - -if Base.USE_GPL_LIBS - include("umfpack.jl") - include("cholmod.jl") - include("spqr.jl") - - # Test multithreaded execution - let p, cmd = `$(Base.julia_cmd()) --depwarn=error --startup-file=no threads.jl` - # test both nthreads==1 and nthreads>1. spawn a process to test whichever - # case we are not running currently. - other_nthreads = Threads.nthreads() == 1 ? 4 : 1 - p = run( - pipeline( - setenv( - cmd, - "JULIA_NUM_THREADS" => other_nthreads, - dir=@__DIR__()), - stdout = stdout, - stderr = stderr), - wait = false) - include("threads.jl") - if !success(p) - error("SuiteSparse threads test failed with nthreads == $other_nthreads") - end - end -end diff --git a/stdlib/SuiteSparse/test/spqr.jl b/stdlib/SuiteSparse/test/spqr.jl deleted file mode 100644 index d1802c7ccc3b3b..00000000000000 --- a/stdlib/SuiteSparse/test/spqr.jl +++ /dev/null @@ -1,136 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -using SuiteSparse.SPQR -using SuiteSparse.CHOLMOD -using SuiteSparse -using LinearAlgebra: I, istriu, norm, qr, rank, rmul!, lmul!, Adjoint, Transpose -using SparseArrays: sparse, sprandn, spzeros, SparseMatrixCSC - -@testset "Sparse QR" begin -m, n = 100, 10 -nn = 100 - -@test size(qr(sprandn(m, n, 0.1)).Q) == (m, m) - -@testset "element type of A: $eltyA" for eltyA in (Float64, ComplexF64) - if eltyA <: Real - A = sparse([1:n; rand(1:m, nn - n)], [1:n; rand(1:n, nn - n)], randn(nn), m, n) - else - A = sparse([1:n; rand(1:m, nn - n)], [1:n; rand(1:n, nn - n)], complex.(randn(nn), randn(nn)), m, n) - end - - F = qr(A) - @test size(F) == (m,n) - @test size(F, 1) == m - @test size(F, 2) == n - @test size(F, 3) == 1 - @test_throws ArgumentError size(F, 0) - - @testset "getindex" begin - @test istriu(F.R) - @test isperm(F.pcol) - @test isperm(F.prow) - @test_throws ErrorException F.T - end - - @testset "apply Q" begin - Q = F.Q - Imm = Matrix{Float64}(I, m, m) - @test Q' * (Q*Imm) ≈ Imm - @test (Imm*Q) * Q' ≈ Imm - - # test that Q'Pl*A*Pr = R - R0 = Q'*Array(A[F.prow, F.pcol]) - @test R0[1:n, :] ≈ F.R - @test norm(R0[n + 1:end, :], 1) < 1e-12 - - offsizeA = Matrix{Float64}(I, m+1, m+1) - @test_throws DimensionMismatch lmul!(Q, offsizeA) - @test_throws DimensionMismatch lmul!(adjoint(Q), offsizeA) - @test_throws DimensionMismatch rmul!(offsizeA, Q) - @test_throws DimensionMismatch rmul!(offsizeA, adjoint(Q)) - end - - @testset "element type of B: $eltyB" for eltyB in (Int, Float64, ComplexF64) - if eltyB == Int - B = rand(1:10, m, 2) - elseif eltyB <: Real - B = randn(m, 2) - else - B = complex.(randn(m, 2), randn(m, 2)) - end - - @inferred A\B - @test A\B[:,1] ≈ Array(A)\B[:,1] - @test A\B ≈ Array(A)\B - @test_throws DimensionMismatch A\B[1:m-1,:] - C, x = A[1:9, :], fill(eltyB(1), 9) - @test C*(C\x) ≈ x # Underdetermined system - end - - # Make sure that conversion to Sparse doesn't use SuiteSparse's symmetric flag - @test qr(SparseMatrixCSC{eltyA}(I, 5, 5)) \ fill(eltyA(1), 5) == fill(1, 5) -end - -@testset "basic solution of rank deficient ls" begin - A = sprandn(m, 5, 0.9)*sprandn(5, n, 0.9) - b = randn(m) - xs = A\b - xd = Array(A)\b - - # check that basic solution has more zeros - @test count(!iszero, xs) < count(!iszero, xd) - @test A*xs ≈ A*xd -end - -@testset "Issue 26367" begin - A = sparse([0.0 1 0 0; 0 0 0 0]) - @test Matrix(qr(A).Q) == Matrix(qr(Matrix(A)).Q) == Matrix(I, 2, 2) -end - -@testset "Issue 26368" begin - A = sparse([0.0 1 0 0; 0 0 0 0]) - F = qr(A) - @test F.Q*F.R == A[F.prow,F.pcol] -end - -@testset "select ordering overdetermined" begin - A = sparse([1:n; rand(1:m, nn - n)], [1:n; rand(1:n, nn - n)], randn(nn), m, n) - b = randn(m) - xref = Array(A) \ b - for ordering ∈ SuiteSparse.SPQR.ORDERINGS - QR = qr(A, ordering=ordering) - x = QR \ b - @test x ≈ xref - end - @test_throws ErrorException qr(A, ordering=Int32(10)) -end - -@testset "select ordering underdetermined" begin - A = sparse([1:n; rand(1:n, nn - n)], [1:n; rand(1:m, nn - n)], randn(nn), n, m) - b = A * ones(m) - for ordering ∈ SuiteSparse.SPQR.ORDERINGS - QR = qr(A, ordering=ordering) - x = QR \ b - # x ≂̸ Array(A) \ b; LAPACK returns a min-norm x while SPQR returns a basic x - @test A * x ≈ b - end - @test_throws ErrorException qr(A, ordering=Int32(10)) -end - -@testset "propertynames of QRSparse" begin - A = sparse([0.0 1 0 0; 0 0 0 0]) - F = qr(A) - @test propertynames(F) == (:R, :Q, :prow, :pcol) - @test propertynames(F, true) == (:R, :Q, :prow, :pcol, :factors, :τ, :cpiv, :rpivinv) -end - -@testset "rank" begin - S = sprandn(10, 5, 1.0)*sprandn(5, 10, 1.0) - @test rank(qr(S)) == 5 - @test rank(S) == 5 - @test all(iszero, (rank(qr(spzeros(10, i))) for i in 1:10)) - @test all(iszero, (rank(spzeros(10, i)) for i in 1:10)) -end - -end diff --git a/stdlib/SuiteSparse/test/threads.jl b/stdlib/SuiteSparse/test/threads.jl deleted file mode 100644 index 29e97500dc9885..00000000000000 --- a/stdlib/SuiteSparse/test/threads.jl +++ /dev/null @@ -1,22 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -using Test, LinearAlgebra, SparseArrays - -@testset "threaded SuiteSparse tests" begin - A = sprandn(200, 200, 0.2) - b = rand(200) - - function test(n::Integer) - _A = A[1:n, 1:n] - _b = b[1:n] - x = qr(_A) \ _b - return norm(x) - end - - res_threads = zeros(100) - Threads.@threads for i in 1:100 - res_threads[i] = test(i + 100) - end - - @test res_threads ≈ [test(i + 100) for i in 1:100] -end diff --git a/stdlib/SuiteSparse/test/umfpack.jl b/stdlib/SuiteSparse/test/umfpack.jl deleted file mode 100644 index ba8e2f54b975bf..00000000000000 --- a/stdlib/SuiteSparse/test/umfpack.jl +++ /dev/null @@ -1,249 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -using SuiteSparse.UMFPACK -using SuiteSparse -using SuiteSparse: increment! -using Serialization -using LinearAlgebra: - I, det, issuccess, ldiv!, lu, lu!, Adjoint, Transpose, SingularException, Diagonal -using SparseArrays: nnz, sparse, sprand, sprandn, SparseMatrixCSC - -@testset "UMFPACK wrappers" begin - se33 = sparse(1.0I, 3, 3) - do33 = fill(1., 3) - @test isequal(se33 \ do33, do33) - - # based on deps/Suitesparse-4.0.2/UMFPACK/Demo/umfpack_di_demo.c - - A0 = sparse(increment!([0,4,1,1,2,2,0,1,2,3,4,4]), - increment!([0,4,0,2,1,2,1,4,3,2,1,2]), - [2.,1.,3.,4.,-1.,-3.,3.,6.,2.,1.,4.,2.], 5, 5) - - @testset "Core functionality for $Tv elements" for Tv in (Float64, ComplexF64) - # We might be able to support two index sizes one day - for Ti in Base.uniontypes(SuiteSparse.UMFPACK.UMFITypes) - A = convert(SparseMatrixCSC{Tv,Ti}, A0) - lua = lu(A) - @test nnz(lua) == 18 - @test_throws ErrorException lua.Z - L,U,p,q,Rs = lua.:(:) - @test L == lua.L - @test U == lua.U - @test p == lua.p - @test q == lua.q - @test Rs == lua.Rs - @test (Diagonal(Rs) * A)[p,q] ≈ L * U - - @test det(lua) ≈ det(Array(A)) - logdet_lua, sign_lua = logabsdet(lua) - logdet_A, sign_A = logabsdet(Array(A)) - @test logdet_lua ≈ logdet_A - @test sign_lua ≈ sign_A - - b = [8., 45., -3., 3., 19.] - x = lua\b - @test x ≈ float([1:5;]) - - @test A*x ≈ b - z = complex.(b) - x = ldiv!(lua, z) - @test x ≈ float([1:5;]) - @test z === x - y = similar(z) - ldiv!(y, lua, complex.(b)) - @test y ≈ x - - @test A*x ≈ b - - b = [8., 20., 13., 6., 17.] - x = lua'\b - @test x ≈ float([1:5;]) - - @test A'*x ≈ b - z = complex.(b) - x = ldiv!(adjoint(lua), z) - @test x ≈ float([1:5;]) - @test x === z - y = similar(x) - ldiv!(y, adjoint(lua), complex.(b)) - @test y ≈ x - - @test A'*x ≈ b - x = transpose(lua) \ b - @test x ≈ float([1:5;]) - - @test transpose(A) * x ≈ b - x = ldiv!(transpose(lua), complex.(b)) - @test x ≈ float([1:5;]) - y = similar(x) - ldiv!(y, transpose(lua), complex.(b)) - @test y ≈ x - - @test transpose(A) * x ≈ b - - # Element promotion and type inference - @inferred lua\fill(1, size(A, 2)) - end - end - - @testset "More tests for complex cases" begin - Ac0 = complex.(A0,A0) - for Ti in Base.uniontypes(SuiteSparse.UMFPACK.UMFITypes) - Ac = convert(SparseMatrixCSC{ComplexF64,Ti}, Ac0) - x = fill(1.0 + im, size(Ac,1)) - lua = lu(Ac) - L,U,p,q,Rs = lua.:(:) - @test (Diagonal(Rs) * Ac)[p,q] ≈ L * U - b = Ac*x - @test Ac\b ≈ x - b = Ac'*x - @test Ac'\b ≈ x - b = transpose(Ac)*x - @test transpose(Ac)\b ≈ x - end - end - - @testset "Rectangular cases. elty=$elty, m=$m, n=$n" for - elty in (Float64, ComplexF64), - (m, n) in ((10,5), (5, 10)) - - Random.seed!(30072018) - A = sparse([1:min(m,n); rand(1:m, 10)], [1:min(m,n); rand(1:n, 10)], elty == Float64 ? randn(min(m, n) + 10) : complex.(randn(min(m, n) + 10), randn(min(m, n) + 10))) - F = lu(A) - L, U, p, q, Rs = F.:(:) - @test (Diagonal(Rs) * A)[p,q] ≈ L * U - end - - @testset "Issue #4523 - complex sparse \\" begin - A, b = sparse((1.0 + im)I, 2, 2), fill(1., 2) - @test A * (lu(A)\b) ≈ b - - @test det(sparse([1,3,3,1], [1,1,3,3], [1,1,1,1])) == 0 - end - - @testset "UMFPACK_ERROR_n_nonpositive" begin - @test_throws ArgumentError lu(sparse(Int[], Int[], Float64[], 5, 0)) - end - - @testset "Issue #15099" for (Tin, Tout) in ( - (ComplexF16, ComplexF64), - (ComplexF32, ComplexF64), - (ComplexF64, ComplexF64), - (Float16, Float64), - (Float32, Float64), - (Float64, Float64), - (Int, Float64), - ) - - F = lu(sparse(fill(Tin(1), 1, 1))) - L = sparse(fill(Tout(1), 1, 1)) - @test F.p == F.q == [1] - @test F.Rs == [1.0] - @test F.L == F.U == L - @test F.:(:) == (L, L, [1], [1], [1.0]) - end - - @testset "BigFloat not supported" for T in (BigFloat, Complex{BigFloat}) - @test_throws ArgumentError lu(sparse(fill(T(1), 1, 1))) - end - - @testset "size(::UmfpackLU)" begin - m = n = 1 - F = lu(sparse(fill(1., m, n))) - @test size(F) == (m, n) - @test size(F, 1) == m - @test size(F, 2) == n - @test size(F, 3) == 1 - @test_throws ArgumentError size(F,-1) - end - - @testset "Test aliasing" begin - a = rand(5) - @test_throws ArgumentError SuiteSparse.UMFPACK.solve!(a, lu(sparse(1.0I, 5, 5)), a, SuiteSparse.UMFPACK.UMFPACK_A) - aa = complex(a) - @test_throws ArgumentError SuiteSparse.UMFPACK.solve!(aa, lu(sparse((1.0im)I, 5, 5)), aa, SuiteSparse.UMFPACK.UMFPACK_A) - end - - @testset "Issues #18246,18244 - lu sparse pivot" begin - A = sparse(1.0I, 4, 4) - A[1:2,1:2] = [-.01 -200; 200 .001] - F = lu(A) - @test F.p == [3 ; 4 ; 2 ; 1] - end - - @testset "Test that A[c|t]_ldiv_B!{T<:Complex}(X::StridedMatrix{T}, lu::UmfpackLU{Float64}, B::StridedMatrix{T}) works as expected." begin - N = 10 - p = 0.5 - A = N*I + sprand(N, N, p) - X = zeros(ComplexF64, N, N) - B = complex.(rand(N, N), rand(N, N)) - luA, lufA = lu(A), lu(Array(A)) - @test ldiv!(copy(X), luA, B) ≈ ldiv!(copy(X), lufA, B) - @test ldiv!(copy(X), adjoint(luA), B) ≈ ldiv!(copy(X), adjoint(lufA), B) - @test ldiv!(copy(X), transpose(luA), B) ≈ ldiv!(copy(X), transpose(lufA), B) - end - - @testset "singular matrix" begin - for A in sparse.((Float64[1 2; 0 0], ComplexF64[1 2; 0 0])) - @test_throws SingularException lu(A) - @test !issuccess(lu(A; check = false)) - end - end - - @testset "deserialization" begin - A = 10*I + sprandn(10, 10, 0.4) - F1 = lu(A) - b = IOBuffer() - serialize(b, F1) - seekstart(b) - F2 = deserialize(b) - for nm in (:colptr, :m, :n, :nzval, :rowval, :status) - @test getfield(F1, nm) == getfield(F2, nm) - end - end - - @testset "Reuse symbolic LU factorization" begin - A1 = sparse(increment!([0,4,1,1,2,2,0,1,2,3,4,4]), - increment!([0,4,0,2,1,2,1,4,3,2,1,2]), - [2.,1.,3.,4.,-1.,-3.,3.,9.,2.,1.,4.,2.], 5, 5) - for Tv in (Float64, ComplexF64, Float16, Float32, ComplexF16, ComplexF32) - for Ti in Base.uniontypes(SuiteSparse.UMFPACK.UMFITypes) - A = convert(SparseMatrixCSC{Tv,Ti}, A0) - B = convert(SparseMatrixCSC{Tv,Ti}, A1) - b = Tv[8., 45., -3., 3., 19.] - F = lu(A) - lu!(F, B) - @test F\b ≈ B\b ≈ Matrix(B)\b - - # singular matrix - C = copy(B) - C[4, 3] = Tv(0) - F = lu(A) - @test_throws SingularException lu!(F, C) - - # change of nonzero pattern - D = copy(B) - D[5, 1] = Tv(1.0) - F = lu(A) - @test_throws ArgumentError lu!(F, D) - end - end - end - -end - -@testset "REPL printing of UmfpackLU" begin - # regular matrix - A = sparse([1, 2], [1, 2], Float64[1.0, 1.0]) - F = lu(A) - facstring = sprint((t, s) -> show(t, "text/plain", s), F) - lstring = sprint((t, s) -> show(t, "text/plain", s), F.L) - ustring = sprint((t, s) -> show(t, "text/plain", s), F.U) - @test facstring == "$(summary(F))\nL factor:\n$lstring\nU factor:\n$ustring" - - # singular matrix - B = sparse(zeros(Float64, 2, 2)) - F = lu(B; check=false) - facstring = sprint((t, s) -> show(t, "text/plain", s), F) - @test facstring == "Failed factorization of type $(summary(F))" -end diff --git a/stdlib/Test/src/Test.jl b/stdlib/Test/src/Test.jl index e40793968e7d99..9a16d3d25c9beb 100644 --- a/stdlib/Test/src/Test.jl +++ b/stdlib/Test/src/Test.jl @@ -516,6 +516,12 @@ function get_test_result(ex, source) first(string(ex.args[1])) != '.' && !is_splat(ex.args[2]) && !is_splat(ex.args[3]) && (ex.args[1] === :(==) || Base.operator_precedence(ex.args[1]) == comparison_prec) ex = Expr(:comparison, ex.args[2], ex.args[1], ex.args[3]) + + # Mark <: and >: as :comparison expressions + elseif isa(ex, Expr) && length(ex.args) == 2 && + !is_splat(ex.args[1]) && !is_splat(ex.args[2]) && + Base.operator_precedence(ex.head) == comparison_prec + ex = Expr(:comparison, ex.args[1], ex.head, ex.args[2]) end if isa(ex, Expr) && ex.head === :comparison # pass all terms of the comparison to `eval_comparison`, as an Expr @@ -583,7 +589,7 @@ function get_test_result(ex, source) $testret catch _e _e isa InterruptException && rethrow() - Threw(_e, Base.catch_stack(), $(QuoteNode(source))) + Threw(_e, Base.current_exceptions(), $(QuoteNode(source))) end end Base.remove_linenums!(result) @@ -1266,7 +1272,7 @@ function testset_beginend(args, tests, source) err isa InterruptException && rethrow() # something in the test block threw an error. Count that as an # error in this test set - record(ts, Error(:nontest_error, Expr(:tuple), err, Base.catch_stack(), $(QuoteNode(source)))) + record(ts, Error(:nontest_error, Expr(:tuple), err, Base.current_exceptions(), $(QuoteNode(source)))) finally copy!(RNG, oldrng) pop_testset() @@ -1340,7 +1346,7 @@ function testset_forloop(args, testloop, source) err isa InterruptException && rethrow() # Something in the test block threw an error. Count that as an # error in this test set - record(ts, Error(:nontest_error, Expr(:tuple), err, Base.catch_stack(), $(QuoteNode(source)))) + record(ts, Error(:nontest_error, Expr(:tuple), err, Base.current_exceptions(), $(QuoteNode(source)))) end end quote diff --git a/stdlib/Test/src/logging.jl b/stdlib/Test/src/logging.jl index f7ecf90e2bc7f6..d333f40b114289 100644 --- a/stdlib/Test/src/logging.jl +++ b/stdlib/Test/src/logging.jl @@ -184,7 +184,7 @@ macro test_logs(exs...) $(QuoteNode(exs[1:end-1])), logs) end catch e - testres = Error(:test_error, $orig_expr, e, Base.catch_stack(), $sourceloc) + testres = Error(:test_error, $orig_expr, e, Base.current_exceptions(), $sourceloc) end Test.record(Test.get_testset(), testres) value diff --git a/stdlib/Test/test/runtests.jl b/stdlib/Test/test/runtests.jl index 1b99fcf4a66e22..22bc815e0019be 100644 --- a/stdlib/Test/test/runtests.jl +++ b/stdlib/Test/test/runtests.jl @@ -146,6 +146,8 @@ let fails = @testset NoThrowTestSet begin @test endswith(str1, str2) # 21 - Fail - contains @test contains(str1, str2) + # 22 - Fail - Type Comparison + @test typeof(1) <: typeof("julia") end for fail in fails @test fail isa Test.Fail @@ -255,6 +257,11 @@ let fails = @testset NoThrowTestSet begin @test occursin("Expression: contains(str1, str2)", str) @test occursin("Evaluated: contains(\"Hello\", \"World\")", str) end + + let str = sprint(show, fails[22]) + @test occursin("Expression: typeof(1) <: typeof(\"julia\")", str) + @test occursin("Evaluated: $(typeof(1)) <: $(typeof("julia"))", str) + end end let errors = @testset NoThrowTestSet begin diff --git a/stdlib/libLLVM_jll/Project.toml b/stdlib/libLLVM_jll/Project.toml index 6954f96dff80c6..5db781e86a88c9 100644 --- a/stdlib/libLLVM_jll/Project.toml +++ b/stdlib/libLLVM_jll/Project.toml @@ -1,10 +1,10 @@ name = "libLLVM_jll" uuid = "8f36deef-c2a5-5394-99ed-8e07531fb29a" -version = "11.0.1+3" +version = "12.0.0+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [compat] -julia = "1.6" +julia = "1.7" diff --git a/stdlib/libLLVM_jll/src/libLLVM_jll.jl b/stdlib/libLLVM_jll/src/libLLVM_jll.jl index 702ed5c0ef8672..5186cb13e0be99 100644 --- a/stdlib/libLLVM_jll/src/libLLVM_jll.jl +++ b/stdlib/libLLVM_jll/src/libLLVM_jll.jl @@ -19,11 +19,11 @@ libLLVM_handle = C_NULL libLLVM_path = "" if Sys.iswindows() - const libLLVM = "LLVM.dll" + const libLLVM = "libLLVM.dll" elseif Sys.isapple() const libLLVM = "@rpath/libLLVM.dylib" else - const libLLVM = "libLLVM-11jl.so" + const libLLVM = "libLLVM-12jl.so" end function __init__() diff --git a/sysimage.mk b/sysimage.mk index de5c3e22f253a3..57479da366583c 100644 --- a/sysimage.mk +++ b/sysimage.mk @@ -60,7 +60,7 @@ RELBUILDROOT := $(call rel_path,$(JULIAHOME)/base,$(BUILDROOT)/base)/ # <-- make $(build_private_libdir)/corecompiler.ji: $(COMPILER_SRCS) @$(call PRINT_JULIA, cd $(JULIAHOME)/base && \ $(call spawn,$(JULIA_EXECUTABLE)) -C "$(JULIA_CPU_TARGET)" --output-ji $(call cygpath_w,$@).tmp \ - --startup-file=no --warn-overwrite=yes -g0 -O0 compiler/compiler.jl) + --startup-file=no --warn-overwrite=yes -g1 -O0 compiler/compiler.jl) @mv $@.tmp $@ $(build_private_libdir)/sys.ji: $(build_private_libdir)/corecompiler.ji $(JULIAHOME)/VERSION $(BASE_SRCS) $(STDLIB_SRCS) diff --git a/test/Makefile b/test/Makefile index 9ca65ffa9d7c77..3d16f88a741b8a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -35,8 +35,11 @@ embedding: gcext: @$(MAKE) -C $(SRCDIR)/$@ check $(GCEXT_ARGS) +clangsa: + @$(MAKE) -C $(SRCDIR)/$@ + clean: @$(MAKE) -C embedding $@ $(EMBEDDING_ARGS) @$(MAKE) -C gcext $@ $(GCEXT_ARGS) -.PHONY: $(TESTS) $(addprefix revise-, $(TESTS)) embedding gcext clean +.PHONY: $(TESTS) $(addprefix revise-, $(TESTS)) embedding gcext clangsa clean diff --git a/test/abstractarray.jl b/test/abstractarray.jl index 6c5ed26a1c289b..4e5e92881d601b 100644 --- a/test/abstractarray.jl +++ b/test/abstractarray.jl @@ -1317,8 +1317,50 @@ end end end -@testset "reduce(vcat, ...) inferrence #40277" begin - x_vecs = ([5, ], [1.0, 2.0, 3.0]) - @test @inferred(reduce(vcat, x_vecs)) == [5.0, 1.0, 2.0, 3.0] - @test @inferred(reduce(vcat, ([10.0], [20.0], Bool[]))) == [10.0, 20.0] +@testset "hvncat" begin + a = fill(1, (2,3,2,4,5)) + b = fill(2, (1,1,2,4,5)) + c = fill(3, (1,2,2,4,5)) + d = fill(4, (1,1,1,4,5)) + e = fill(5, (1,1,1,4,5)) + f = fill(6, (1,1,1,4,5)) + g = fill(7, (2,3,1,4,5)) + h = fill(8, (3,3,3,1,2)) + i = fill(9, (3,2,3,3,2)) + j = fill(10, (3,1,3,3,2)) + + result = [a; b c ;;; d e f ; g ;;;;; h ;;;; i j] + @test size(result) == (3,3,3,4,7) + @test result == [a; [b ;; c] ;;; [d e f] ; g ;;;;; h ;;;; i ;; j] + @test result == cat(cat([a ; b c], [d e f ; g], dims = 3), cat(h, [i j], dims = 4), dims = 5) + + # terminating semicolons extend dimensions + @test [1;] == [1] + @test [1;;] == fill(1, (1,1)) + + for v in (1, fill(1), fill(1,1,1), fill(1, 1, 1, 1)) + @test_throws ArgumentError [v; v;; v] + @test_throws ArgumentError [v; v;; v; v; v] + @test_throws ArgumentError [v; v; v;; v; v] + @test_throws ArgumentError [v; v;; v; v;;; v; v;; v; v;; v; v] + @test_throws ArgumentError [v; v;; v; v;;; v; v] + @test_throws ArgumentError [v; v;; v; v;;; v; v; v;; v; v] + @test_throws ArgumentError [v; v;; v; v;;; v; v;; v; v; v] + # ensure a wrong shape with the right number of elements doesn't pass through + @test_throws ArgumentError [v; v;; v; v;;; v; v; v; v] + + @test [v; v;; v; v] == fill(1, ndims(v) == 3 ? (2, 2, 1) : (2,2)) + @test [v; v;; v; v;;;] == fill(1, 2, 2, 1) + @test [v; v;; v; v] == fill(1, ndims(v) == 3 ? (2, 2, 1) : (2,2)) + @test [v v; v v;;;] == fill(1, 2, 2, 1) + @test [v; v;; v; v;;; v; v;; v; v;;] == fill(1, 2, 2, 2) + @test [v; v; v;; v; v; v;;; v; v; v;; v; v; v;;] == fill(1, 3, 2, 2) + @test [v v; v v;;; v v; v v] == fill(1, 2, 2, 2) + @test [v v v; v v v;;; v v v; v v v] == fill(1, 2, 3, 2) + end + + # mixed scalars and arrays work, for numbers and strings + for v = (1, "test") + @test [v v;;; fill(v, 1, 2)] == fill(v, 1, 2, 2) + end end diff --git a/test/broadcast.jl b/test/broadcast.jl index 4c2b92a39bb9f4..57a65110a413a2 100644 --- a/test/broadcast.jl +++ b/test/broadcast.jl @@ -1045,6 +1045,8 @@ end end end -# issue 40309 -@test Base.broadcasted_kwsyntax(+, [1], [2]) isa Broadcast.Broadcasted{<:Any, <:Any, typeof(+)} -@test Broadcast.BroadcastFunction(+)(2:3, 2:3) === 4:2:6 +@testset "Issue #40309: still gives a range after #40320" begin + @test Base.broadcasted_kwsyntax(+, [1], [2]) isa Broadcast.Broadcasted{<:Any, <:Any, typeof(+)} + @test Broadcast.BroadcastFunction(+)(2:3, 2:3) == 4:2:6 + @test Broadcast.BroadcastFunction(+)(2:3, 2:3) isa AbstractRange +end diff --git a/test/ccall.jl b/test/ccall.jl index b7367c96549a5c..77e17c6843db15 100644 --- a/test/ccall.jl +++ b/test/ccall.jl @@ -906,7 +906,7 @@ for (t, v) in ((Complex{Int32}, :ci32), (Complex{Int64}, :ci64), global function $fname(s::$t) verbose && println("B: ", s) @test s == $v - if($(t).mutable) + if $(t).name.mutable @test !(s === $a) end global c = s @@ -934,7 +934,7 @@ for (t, v) in ((Complex{Int32}, :ci32), (Complex{Int64}, :ci64), end verbose && println("C: ",b) @test b == $v - if ($(t).mutable) + if $(t).name.mutable @test !(b === c) @test !(b === a) end @@ -943,7 +943,7 @@ for (t, v) in ((Complex{Int32}, :ci32), (Complex{Int64}, :ci64), end verbose && println("C: ",b) @test b == $v - if ($(t).mutable) + if $(t).name.mutable @test !(b === c) @test !(b === a) end @@ -953,7 +953,7 @@ for (t, v) in ((Complex{Int32}, :ci32), (Complex{Int64}, :ci64), verbose && println("C: ",b) @test b == $v @test b === c - if ($(t).mutable) + if $(t).name.mutable @test !(b === a) end let cf = @cfunction($fname, Any, (Ref{$t},)) @@ -962,7 +962,7 @@ for (t, v) in ((Complex{Int32}, :ci32), (Complex{Int64}, :ci64), verbose && println("C: ",b) @test b == $v @test b === c - if ($(t).mutable) + if $(t).name.mutable @test !(b === a) end let cf = @cfunction($fname, Any, (Ref{Any},)) @@ -970,7 +970,7 @@ for (t, v) in ((Complex{Int32}, :ci32), (Complex{Int64}, :ci64), end @test b == $v @test b === c - if ($(t).mutable) + if $(t).name.mutable @test !(b === a) end let cf = @cfunction($fname, Ref{AbstractString}, (Ref{Any},)) diff --git a/test/char.jl b/test/char.jl index abc8db33cb4a7b..279adb628ed178 100644 --- a/test/char.jl +++ b/test/char.jl @@ -99,6 +99,7 @@ end #getindex(c::Char) = c for x in testarrays @test getindex(x) == x + @test getindex(x, CartesianIndex()) == x end #first(c::Char) = c @@ -290,6 +291,7 @@ end @testset "broadcasting of Char" begin @test identity.('a') == 'a' + @test 'a' .* ['b', 'c'] == ["ab", "ac"] end @testset "code point format of U+ syntax (PR 33291)" begin diff --git a/test/client.jl b/test/client.jl index 497cc54b135342..f917e45fb412da 100644 --- a/test/client.jl +++ b/test/client.jl @@ -18,14 +18,22 @@ nested_error_pattern = r""" @testset "display_error" begin # Display of errors which cause more than one entry on the exception stack - err_str = try + excs = try eval(nested_error_expr) catch - excs = Base.catch_stack() - @test typeof.(first.(excs)) == [UndefVarError, DivideError] - sprint(Base.display_error, excs) + Base.current_exceptions() end - @test occursin(nested_error_pattern, err_str) + @test typeof.(first.(excs)) == [UndefVarError, DivideError] + @test occursin(nested_error_pattern, sprint(Base.display_error, excs)) + + @test occursin(r""" + 2-element ExceptionStack: + DivideError: integer division error + Stacktrace:.* + + caused by: UndefVarError: __not_a_binding__ not defined + Stacktrace:.* + """s, sprint(show, excs)) end @testset "Fallback REPL" begin diff --git a/test/compiler/codegen.jl b/test/compiler/codegen.jl index 97a9d45d7ecf31..a080cd550d10f2 100644 --- a/test/compiler/codegen.jl +++ b/test/compiler/codegen.jl @@ -561,3 +561,12 @@ function f32843(vals0, v) vals end @test_throws UndefVarError f32843([6], Vector[[1]]) + +# issue #40855, struct constants with union fields +@enum T40855 X40855 +struct A40855 + d::Union{Nothing, T40855} + b::Union{Nothing, Int} +end +g() = string(A40855(X40855, 1)) +@test g() == "$(@__MODULE__).A40855($(@__MODULE__).X40855, 1)" diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index b6eb4acb3cf1d4..ff48b428852afd 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -1551,9 +1551,9 @@ f_pure_add() = (1 + 1 == 2) ? true : "FAIL" @test @inferred f_pure_add() # inference of `T.mutable` -@test Core.Compiler.getfield_tfunc(Const(Int), Const(:mutable)) == Const(false) -@test Core.Compiler.getfield_tfunc(Const(Vector{Int}), Const(:mutable)) == Const(true) -@test Core.Compiler.getfield_tfunc(DataType, Const(:mutable)) == Bool +@test Core.Compiler.getfield_tfunc(Const(Int.name), Const(:mutable)) == Const(false) +@test Core.Compiler.getfield_tfunc(Const(Vector{Int}.name), Const(:mutable)) == Const(true) +@test Core.Compiler.getfield_tfunc(Core.TypeName, Const(:mutable)) == Bool # getfield on abstract named tuples. issue #32698 import Core.Compiler.getfield_tfunc @@ -1833,6 +1833,24 @@ end end == Any[Tuple{Int,Int}] end +@testset "conditional constraint propagation from non-`Conditional` object" begin + @test Base.return_types((Bool,)) do b + if b + return !b ? nothing : 1 # ::Int + else + return 0 + end + end == Any[Int] + + @test Base.return_types((Any,)) do b + if b + return b # ::Bool + else + return nothing + end + end == Any[Union{Bool,Nothing}] +end + function f25579(g) h = g[] t = (h === nothing) diff --git a/test/compiler/inline.jl b/test/compiler/inline.jl index 42839d4d954e6a..ea0761320e7001 100644 --- a/test/compiler/inline.jl +++ b/test/compiler/inline.jl @@ -162,8 +162,8 @@ function fully_eliminated(f, args, retval) end end -# check that type.mutable can be fully eliminated -f_mutable_nothrow(s::String) = Val{typeof(s).mutable} +# check that ismutabletype(type) can be fully eliminated +f_mutable_nothrow(s::String) = Val{typeof(s).name.mutable} @test fully_eliminated(f_mutable_nothrow, (String,)) # check that ifelse can be fully eliminated diff --git a/test/copy.jl b/test/copy.jl index 34d1c20c5f4fa7..28d34e4756a6b1 100644 --- a/test/copy.jl +++ b/test/copy.jl @@ -233,4 +233,8 @@ end @test copyto!(s, view(Int[],Int[])) == [1, 2] @test copyto!(s, Float64[]) == [1, 2] @test copyto!(s, String[]) == [1, 2] # No error -end \ No newline at end of file +end + +@testset "deepcopy_internal arrays" begin + @test (@inferred Base.deepcopy_internal(zeros(), IdDict())) == zeros() +end diff --git a/test/exceptions.jl b/test/exceptions.jl index 7b8a54da2c6ebd..d8d1e7b45b8b53 100644 --- a/test/exceptions.jl +++ b/test/exceptions.jl @@ -1,52 +1,51 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license using Test -using Base: catch_stack @testset "Basic exception stack handling" begin # Exiting the catch block normally pops the exception try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 end - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 # Exiting via a finally block does not pop the exception try try error("A") finally - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 end catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 end # The combined try-catch-finally form obeys the same rules as above try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 finally - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 end - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 # Errors are pushed onto the stack according to catch block nesting try error("RootCause") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 try error("B") catch - stack = catch_stack() + stack = current_exceptions() @test length(stack) == 2 - @test stack[1][1].msg == "RootCause" - @test stack[2][1].msg == "B" + @test stack[1].exception.msg == "RootCause" + @test stack[2].exception.msg == "B" end # Stack pops correctly - stack = catch_stack() + stack = current_exceptions() @test length(stack) == 1 - @test stack[1][1].msg == "RootCause" + @test stack[1].exception.msg == "RootCause" end end @@ -55,7 +54,7 @@ end val = try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 1 end @test val == 1 @@ -64,11 +63,11 @@ end try error("A") catch - length(catch_stack()) + length(current_exceptions()) end end @test test_exc_stack_tailpos() == 1 - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 end @testset "Exception stacks - early exit from try or catch" begin @@ -78,7 +77,7 @@ end try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 return end end @@ -88,7 +87,7 @@ end try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 break end end @@ -97,19 +96,19 @@ end try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 break finally - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 end end - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 for i=1:1 try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 continue end end @@ -117,38 +116,38 @@ end try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 continue finally - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 end end - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 @goto outofcatch end @label outofcatch try error("A") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 @goto outofcatch2 finally - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 end @label outofcatch2 - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 # Exiting from a try block in various ways should not affect the exception # stack state. try error("ExceptionInOuterTry") catch - @test length(catch_stack()) == 1 + @test length(current_exceptions()) == 1 function test_exc_stack_try_return() try return @@ -173,8 +172,8 @@ end catch end @label outoftry - @test length(catch_stack()) == 1 - @test catch_stack()[1][1] == ErrorException("ExceptionInOuterTry") + @test length(current_exceptions()) == 1 + @test current_exceptions()[1].exception == ErrorException("ExceptionInOuterTry") end end @@ -195,10 +194,10 @@ end # Explicit return => exception should be popped before finally block return finally - @test length(Base.catch_stack()) == 0 + @test length(Base.current_exceptions()) == 0 end end)() - @test length(Base.catch_stack()) == 0 + @test length(Base.current_exceptions()) == 0 while true try @@ -209,11 +208,11 @@ end # exception should not be popped inside finally block break finally - @test length(Base.catch_stack()) == 1 + @test length(Base.current_exceptions()) == 1 end end end - @test length(Base.catch_stack()) == 0 + @test length(Base.current_exceptions()) == 0 # Nested finally handling with `return`: each finally block should observe # only the active exceptions as according to its nesting depth. @@ -232,16 +231,16 @@ end end finally # At this point err2 is dealt with - @test length(Base.catch_stack()) == 1 - @test Base.catch_stack()[1][1] == ErrorException("err1") + @test length(Base.current_exceptions()) == 1 + @test Base.current_exceptions()[1].exception == ErrorException("err1") end end finally # At this point err1 is dealt with - @test length(Base.catch_stack()) == 0 + @test length(Base.current_exceptions()) == 0 end end)() - @test length(Base.catch_stack()) == 0 + @test length(Base.current_exceptions()) == 0 end @testset "Deep exception stacks" begin @@ -260,10 +259,10 @@ end @test try test_exc_stack_deep(100) catch - @test catch_stack()[1][1] == ErrorException("RootCause") - length(catch_stack()) + @test current_exceptions()[1].exception == ErrorException("RootCause") + length(current_exceptions()) end == 100 - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 end @testset "Exception stacks and Tasks" begin @@ -280,10 +279,10 @@ end @test t.state == :done @test t.result == ErrorException("B") # Task exception state is preserved around task switches - @test length(catch_stack()) == 1 - @test catch_stack()[1][1] == ErrorException("A") + @test length(current_exceptions()) == 1 + @test current_exceptions()[1].exception == ErrorException("A") end - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 # test rethrow() rethrows correct state bt = [] try @@ -306,7 +305,7 @@ end @test exc == ErrorException("A") @test bt == catch_backtrace() end - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 # test rethrow with argument bt = [] try @@ -328,7 +327,7 @@ end @test exc == ErrorException("C") @test bt == catch_backtrace() end - @test length(catch_stack()) == 0 + @test length(current_exceptions()) == 0 # Exception stacks on other tasks t = @task try error("A") @@ -338,7 +337,10 @@ end yield(t) @test t.state == :failed @test t.result == ErrorException("B") - @test catch_stack(t, include_bt=false) == [ErrorException("A"), ErrorException("B")] + @test current_exceptions(t, backtrace=false) == [ + (exception=ErrorException("A"),backtrace=nothing), + (exception=ErrorException("B"),backtrace=nothing) + ] # Exception stacks for tasks which never get the chance to start t = @task nothing @test (try @@ -347,12 +349,12 @@ end catch e e end).task.exception == ErrorException("expected") - @test length(catch_stack(t)) == 1 - @test length(catch_stack(t)[1][2]) > 0 # backtrace is nonempty + @test length(current_exceptions(t)) == 1 + @test length(current_exceptions(t)[1].backtrace) > 0 # backtrace is nonempty # Exception stacks should not be accessed on concurrently running tasks t = @task ()->nothing @test_throws ErrorException("Inspecting the exception stack of a task which might "* - "be running concurrently isn't allowed.") catch_stack(t) + "be running concurrently isn't allowed.") current_exceptions(t) end @testset "rethrow" begin @@ -396,5 +398,5 @@ end undef_var_in_catch() [] catch - catch_stack() + current_exceptions() end) == 2 diff --git a/test/float16.jl b/test/float16.jl index 5ac9582f900c4e..916032131bf5de 100644 --- a/test/float16.jl +++ b/test/float16.jl @@ -21,6 +21,20 @@ g = Float16(1.) @test isequal(Float16(0.0), Float16(0.0)) @test !isequal(Float16(-0.0), Float16(0.0)) @test !isequal(Float16(0.0), Float16(-0.0)) + + for T = Base.BitInteger_types + @test -Inf16 < typemin(T) + @test -Inf16 <= typemin(T) + @test typemin(T) > -Inf16 + @test typemin(T) >= -Inf16 + @test typemin(T) != -Inf16 + + @test Inf16 > typemax(T) + @test Inf16 >= typemax(T) + @test typemax(T) < Inf16 + @test typemax(T) <= Inf16 + @test typemax(T) != Inf16 + end end @testset "convert" begin @@ -157,6 +171,10 @@ end # halfway between and last bit is 0 ff = reinterpret(Float32, 0b00111110101010100001000000000000) @test Float32(Float16(ff)) === reinterpret(Float32, 0b00111110101010100000000000000000) + + for x = (typemin(Int64), typemin(Int128)), R = (RoundUp, RoundToZero) + @test Float16(x, R) == nextfloat(-Inf16) + end end # issue #5948 diff --git a/test/iterators.jl b/test/iterators.jl index c4b438d2796933..de3dbda921cbd8 100644 --- a/test/iterators.jl +++ b/test/iterators.jl @@ -2,6 +2,7 @@ using Base.Iterators using Random +using Base: IdentityUnitRange @test Base.IteratorSize(Any) isa Base.SizeUnknown @@ -848,3 +849,7 @@ end @test cumprod(x + 1 for x in 1:3) == [2, 6, 24] @test accumulate(+, (x^2 for x in 1:3); init=100) == [101, 105, 114] end + +@testset "proper patition for non-1-indexed vector" begin + @test partition(IdentityUnitRange(11:19), 5) |> collect == [11:15,16:19] # IdentityUnitRange +end diff --git a/test/loading.jl b/test/loading.jl index cf9aa32952a664..d94abd889dcfc4 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -314,6 +314,11 @@ module NotPkgModule; end @test pkgdir(Foo.SubFoo1) == normpath(abspath(@__DIR__, "project/deps/Foo1")) @test pkgdir(Foo.SubFoo2) == normpath(abspath(@__DIR__, "project/deps/Foo1")) @test pkgdir(NotPkgModule) === nothing + + @test pkgdir(Foo, "src") == normpath(abspath(@__DIR__, "project/deps/Foo1/src")) + @test pkgdir(Foo.SubFoo1, "src") == normpath(abspath(@__DIR__, "project/deps/Foo1/src")) + @test pkgdir(Foo.SubFoo2, "src") == normpath(abspath(@__DIR__, "project/deps/Foo1/src")) + @test pkgdir(NotPkgModule, "src") === nothing end end diff --git a/test/math.jl b/test/math.jl index 074358da9c7915..120f1075e0818d 100644 --- a/test/math.jl +++ b/test/math.jl @@ -341,6 +341,35 @@ end @test Array(acosh.(STAA)) == acosh.(TAA) @test Array(acsch.(STAA)) == acsch.(TAA) @test Array(acoth.(STAA)) == acoth.(TAA) + @test sind(TAA) == sin(deg2rad.(TAA)) + @test cosd(TAA) == cos(deg2rad.(TAA)) + @test tand(TAA) == tan(deg2rad.(TAA)) + @test asind(TAA) == rad2deg.(asin(TAA)) + @test acosd(TAA) == rad2deg.(acos(TAA)) + @test atand(TAA) == rad2deg.(atan(TAA)) + @test asecd(TAA) == rad2deg.(asec(TAA)) + @test acscd(TAA) == rad2deg.(acsc(TAA)) + @test acotd(TAA) == rad2deg.(acot(TAA)) + + m = rand(3,2) # not square matrix + ex = @test_throws DimensionMismatch sind(m) + @test startswith(ex.value.msg, "matrix is not square") + ex = @test_throws DimensionMismatch cosd(m) + @test startswith(ex.value.msg, "matrix is not square") + ex = @test_throws DimensionMismatch tand(m) + @test startswith(ex.value.msg, "matrix is not square") + ex = @test_throws DimensionMismatch asind(m) + @test startswith(ex.value.msg, "matrix is not square") + ex = @test_throws DimensionMismatch acosd(m) + @test startswith(ex.value.msg, "matrix is not square") + ex = @test_throws DimensionMismatch atand(m) + @test startswith(ex.value.msg, "matrix is not square") + ex = @test_throws DimensionMismatch asecd(m) + @test startswith(ex.value.msg, "matrix is not square") + ex = @test_throws DimensionMismatch acscd(m) + @test startswith(ex.value.msg, "matrix is not square") + ex = @test_throws DimensionMismatch acotd(m) + @test startswith(ex.value.msg, "matrix is not square") end @testset "check exp2(::Integer) matches exp2(::Float)" begin diff --git a/test/offsetarray.jl b/test/offsetarray.jl index 96a44c71e54839..811d3dd26f509e 100644 --- a/test/offsetarray.jl +++ b/test/offsetarray.jl @@ -2,6 +2,7 @@ isdefined(Main, :OffsetArrays) || @eval Main include("testhelpers/OffsetArrays.jl") using .Main.OffsetArrays +import .Main.OffsetArrays: IdOffsetRange using DelimitedFiles using Random using LinearAlgebra @@ -231,9 +232,9 @@ targets1 = ["0-dimensional OffsetArray(::Array{Float64, 0}) with eltype Float64: "1×1×1×1 OffsetArray(::Array{Float64, 4}, 2:2, 3:3, 4:4, 5:5) with eltype Float64 with indices 2:2×3:3×4:4×5:5:\n[:, :, 4, 5] =\n 1.0"] targets2 = ["(fill(1.0), fill(1.0))", "([1.0], [1.0])", - "([1.0], [1.0])", - "([1.0], [1.0])", - "([1.0], [1.0])"] + "([1.0;;], [1.0;;])", + "([1.0;;;], [1.0;;;])", + "([1.0;;;;], [1.0;;;;])"] @testset "printing of OffsetArray with n=$n" for n = 0:4 a = OffsetArray(fill(1.,ntuple(Returns(1),n)), ntuple(identity,n)) show(IOContext(io, :limit => true), MIME("text/plain"), a) @@ -786,3 +787,11 @@ end @test b[i] == a[r[i]] end end + +@testset "proper patition for non-1-indexed vector" begin + @test Iterators.partition(OffsetArray(1:10,10), 5) |> collect == [1:5,6:10] # OffsetVector + @test Iterators.partition(OffsetArray(collect(1:10),10), 5) |> collect == [1:5,6:10] # OffsetVector + @test Iterators.partition(OffsetArray(reshape(1:9,3,3), (3,3)), 5) |> collect == [1:5,6:9] #OffsetMatrix + @test Iterators.partition(OffsetArray(reshape(collect(1:9),3,3), (3,3)), 5) |> collect == [1:5,6:9] #OffsetMatrix + @test Iterators.partition(IdOffsetRange(2:7,10), 5) |> collect == [12:16,17:17] # IdOffsetRange +end diff --git a/test/osutils.jl b/test/osutils.jl index c9e3b9d91a3774..5f597292c5cc91 100644 --- a/test/osutils.jl +++ b/test/osutils.jl @@ -44,6 +44,7 @@ end @test (@static if false 1 elseif false 2 else 3 end) === 3 @test (@static if false 1 elseif false 2 elseif true && false 3 else 4 end) === 4 @test (@static if false 1 elseif false 2 elseif true && false 3 end) === nothing + @test_throws ArgumentError("invalid @static macro") @macroexpand @static 1 end if Sys.iswindows() diff --git a/test/ranges.jl b/test/ranges.jl index b0693a32527d24..8dcff017c4556b 100644 --- a/test/ranges.jl +++ b/test/ranges.jl @@ -1082,7 +1082,7 @@ end @test sprint(show, StepRange(1, 2, 5)) == "1:2:5" end -@testset "Issue 11049 and related" begin +@testset "Issue 11049, and related" begin @test promote(range(0f0, stop=1f0, length=3), range(0., stop=5., length=2)) === (range(0., stop=1., length=3), range(0., stop=5., length=2)) @test convert(LinRange{Float64}, range(0., stop=1., length=3)) === LinRange(0., 1., 3) @@ -1144,6 +1144,7 @@ end @test [reverse(range(1.0, stop=27.0, length=1275));] == reverse([range(1.0, stop=27.0, length=1275);]) end + @testset "PR 12200 and related" begin for _r in (1:2:100, 1:100, 1f0:2f0:100f0, 1.0:2.0:100.0, range(1, stop=100, length=10), range(1f0, stop=100f0, length=10)) @@ -1288,8 +1289,8 @@ end @test_throws BoundsError r[4] @test_throws BoundsError r[0] @test broadcast(+, r, 1) === 2:4 - @test 2*r === 2:2:6 - @test r + r === 2:2:6 + @test 2*r == 2:2:6 + @test r + r == 2:2:6 k = 0 for i in r @test i == (k += 1) @@ -1432,14 +1433,14 @@ end @test @inferred(r .+ x) === 3:7 @test @inferred(r .- x) === -1:3 @test @inferred(x .- r) === 1:-1:-3 - @test @inferred(x .* r) === 2:2:10 - @test @inferred(r .* x) === 2:2:10 + @test @inferred(x .* r) == 2:2:10 + @test @inferred(r .* x) == 2:2:10 @test @inferred(r ./ x) === 0.5:0.5:2.5 @test @inferred(x ./ r) == 2 ./ [r;] && isa(x ./ r, Vector{Float64}) @test @inferred(r .\ x) == 2 ./ [r;] && isa(x ./ r, Vector{Float64}) @test @inferred(x .\ r) === 0.5:0.5:2.5 - @test @inferred(2 .* (r .+ 1) .+ 2) === 6:2:14 + @test @inferred(2 .* (r .+ 1) .+ 2) == 6:2:14 end @testset "Bad range calls" begin @@ -1564,17 +1565,35 @@ end # module NonStandardIntegerRangeTest end @testset "constant-valued ranges (issues #10391 and #29052)" begin - for r in ((1:4), (1:1:4), (1.0:4.0)) - is_int = eltype(r) === Int - @test @inferred(0 * r) == [0.0, 0.0, 0.0, 0.0] broken=is_int - @test @inferred(0 .* r) == [0.0, 0.0, 0.0, 0.0] broken=is_int - @test @inferred(r + (4:-1:1)) == [5.0, 5.0, 5.0, 5.0] broken=is_int - @test @inferred(r .+ (4:-1:1)) == [5.0, 5.0, 5.0, 5.0] broken=is_int + @testset "with $(nameof(typeof(r))) of $(eltype(r))" for r in ((1:4), (1:1:4), StepRangeLen(1,1,4), (1.0:4.0)) + @test @inferred(0 * r) == [0.0, 0.0, 0.0, 0.0] + @test @inferred(0 .* r) == [0.0, 0.0, 0.0, 0.0] + @test @inferred(r .* 0) == [0.0, 0.0, 0.0, 0.0] + @test @inferred(r + (4:-1:1)) == [5.0, 5.0, 5.0, 5.0] + @test @inferred(r .+ (4:-1:1)) == [5.0, 5.0, 5.0, 5.0] + @test @inferred(r - r) == [0.0, 0.0, 0.0, 0.0] + @test @inferred(r .- r) == [0.0, 0.0, 0.0, 0.0] + @test @inferred(r .+ (4.0:-1:1)) == [5.0, 5.0, 5.0, 5.0] @test @inferred(0.0 * r) == [0.0, 0.0, 0.0, 0.0] @test @inferred(0.0 .* r) == [0.0, 0.0, 0.0, 0.0] @test @inferred(r / Inf) == [0.0, 0.0, 0.0, 0.0] @test @inferred(r ./ Inf) == [0.0, 0.0, 0.0, 0.0] + + @test eval(Meta.parse(repr(0 * r))) == [0.0, 0.0, 0.0, 0.0] + + # Not constant-valued, but related methods: + @test @inferred(-1 * r) == [-1,-2,-3,-4] + @test @inferred(r * -1) == [-1,-2,-3,-4] + @test @inferred(r / -1) == [-1,-2,-3,-4] + + @test @inferred(-1.0 .* r) == [-1,-2,-3,-4] + @test @inferred(r .* -1.0) == [-1,-2,-3,-4] + @test @inferred(r ./ -1.0) == [-1,-2,-3,-4] + + @test @inferred(-1 * reverse(r)) == [-4,-3,-2,-1] + @test @inferred(-1.0 .* reverse(r)) == [-4,-3,-2,-1] + @test @inferred(reverse(r) ./ -1.0) == [-4,-3,-2,-1] end @test_broken @inferred(range(0, step=0, length=4)) == [0, 0, 0, 0] @@ -1587,7 +1606,7 @@ end @test @inferred(range(0.0, stop=0, length=4)) == [0.0, 0.0, 0.0, 0.0] z4 = 0.0 * (1:4) - @test @inferred(z4 .+ (1:4)) === 1.0:1.0:4.0 + @test @inferred(z4 .+ (1:4)) == 1.0:1.0:4.0 @test @inferred(z4 .+ z4) === z4 end @@ -1889,3 +1908,15 @@ end @test_throws BoundsError r[true:true:false] @test_throws BoundsError r[true:true:true] end + +@testset "PR 40320 fixes" begin + # found by nanosoldier + @test 0.2 * (-2:2) == -0.4:0.2:0.4 # from tests of AbstractFFTs, needs Base.TwicePrecision + @test 0.2f0 * (-2:2) == Float32.(-0.4:0.2:0.4) # likewise needs Float64 + @test 0.2 * (-2:1:2) == -0.4:0.2:0.4 + + # https://github.com/JuliaLang/julia/issues/40846 + @test 0.1 .* (3:-1:1) ≈ [0.3, 0.2, 0.1] + @test (10:-1:1) * 0.1 == 1:-0.1:0.1 + @test 0.2 * (-2:2:2) == [-0.4, 0, 0.4] +end diff --git a/test/ryu.jl b/test/ryu.jl index d5a8df24bd03b1..cf60e4867e2362 100644 --- a/test/ryu.jl +++ b/test/ryu.jl @@ -549,9 +549,9 @@ end # Float16 @test Ryu.writefixed(1.0, 1, false, false, false, UInt8('.'), true) == "1" @test Ryu.writefixed(2.0, 1, false, false, false, UInt8('.'), true) == "2" - @show Ryu.writefixed(1.25e+5, 0, false, false, false, UInt8('.'), true) == "125000" - @show Ryu.writefixed(1.25e+5, 1, false, false, false, UInt8('.'), true) == "125000" - @show Ryu.writefixed(1.25e+5, 2, false, false, false, UInt8('.'), true) == "125000" + @test Ryu.writefixed(1.25e+5, 0, false, false, false, UInt8('.'), true) == "125000" + @test Ryu.writefixed(1.25e+5, 1, false, false, false, UInt8('.'), true) == "125000" + @test Ryu.writefixed(1.25e+5, 2, false, false, false, UInt8('.'), true) == "125000" end end # fixed diff --git a/test/show.jl b/test/show.jl index 2dde201b06dfb7..6990323afd1da4 100644 --- a/test/show.jl +++ b/test/show.jl @@ -2011,7 +2011,7 @@ let src = code_typed(my_fun28173, (Int,), debuginfo=:source)[1][1] io = IOBuffer() Base.IRShow.show_ir(io, ir, Base.IRShow.default_config(ir; verbose_linetable=true)) seekstart(io) - @test count(contains(r"my_fun28173 at a{80}:\d+"), eachline(io)) == 9 + @test count(contains(r"@ a{80}:\d+ within `my_fun28173"), eachline(io)) == 10 end # Verify that extra instructions at the end of the IR @@ -2286,3 +2286,14 @@ end s = sprint(show, MIME("text/plain"), Function) @test s == "Function" end + +@testset "printing inline n-dimensional arrays and one-column matrices" begin + @test replstr([Int[1 2 3 ;;; 4 5 6]]) == "1-element Vector{Array{$Int, 3}}:\n [1 2 3;;; 4 5 6]" + @test replstr([Int[1 2 3 ;;; 4 5 6;;;;]]) == "1-element Vector{Array{$Int, 4}}:\n [1 2 3;;; 4 5 6;;;;]" + @test replstr([fill(1, (20,20,20))]) == "1-element Vector{Array{$Int, 3}}:\n [1 1 … 1 1; 1 1 … 1 1; … ; 1 1 … 1 1; 1 1 … 1 1;;; 1 1 … 1 1; 1 1 … 1 1; … ; 1 1 … 1 1; 1 1 … 1 1;;; 1 1 … 1 1; 1 1 … 1 1; … ; 1 1 … 1 1; 1 1 … 1 1;;; … ;;; 1 1 … 1 1; 1 1 … 1 1; … ; 1 1 … 1 1; 1 1 … 1 1;;; 1 1 … 1 1; 1 1 … 1 1; … ; 1 1 … 1 1; 1 1 … 1 1;;; 1 1 … 1 1; 1 1 … 1 1; … ; 1 1 … 1 1; 1 1 … 1 1]" + @test replstr([fill(1, 5, 1)]) == "1-element Vector{Matrix{$Int}}:\n [1; 1; … ; 1; 1;;]" + @test replstr([fill(1, 5, 2)]) == "1-element Vector{Matrix{$Int}}:\n [1 1; 1 1; … ; 1 1; 1 1]" + @test replstr([[1;]]) == "1-element Vector{Vector{$Int}}:\n [1]" + @test replstr([[1;;]]) == "1-element Vector{Matrix{$Int}}:\n [1;;]" + @test replstr([[1;;;]]) == "1-element Vector{Array{$Int, 3}}:\n [1;;;]" +end diff --git a/test/spawn.jl b/test/spawn.jl index 75c7252ab673e8..e6dae394cbd2b2 100644 --- a/test/spawn.jl +++ b/test/spawn.jl @@ -697,7 +697,15 @@ let text = "input-test-text" @test read(proc, String) == string(length(text), '\n') @test success(proc) @test String(take!(b)) == text + + out = PipeBuffer() + proc = run(catcmd, IOBuffer(SubString(text)), out) + @test success(proc) + @test proc.out === proc.err === proc.in === devnull + @test String(take!(out)) == text end + + @test repr(Base.CmdRedirect(``, devnull, 0, false)) == "pipeline(``, stdin>Base.DevNull())" @test repr(Base.CmdRedirect(``, devnull, 1, true)) == "pipeline(``, stdout