diff --git a/README.md b/README.md index 40a3405..cff9feb 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ These BLAS libraries are known to work with libblastrampoline (successfully test 5. Fujitsu BLAS (use in Julia through [FujitsuBLAS.jl](https://github.com/giordano/FujitsuBLAS.jl)) 6. [ARMPL BLAS](https://developer.arm.com/Tools%20and%20Software/Arm%20Performance%20Libraries) 7. [NVPL BLAS](https://docs.nvidia.com/nvpl/_static/blas/) +8. [Reference BLAS and LAPACK](https://github.com/Reference-LAPACK/lapack) ## Basic usage diff --git a/test/Project.toml b/test/Project.toml index 4e0d3c2..d39e16d 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,9 +1,13 @@ [deps] Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" CompilerSupportLibraries_jll = "e66e0078-7015-5450-92f7-15fbd957f2ae" +LAPACK32_jll = "17f450c3-bd24-55df-bb84-8c51b4b939e3" +LAPACK_jll = "51474c39-65e3-53ba-86ba-03b1b862ec14" MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7" OpenBLAS32_jll = "656ef2d0-ae68-5445-9ca0-591084a874a2" OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363" +ReferenceBLAS32_jll = "9e84b91c-71b0-5f24-acdc-49dbe8049396" +ReferenceBLAS_jll = "ee697234-451c-51c9-b102-303d89a9c3a0" # Force an old version of OpenBLAS32_jll so that it's missing some newer symbols [compat] diff --git a/test/dpstrf_test/dpstrf_test.c b/test/dpstrf_test/dpstrf_test.c index e43a661..a151fc8 100644 --- a/test/dpstrf_test/dpstrf_test.c +++ b/test/dpstrf_test/dpstrf_test.c @@ -41,7 +41,11 @@ int main() // return value MANGLE(dpstrf_)("U", &order, &A[0][0], &lda, &pivot[0], &rank, &tol, &work[0], &info); if (info != 0) { - printf("ERROR: info == %ld!\n", info); + #ifdef ILP64 + printf("ERROR: info == %ld!\n", info); + #else + printf("ERROR: info == %d!\n", info); + #endif return 1; } diff --git a/test/runtests.jl b/test/runtests.jl index ec0a442..a93a258 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,5 @@ using OpenBLAS_jll, OpenBLAS32_jll, MKL_jll, CompilerSupportLibraries_jll +using ReferenceBLAS32_jll, LAPACK32_jll, ReferenceBLAS_jll, LAPACK_jll using Pkg, Artifacts, Base.BinaryPlatforms, Libdl, Test include("utils.jl") @@ -124,6 +125,14 @@ end run_all_tests("openblas", reverse(OpenBLAS32_jll.LIBPATH_list), :LP64, "") end +@testset "Vanilla ReferenceBLAS32_jll (LP64)" begin + run_all_tests("blas32", reverse(ReferenceBLAS32_jll.LIBPATH_list), :LP64, "", tests = [dgemm, sdot]) +end + +# @testset "Vanilla ReferenceBLAS_jll (ILP64)" begin +# run_all_tests("blas", reverse(ReferenceBLAS_jll.LIBPATH_list), :ILP64, "", tests = [dgemm, sdot]) +# end + # Next, build a version that links against `libblastrampoline`, and tell # the trampoline to forwards calls to `OpenBLAS_jll` lbt_link_name, lbt_dir = build_libblastrampoline() @@ -170,6 +179,17 @@ end end end +@testset "LBT -> ReferenceBLAS32_jll / LAPACK32_jll (LP64)" begin + libdirs = unique(vcat(lbt_dir, ReferenceBLAS32_jll.LIBPATH_list..., LAPACK32_jll.LIBPATH_list..., CompilerSupportLibraries_jll.LIBPATH_list...)) + run_all_tests(blastrampoline_link_name(), libdirs, :LP64, string(ReferenceBLAS32_jll.libblas32_path, ";", LAPACK32_jll.liblapack32_path); tests = [dgemm, dpstrf, sgesv, sdot]) +end + +# Disabling these tests for now, until we rename `libblas.so` and `liblapack.so` to `libblas64.so` and `liblapack64.so` in Yggdrasil. +# @testset "LBT -> ReferenceBLAS_jll / LAPACK_jll (ILP64)" begin +# libdirs = unique(vcat(lbt_dir, ReferenceBLAS_jll.LIBPATH_list..., LAPACK_jll.LIBPATH_list..., CompilerSupportLibraries_jll.LIBPATH_list...)) +# run_all_tests(blastrampoline_link_name(), libdirs, :ILP64, string(ReferenceBLAS_jll.libblas_path, ";", LAPACK_jll.liblapack_path); tests = [dgemm, dpstrf, sgesv, sdot]) +# end + # Test against MKL_jll using `libmkl_rt`, which is :LP64 by default if MKL_jll.is_available() # On i686, we can't do complex return style autodetection, so we manually set it, @@ -178,6 +198,7 @@ if MKL_jll.is_available() if Sys.ARCH == :i686 extra_env["LBT_FORCE_RETSTYLE"] = "ARGUMENT" end + @testset "LBT -> MKL_jll (LP64)" begin libdirs = unique(vcat(lbt_dir, MKL_jll.LIBPATH_list..., CompilerSupportLibraries_jll.LIBPATH_list...)) run_all_tests(blastrampoline_link_name(), libdirs, :LP64, MKL_jll.libmkl_rt_path; tests = [dgemm, dgemmt, dpstrf, sgesv, sdot, cdotc], extra_env)