@@ -19,6 +19,8 @@ using Base: IndexLinear, promote_eltype, promote_op, promote_typeof,
1919 @propagate_inbounds , @pure , reduce, typed_hvcat, typed_vcat, require_one_based_indexing,
2020 splat
2121using Base. Broadcast: Broadcasted, broadcasted
22+ using OpenBLAS_jll
23+ using libblastrampoline_jll
2224import Libdl
2325
2426export
@@ -563,42 +565,9 @@ function versioninfo(io::IO=stdout)
563565 return nothing
564566end
565567
566- function find_library_path (name)
567- shlib_ext = string (" ." , Libdl. dlext)
568- if ! endswith (name, shlib_ext)
569- name_ext = string (name, shlib_ext)
570- end
571-
572- # On windows, we look in `bin` and never in `lib`
573- @static if Sys. iswindows ()
574- path = joinpath (Sys. BINDIR, name_ext)
575- isfile (path) && return path
576- else
577- # On other platforms, we check `lib/julia` first, and if that doesn't exist, `lib`.
578- path = joinpath (Sys. BINDIR, Base. LIBDIR, " julia" , name_ext)
579- isfile (path) && return path
580-
581- path = joinpath (Sys. BINDIR, Base. LIBDIR, name_ext)
582- isfile (path) && return path
583- end
584-
585- # If we can't find it by absolute path, we'll try just passing this straight through to `dlopen()`
586- return name
587- end
588-
589568function __init__ ()
590569 try
591- libblas_path = find_library_path (Base. libblas_name)
592- liblapack_path = find_library_path (Base. liblapack_name)
593- # We manually `dlopen()` these libraries here, so that we search with `libjulia-internal`'s
594- # `RPATH` and not `libblastrampoline's`. Once it's been opened, when LBT tries to open it,
595- # it will find the library already loaded.
596- libblas_path = Libdl. dlpath (Libdl. dlopen (libblas_path))
597- BLAS. lbt_forward (libblas_path; clear= true )
598- if liblapack_path != libblas_path
599- liblapack_path = Libdl. dlpath (Libdl. dlopen (liblapack_path))
600- BLAS. lbt_forward (liblapack_path)
601- end
570+ BLAS. lbt_forward (OpenBLAS_jll. libopenblas_path; clear= true )
602571 BLAS. check ()
603572 catch ex
604573 Base. showerror_nostdio (ex, " WARNING: Error during initialization of module LinearAlgebra" )
0 commit comments