diff --git a/Project.toml b/Project.toml index febe90ec4..e1b0e4204 100644 --- a/Project.toml +++ b/Project.toml @@ -62,20 +62,20 @@ ArrayInterface = "7.4.11" BandedMatrices = "1" BlockDiagonals = "0.1" ConcreteStructs = "0.2" -DocStringExtensions = "0.8, 0.9" +DocStringExtensions = "0.9" EnumX = "1" -EnzymeCore = "0.5, 0.6" -FastLapackInterface = "1, 2" +EnzymeCore = "0.6" +FastLapackInterface = "2" GPUArraysCore = "0.1" HYPRE = "1.4.0" InteractiveUtils = "1.6" IterativeSolvers = "0.9.3" Libdl = "1.6" -LinearAlgebra = "1.6" +LinearAlgebra = "1.9" KLU = "0.3.0, 0.4" KernelAbstractions = "0.9" Krylov = "0.9" -KrylovKit = "0.5, 0.6" +KrylovKit = "0.6" MKL = "0.6" PrecompileTools = "1" Preferences = "1" @@ -83,12 +83,12 @@ RecursiveArrayTools = "2" RecursiveFactorization = "0.2.8" Reexport = "1" Requires = "1" -SciMLBase = "1.82, 2" -SciMLOperators = "0.2, 0.3" -Setfield = "0.7, 0.8, 1" -SparseArrays = "1.6" +SciMLBase = "2" +SciMLOperators = "0.3" +Setfield = "1" +SparseArrays = "1.9" Sparspak = "0.3.6" -SuiteSparse = "1.6" +SuiteSparse = "1.9" UnPack = "1" julia = "1.9" diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index 1b01a52aa..74da6601a 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -46,7 +46,7 @@ PrecompileTools.@recompile_invalidations begin import Preferences end -if VERSION >= v"1.8" && Preferences.@load_preference("TriggerMKLLBT", true) +if Preferences.@load_preference("TriggerMKLLBT", true) using MKL end diff --git a/src/appleaccelerate.jl b/src/appleaccelerate.jl index 819d74cac..b6b089f0f 100644 --- a/src/appleaccelerate.jl +++ b/src/appleaccelerate.jl @@ -209,12 +209,10 @@ end default_alias_A(::AppleAccelerateLUFactorization, ::Any, ::Any) = false default_alias_b(::AppleAccelerateLUFactorization, ::Any, ::Any) = false -const PREALLOCATED_APPLE_LU = @static if VERSION >= v"1.8" +const PREALLOCATED_APPLE_LU = begin A = rand(0, 0) luinst = ArrayInterface.lu_instance(A) LU(luinst.factors, similar(A, Cint, 0), luinst.info), Ref{Cint}() -else - nothing end function LinearSolve.init_cacheval(alg::AppleAccelerateLUFactorization, A, b, u, Pl, Pr, diff --git a/src/default.jl b/src/default.jl index 9de4e8d96..574d81885 100644 --- a/src/default.jl +++ b/src/default.jl @@ -97,11 +97,7 @@ function defaultalg(A::GPUArraysCore.AbstractGPUArray, b, assump::OperatorAssump if assump.condition === OperatorCondition.IllConditioned || !assump.issq DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization) else - @static if VERSION >= v"1.8-" - DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization) - else - DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization) - end + DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization) end end @@ -110,11 +106,7 @@ function defaultalg(A, b::GPUArraysCore.AbstractGPUArray, assump::OperatorAssump if assump.condition === OperatorCondition.IllConditioned || !assump.issq DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization) else - @static if VERSION >= v"1.8-" - DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization) - else - DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization) - end + DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization) end end @@ -124,11 +116,7 @@ function defaultalg(A::GPUArraysCore.AbstractGPUArray, b::GPUArraysCore.Abstract if assump.condition === OperatorCondition.IllConditioned || !assump.issq DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization) else - @static if VERSION >= v"1.8-" - DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization) - else - DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization) - end + DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization) end end @@ -162,7 +150,7 @@ function defaultalg(A, b, assump::OperatorAssumptions) __conditioning(assump) === OperatorCondition.WellConditioned) if length(b) <= 10 DefaultAlgorithmChoice.GenericLUFactorization - elseif VERSION >= v"1.8" && appleaccelerate_isavailable() + elseif appleaccelerate_isavailable() DefaultAlgorithmChoice.AppleAccelerateLUFactorization elseif (length(b) <= 100 || (isopenblas() && length(b) <= 500) || (usemkl && length(b) <= 200)) && @@ -327,11 +315,7 @@ function defaultalg_symbol(::Type{T}) where {T} end defaultalg_symbol(::Type{<:GenericFactorization{typeof(ldlt!)}}) = :LDLtFactorization -@static if VERSION >= v"1.7" - defaultalg_symbol(::Type{<:QRFactorization{ColumnNorm}}) = :QRFactorizationPivoted -else - defaultalg_symbol(::Type{<:QRFactorization{Val{true}}}) = :QRFactorizationPivoted -end +defaultalg_symbol(::Type{<:QRFactorization{ColumnNorm}}) = :QRFactorizationPivoted """ if alg.alg === DefaultAlgorithmChoice.LUFactorization diff --git a/src/deprecated.jl b/src/deprecated.jl index 5b048e586..a9bd5a846 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -79,13 +79,6 @@ function set_cacheval(cache::LinearCache, alg_cache) end end -@static if VERSION >= v"1.9" # qualified names only supported in Julia 1.9 - @deprecate SciMLBase.solve(cache::LinearCache, args...; kwargs...) SciMLBase.solve!(cache::LinearCache, - args...; - kwargs...) false -else - function SciMLBase.solve(cache::LinearCache, args...; kwargs...) - @warn "SciMLBase.solve(cache::LinearCache, args...; kwargs...) is deprecated for SciMLBase.solve!(cache::LinearCache, args...; kwargs...) to follow the CommonSolve.jl interface." - SciMLBase.solve!(cache::LinearCache, args...; kwargs...) - end -end +@deprecate SciMLBase.solve(cache::LinearCache, args...; kwargs...) SciMLBase.solve!(cache::LinearCache, + args...; + kwargs...) false diff --git a/src/extension_algs.jl b/src/extension_algs.jl index 209d72d85..d2e968911 100644 --- a/src/extension_algs.jl +++ b/src/extension_algs.jl @@ -51,15 +51,12 @@ sol = solve(prob, alg; Pl = prec) """ struct HYPREAlgorithm <: SciMLLinearSolveAlgorithm solver::Any - - @static if VERSION >= v"1.9-" - function HYPREAlgorithm(solver) - ext = Base.get_extension(@__MODULE__, :LinearSolveHYPREExt) - if ext === nothing - error("HYPREAlgorithm requires that HYPRE is loaded, i.e. `using HYPRE`") - else - return new{}(solver) - end + function HYPREAlgorithm(solver) + ext = Base.get_extension(@__MODULE__, :LinearSolveHYPREExt) + if ext === nothing + error("HYPREAlgorithm requires that HYPRE is loaded, i.e. `using HYPRE`") + else + return new{}(solver) end end end @@ -75,14 +72,12 @@ Requires a sufficiently large `A` to overcome the data transfer costs. Using this solver requires adding the package CUDA.jl, i.e. `using CUDA` """ struct CudaOffloadFactorization <: LinearSolve.AbstractFactorization - @static if VERSION >= v"1.9-" - function CudaOffloadFactorization() - ext = Base.get_extension(@__MODULE__, :LinearSolveCUDAExt) - if ext === nothing - error("CudaOffloadFactorization requires that CUDA is loaded, i.e. `using CUDA`") - else - return new{}() - end + function CudaOffloadFactorization() + ext = Base.get_extension(@__MODULE__, :LinearSolveCUDAExt) + if ext === nothing + error("CudaOffloadFactorization requires that CUDA is loaded, i.e. `using CUDA`") + else + return new{}() end end end @@ -133,83 +128,51 @@ default handling process. This should not be required by most users. """ MKLPardisoIterate(; kwargs...) = PardisoJL(; solver_type = 1, kwargs...) -@static if VERSION >= v"1.9-" - """ - ```julia - PardisoJL(; nprocs::Union{Int, Nothing} = nothing, - solver_type = nothing, - matrix_type = nothing, - iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing, - dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing) - ``` - - A generic method using MKL Pardiso. Specifying `solver_type` is required. - - !!! note - - Using this solver requires adding the package Pardiso.jl, i.e. `using Pardiso` - - ## Keyword Arguments - - For the definition of the keyword arguments, see the Pardiso.jl documentation. - All values default to `nothing` and the solver internally determines the values - given the input types, and these keyword arguments are only for overriding the - default handling process. This should not be required by most users. - """ - struct PardisoJL{T1, T2} <: LinearSolve.SciMLLinearSolveAlgorithm - nprocs::Union{Int, Nothing} - solver_type::T1 - matrix_type::T2 - iparm::Union{Vector{Tuple{Int, Int}}, Nothing} - dparm::Union{Vector{Tuple{Int, Int}}, Nothing} - - function PardisoJL(; nprocs::Union{Int, Nothing} = nothing, +""" +```julia +PardisoJL(; nprocs::Union{Int, Nothing} = nothing, solver_type = nothing, matrix_type = nothing, iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing, dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing) - ext = Base.get_extension(@__MODULE__, :LinearSolvePardisoExt) - if ext === nothing - error("PardisoJL requires that Pardiso is loaded, i.e. `using Pardiso`") - else - T1 = typeof(solver_type) - T2 = typeof(matrix_type) - @assert T1 <: Union{Int, Nothing, ext.Pardiso.Solver} - @assert T2 <: Union{Int, Nothing, ext.Pardiso.MatrixType} - return new{T1, T2}(nprocs, solver_type, matrix_type, iparm, dparm) - end +``` + +A generic method using MKL Pardiso. Specifying `solver_type` is required. + +!!! note + + Using this solver requires adding the package Pardiso.jl, i.e. `using Pardiso` + +## Keyword Arguments + +For the definition of the keyword arguments, see the Pardiso.jl documentation. +All values default to `nothing` and the solver internally determines the values +given the input types, and these keyword arguments are only for overriding the +default handling process. This should not be required by most users. +""" +struct PardisoJL{T1, T2} <: LinearSolve.SciMLLinearSolveAlgorithm + nprocs::Union{Int, Nothing} + solver_type::T1 + matrix_type::T2 + iparm::Union{Vector{Tuple{Int, Int}}, Nothing} + dparm::Union{Vector{Tuple{Int, Int}}, Nothing} + + function PardisoJL(; nprocs::Union{Int, Nothing} = nothing, + solver_type = nothing, + matrix_type = nothing, + iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing, + dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing) + ext = Base.get_extension(@__MODULE__, :LinearSolvePardisoExt) + if ext === nothing + error("PardisoJL requires that Pardiso is loaded, i.e. `using Pardiso`") + else + T1 = typeof(solver_type) + T2 = typeof(matrix_type) + @assert T1 <: Union{Int, Nothing, ext.Pardiso.Solver} + @assert T2 <: Union{Int, Nothing, ext.Pardiso.MatrixType} + return new{T1, T2}(nprocs, solver_type, matrix_type, iparm, dparm) end end -else - """ - ```julia - PardisoJL(; nprocs::Union{Int, Nothing} = nothing, - solver_type = nothing, - matrix_type = nothing, - iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing, - dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing) - ``` - - A generic method using MKL Pardiso. Specifying `solver_type` is required. - - !!! note - - Using this solver requires adding the package Pardiso.jl, i.e. `using Pardiso` - - ## Keyword Arguments - - For the definition of the keyword arguments, see the Pardiso.jl documentation. - All values default to `nothing` and the solver internally determines the values - given the input types, and these keyword arguments are only for overriding the - default handling process. This should not be required by most users. - """ - Base.@kwdef struct PardisoJL <: LinearSolve.SciMLLinearSolveAlgorithm - nprocs::Union{Int, Nothing} = nothing - solver_type::Any = nothing - matrix_type::Any = nothing - iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing - dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing - end end """