Skip to content

Commit 332d316

Browse files
committed
Load LBT to call LAPACK functions
1 parent ca1a1ef commit 332d316

File tree

4 files changed

+93
-69
lines changed

4 files changed

+93
-69
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
env:
3+
JULIA_NUM_THREADS: 2
4+
on:
5+
pull_request:
6+
branches:
7+
- master
8+
push:
9+
branches:
10+
- master
11+
tags: '*'
12+
jobs:
13+
test:
14+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
version:
20+
- '1'
21+
os:
22+
- ubuntu-latest
23+
- macos-latest
24+
- windows-latest
25+
arch:
26+
- x64
27+
steps:
28+
- uses: actions/checkout@v2
29+
- uses: julia-actions/setup-julia@v1
30+
with:
31+
version: ${{ matrix.version }}
32+
arch: ${{ matrix.arch }}
33+
- uses: actions/cache@v1
34+
env:
35+
cache-name: cache-artifacts
36+
with:
37+
path: ~/.julia/artifacts
38+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
39+
restore-keys: |
40+
${{ runner.os }}-test-${{ env.cache-name }}-
41+
${{ runner.os }}-test-
42+
${{ runner.os }}-
43+
- uses: julia-actions/julia-buildpkg@v1
44+
- uses: julia-actions/julia-runtest@v1
45+
- uses: julia-actions/julia-processcoverage@v1
46+
- uses: codecov/codecov-action@v1
47+
with:
48+
file: lcov.info
49+
docs:
50+
name: Documentation
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v2
54+
- uses: julia-actions/setup-julia@v1
55+
with:
56+
version: '1'
57+
- run: |
58+
julia --project=docs -e '
59+
using Pkg
60+
Pkg.develop(PackageSpec(path=pwd()))
61+
Pkg.instantiate()'
62+
- run: |
63+
julia --project=docs -e '
64+
using Documenter: doctest
65+
using GenericLinearAlgebra
66+
doctest(GenericLinearAlgebra)'
67+
- run: julia --project=docs docs/make.jl
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
name = "GenericLinearAlgebra"
22
uuid = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
3-
version = "0.2.7"
3+
version = "0.3.0"
44

55
[deps]
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
77
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
88
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
9+
libblastrampoline_jll = "8e850b90-86db-534c-a0d3-1478176c7d93"
910

1011
[compat]
11-
julia = "1.3"
12+
julia = "1.7"
1213

1314
[extras]
1415
Quaternions = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0"

src/lapack.jl

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
module LAPACK2
22

3+
using libblastrampoline_jll
34
using LinearAlgebra
45
using LinearAlgebra: BlasInt, chkstride1, LAPACKException
56
using LinearAlgebra.BLAS: @blasfunc
67
using LinearAlgebra.LAPACK: chkdiag, chkside, chkuplo
78

9+
liblapack_name = libblastrampoline_jll.libblastrampoline
10+
811
## Standard QR/QL
912
function steqr!(compz::Char,
1013
d::StridedVector{Float64},
@@ -34,7 +37,7 @@ module LAPACK2
3437
# Allocations
3538
info = Vector{BlasInt}(undef, 1)
3639

37-
ccall((@blasfunc("dsteqr_"), Base.liblapack_name),Cvoid,
40+
ccall((@blasfunc("dsteqr_"), liblapack_name),Cvoid,
3841
(Ref{UInt8}, Ref{BlasInt}, Ptr{Float64}, Ptr{Float64},
3942
Ptr{Float64}, Ref{BlasInt}, Ptr{Float64}, Ptr{BlasInt}),
4043
compz, n, d, e,
@@ -56,7 +59,7 @@ module LAPACK2
5659
# Allocations
5760
info = BlasInt[0]
5861

59-
ccall((@blasfunc("dsterf_"), Base.liblapack_name), Cvoid,
62+
ccall((@blasfunc("dsterf_"), liblapack_name), Cvoid,
6063
(Ref{BlasInt}, Ptr{Float64}, Ptr{Float64}, Ptr{BlasInt}),
6164
n, d, e, info)
6265

@@ -87,7 +90,7 @@ module LAPACK2
8790
# Allocations
8891
info = BlasInt[0]
8992

90-
ccall((@blasfunc("dstedc_"), Base.liblapack_name), Cvoid,
93+
ccall((@blasfunc("dstedc_"), liblapack_name), Cvoid,
9194
(Ref{UInt8}, Ref{BlasInt}, Ptr{Float64}, Ptr{Float64},
9295
Ptr{Float64}, Ref{BlasInt}, Ptr{Float64}, Ref{BlasInt},
9396
Ptr{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}),
@@ -153,7 +156,7 @@ module LAPACK2
153156
tryrac = BlasInt[1]
154157
info = Vector{BlasInt}(undef, 1)
155158

156-
ccall((@blasfunc($lsymb), Base.liblapack_name), Cvoid,
159+
ccall((@blasfunc($lsymb), liblapack_name), Cvoid,
157160
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty},
158161
Ptr{$elty}, Ref{$elty}, Ref{$elty}, Ref{BlasInt},
159162
Ref{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty},
@@ -242,7 +245,7 @@ module LAPACK2
242245

243246
info = Ref{BlasInt}(0)
244247

245-
ccall((@blasfunc("dlahqr_"), Base.liblapack_name), Cvoid,
248+
ccall((@blasfunc("dlahqr_"), liblapack_name), Cvoid,
246249
(Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt},
247250
Ref{BlasInt}, Ptr{Float64}, Ref{BlasInt}, Ptr{Float64},
248251
Ptr{Float64}, Ref{BlasInt}, Ref{BlasInt}, Ptr{Float64},
@@ -295,7 +298,7 @@ module LAPACK2
295298

296299
info = Vector{BlasInt}(undef, 1)
297300

298-
ccall((@blasfunc(:dpteqr_), Base.liblapack_name), Cvoid,
301+
ccall((@blasfunc(:dpteqr_), liblapack_name), Cvoid,
299302
(Ref{UInt8}, Ref{BlasInt}, Ptr{Float64}, Ptr{Float64},
300303
Ptr{Float64}, Ref{BlasInt}, Ptr{Float64}, Ptr{BlasInt}),
301304
compz, n, d, e,
@@ -321,7 +324,7 @@ module LAPACK2
321324
liwork = BlasInt(-1)
322325
info = BlasInt[0]
323326
for i = 1:2
324-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
327+
ccall((@blasfunc($f), liblapack_name), Cvoid,
325328
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty},
326329
Ref{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ref{BlasInt},
327330
Ptr{BlasInt}, Ref{BlasInt}, Ptr{BlasInt}),
@@ -359,7 +362,7 @@ module LAPACK2
359362
liwork = BlasInt(-1)
360363
info = BlasInt[0]
361364
for i = 1:2
362-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
365+
ccall((@blasfunc($f), liblapack_name), Cvoid,
363366
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty},
364367
Ref{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ref{BlasInt},
365368
Ptr{$relty}, Ref{BlasInt}, Ptr{BlasInt}, Ref{BlasInt},
@@ -443,7 +446,7 @@ for (f, elty) in ((:dtgevc_, :Float64),
443446
m = BlasInt[0]
444447
info = BlasInt[0]
445448

446-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
449+
ccall((@blasfunc($f), liblapack_name), Cvoid,
447450
(Ref{UInt8}, Ref{UInt8}, Ptr{BlasInt}, Ref{BlasInt},
448451
Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt},
449452
Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt},
@@ -520,7 +523,7 @@ for (f, elty, relty) in ((:dsfrk_, :Float64, :Float64),
520523
end
521524
lda = max(1, stride(A, 2))
522525

523-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
526+
ccall((@blasfunc($f), liblapack_name), Cvoid,
524527
(Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt},
525528
Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt},
526529
Ref{$relty}, Ptr{$elty}),
@@ -544,7 +547,7 @@ for (f, elty) in ((:dpftrf_, :Float64),
544547
n = round(Int,div(sqrt(8length(A)), 2))
545548
info = Vector{BlasInt}(undef, 1)
546549

547-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
550+
ccall((@blasfunc($f), liblapack_name), Cvoid,
548551
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty},
549552
Ptr{BlasInt}),
550553
transr, uplo, n, A,
@@ -566,7 +569,7 @@ for (f, elty) in ((:dpftri_, :Float64),
566569
n = round(Int,div(sqrt(8length(A)), 2))
567570
info = Vector{BlasInt}(undef, 1)
568571

569-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
572+
ccall((@blasfunc($f), liblapack_name), Cvoid,
570573
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty},
571574
Ptr{BlasInt}),
572575
transr, uplo, n, A,
@@ -595,7 +598,7 @@ for (f, elty) in ((:dpftrs_, :Float64),
595598
ldb = max(1, stride(B, 2))
596599
info = Vector{BlasInt}(undef, 1)
597600

598-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
601+
ccall((@blasfunc($f), liblapack_name), Cvoid,
599602
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt},
600603
Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}),
601604
transr, uplo, n, nhrs,
@@ -631,7 +634,7 @@ for (f, elty) in ((:dtfsm_, :Float64),
631634
end
632635
ldb = max(1, stride(B, 2))
633636

634-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
637+
ccall((@blasfunc($f), liblapack_name), Cvoid,
635638
(Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{UInt8},
636639
Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty},
637640
Ptr{$elty}, Ptr{$elty}, Ref{BlasInt}),
@@ -657,7 +660,7 @@ for (f, elty) in ((:dtftri_, :Float64),
657660
n = round(Int,div(sqrt(8length(A)), 2))
658661
info = Vector{BlasInt}(undef, 1)
659662

660-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
663+
ccall((@blasfunc($f), liblapack_name), Cvoid,
661664
(Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt},
662665
Ptr{$elty}, Ptr{BlasInt}),
663666
transr, uplo, diag, n,
@@ -681,7 +684,7 @@ for (f, elty) in ((:dtfttr_, :Float64),
681684
info = Vector{BlasInt}(undef, 1)
682685
A = similar(Arf, $elty, n, n)
683686

684-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
687+
ccall((@blasfunc($f), liblapack_name), Cvoid,
685688
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty},
686689
Ptr{$elty}, Ref{BlasInt}, Ptr{BlasInt}),
687690
transr, uplo, n, Arf,
@@ -707,7 +710,7 @@ for (f, elty) in ((:dtrttf_, :Float64),
707710
info = Vector{BlasInt}(undef, 1)
708711
Arf = similar(A, $elty, div(n*(n+1), 2))
709712

710-
ccall((@blasfunc($f), Base.liblapack_name), Cvoid,
713+
ccall((@blasfunc($f), liblapack_name), Cvoid,
711714
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty},
712715
Ref{BlasInt}, Ptr{$elty}, Ptr{BlasInt}),
713716
transr, uplo, n, A,

0 commit comments

Comments
 (0)