Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backporting the libblas and vendor() improvements to 1.8 #44467

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b9982a8
Make sure `range(start; step, length)` uses TwicePrecision when possi…
jipolanco Feb 23, 2022
7731773
Cache external CodeInstances (#43990)
timholy Feb 24, 2022
456e76c
Add Pkg 1.8 news (#44370)
IanButterworth Feb 28, 2022
8919242
Fix hyperlinks in 1.8 news (#44371)
bluesmoon Feb 28, 2022
db0cdf8
Add NEWS on precompilation (#44325)
timholy Mar 3, 2022
8615223
Update LBT to 5.0.1 for source build (#44258)
ViralBShah Feb 19, 2022
6681008
Regenerate all the checksums (#44275)
ViralBShah Feb 21, 2022
583f2e9
Documentation: added example to the function hasfield. (From #41782) …
ViralBShah Feb 23, 2022
51db9bd
[OpenBLAS_jll] Update to v0.3.20 (#44321)
giordano Feb 24, 2022
deb3049
fix #43411, wrapped `NamedTuple` can be bitstype more often (#44311)
JeffBezanson Feb 24, 2022
e3a126a
[macOS] Codesign binary-dist tarballs (#44305)
staticfloat Feb 24, 2022
10c27af
Make sure all the relocations are filled in for partially cloned targ…
yuyichao Feb 25, 2022
5db0041
fix #44328: method validation for opaque closures (#44335)
simeonschaub Mar 1, 2022
e54b04a
Update BLAS.vendor() to return :lbt
ViralBShah Mar 3, 2022
5bb9e64
Fix memory error during precompilation (#44345)
timholy Mar 3, 2022
b2dd618
asan,build: fix linker flags for -fsanitize builds (#44420)
vtjnash Mar 3, 2022
b1312f6
add jl_egal and jl_gc_safepoint back to exports list (#44419)
vtjnash Mar 3, 2022
d611460
Clarify the behavior of `@threads for` (#44168)
tkf Mar 3, 2022
62e55d7
fix error show edge case (#44319)
oscardssmith Mar 3, 2022
4b33571
optimizer: bail out of inlining if ir_inline_unionsplit will fail (#4…
vtjnash Mar 4, 2022
fb69baf
Revert "Update BLAS.vendor() to return :lbt"
Mar 4, 2022
dc38ba5
Simplification of libblastrampoline stuff in LinearAlgebra (#44360)
ViralBShah Feb 28, 2022
0adbba6
Update BLAS.vendor() to return :lbt
ViralBShah Mar 3, 2022
a308435
cleanup
ViralBShah Mar 4, 2022
91df58f
Add more negative stride support to BLAS Level 1/2 functions (#42957)
N5N3 Feb 20, 2022
ed2f553
Merge branch 'backports-release-1.8' into vs/libblas-1.8
ViralBShah Mar 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ Standard library changes
As a consequence, products of bi-, tri- and symmetric tridiagonal matrices with each
other result in dense output. Moreover, constructing 3-arg similar matrices of special
"sparse" matrices of (nonstatic) matrices now fails for the lack of `zero(::Type{Matrix{T}})`.
* We are now wholly reliant on libblastrampoline (LBT) for calling
BLAS and LAPACK. OpenBLAS is shipped by default, but building the
system image with other BLAS/LAPACK libraries is not
supported. Instead, it is recommended that the LBT mechanism be used
for swapping BLAS/LAPACK with vendor provided ones. ([#44360])

#### Printf

Expand Down
4 changes: 4 additions & 0 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ end
include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "build_h.jl")) # include($BUILDROOT/base/build_h.jl)
include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "version_git.jl")) # include($BUILDROOT/base/version_git.jl)

# These used to be in build_h.jl and are retained for backwards compatibility
const libblas_name = "libblastrampoline"
const liblapack_name = "libblastrampoline"

# numeric operations
include("hashing.jl")
include("rounding.jl")
Expand Down
2 changes: 0 additions & 2 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ else
@echo "const MACHINE = \"$(XC_HOST)\"" >> $@
endif
@echo "const libm_name = \"$(LIBMNAME)\"" >> $@
@echo "const libblas_name = \"$(LIBBLASNAME)\"" >> $@
@echo "const liblapack_name = \"$(LIBLAPACKNAME)\"" >> $@
ifeq ($(USE_BLAS64), 1)
@echo "const USE_BLAS64 = true" >> $@
else
Expand Down
1 change: 1 addition & 0 deletions base/twiceprecision.jl
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ range_start_step_length(a::IEEEFloat, st::Real, len::Integer) =
range_start_step_length(a::IEEEFloat, st::IEEEFloat, len::Integer) =
range_start_step_length(promote(a, st)..., len)


function range_start_step_length(a::T, st::T, len::Integer) where T<:IEEEFloat
len = len + 0 # promote with Int
start_n, start_d = rat(a)
Expand Down
1 change: 1 addition & 0 deletions stdlib/LinearAlgebra/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
[deps]
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
libblastrampoline_jll = "8e850b90-86db-534c-a0d3-1478176c7d93"
OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
37 changes: 3 additions & 34 deletions stdlib/LinearAlgebra/src/LinearAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ using Base: IndexLinear, promote_eltype, promote_op, promote_typeof,
@propagate_inbounds, @pure, reduce, typed_hvcat, typed_vcat, require_one_based_indexing,
splat
using Base.Broadcast: Broadcasted, broadcasted
using OpenBLAS_jll
using libblastrampoline_jll
import Libdl

export
Expand Down Expand Up @@ -539,42 +541,9 @@ function versioninfo(io::IO=stdout)
return nothing
end

function find_library_path(name)
shlib_ext = string(".", Libdl.dlext)
if !endswith(name, shlib_ext)
name_ext = string(name, shlib_ext)
end

# On windows, we look in `bin` and never in `lib`
@static if Sys.iswindows()
path = joinpath(Sys.BINDIR, name_ext)
isfile(path) && return path
else
# On other platforms, we check `lib/julia` first, and if that doesn't exist, `lib`.
path = joinpath(Sys.BINDIR, Base.LIBDIR, "julia", name_ext)
isfile(path) && return path

path = joinpath(Sys.BINDIR, Base.LIBDIR, name_ext)
isfile(path) && return path
end

# If we can't find it by absolute path, we'll try just passing this straight through to `dlopen()`
return name
end

function __init__()
try
libblas_path = find_library_path(Base.libblas_name)
liblapack_path = find_library_path(Base.liblapack_name)
# We manually `dlopen()` these libraries here, so that we search with `libjulia-internal`'s
# `RPATH` and not `libblastrampoline's`. Once it's been opened, when LBT tries to open it,
# it will find the library already loaded.
libblas_path = Libdl.dlpath(Libdl.dlopen(libblas_path))
BLAS.lbt_forward(libblas_path; clear=true)
if liblapack_path != libblas_path
liblapack_path = Libdl.dlpath(Libdl.dlopen(liblapack_path))
BLAS.lbt_forward(liblapack_path)
end
BLAS.lbt_forward(OpenBLAS_jll.libopenblas_path; clear=true)
BLAS.check()
catch ex
Base.showerror_nostdio(ex, "WARNING: Error during initialization of module LinearAlgebra")
Expand Down
Loading