Skip to content

Commit 2ae7892

Browse files
committed
Add SuiteSparse
1 parent 2ba0b74 commit 2ae7892

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ Currently, the `@compat` macro supports the following syntaxes:
104104
* `using Compat.IterativeEigensolvers` is provided on versions older than 0.7, where this
105105
library is not yet a part of the standard library. ([#24714])
106106

107+
* `using Compat.SuiteSparse` is provided on versions older than 0.7, where this library is
108+
not yet part of the standard library ([#24648]).
109+
107110
## New functions, macros, and methods
108111

109112
* `@views` takes an expression and converts all slices to views ([#20164]), while
@@ -397,6 +400,7 @@ includes this fix. Find the minimum version from there.
397400
[#24459]: https://github.com/JuliaLang/julia/issues/24459
398401
[#24605]: https://github.com/JuliaLang/julia/issues/24605
399402
[#24647]: https://github.com/JuliaLang/julia/issues/24647
403+
[#24648]: https://github.com/JuliaLang/julia/issues/24648
400404
[#24652]: https://github.com/JuliaLang/julia/issues/24652
401405
[#24657]: https://github.com/JuliaLang/julia/issues/24657
402406
[#24714]: https://github.com/JuliaLang/julia/issues/24714

src/Compat.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,17 @@ else
781781
import IterativeEigensolvers
782782
end
783783

784+
if VERSION < v"0.7.0-DEV.2609"
785+
@eval module SuiteSparse
786+
if Base.USE_GPL_LIBS
787+
using Base.SparseArrays: CHOLMOD, SPQR, UMFPACK
788+
end
789+
using Base.SparseArrays: increment, increment!, decrement, decrement!
790+
end
791+
else
792+
import SuiteSparse
793+
end
794+
784795
# 0.7.0-DEV.1993
785796
@static if !isdefined(Base, :EqualTo)
786797
if VERSION >= v"0.6.0"

test/runtests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,14 @@ module Test24714
922922
@test isdefined(@__MODULE__, :svds)
923923
end
924924

925+
# 0.7
926+
module Test24648
927+
using Compat
928+
using Compat.Test
929+
using Compat.SuiteSparse
930+
@test isdefined(@__MODULE__, :SuiteSparse)
931+
end
932+
925933
let a = [0,1,2,3,0,1,2,3]
926934
@test findfirst(equalto(3), [1,2,4,1,2,3,4]) == 6
927935
@test findfirst(!equalto(1), [1,2,4,1,2,3,4]) == 2

0 commit comments

Comments
 (0)