Skip to content

Commit 784a8b5

Browse files
authored
Merge pull request Homebrew#183057 from Homebrew/libblastrampoline
libblastrampoline 5.11.0 (new formula)
2 parents fa29271 + 7eda257 commit 784a8b5

File tree

2 files changed

+76
-7
lines changed

2 files changed

+76
-7
lines changed

Formula/j/julia.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ class Julia < Formula
1313
end
1414

1515
bottle do
16-
sha256 cellar: :any, arm64_sonoma: "efb2ea2ecada21f49143e8c3eb041c8311ce9bda20926592b4e9a78eb0858c0d"
17-
sha256 cellar: :any, arm64_ventura: "5cf7165a409134e6558478fe759a1d0033dae6e92bfc723ba95e85ae02068828"
18-
sha256 cellar: :any, arm64_monterey: "21879e908d76e4dd33c2025bfa922ca8512665b3b87a1bd71dd1a244b50c265d"
19-
sha256 cellar: :any, sonoma: "f4ea8e1bc989f3b7a9e1696d9b4133bb6b42085322211558878803c98a878582"
20-
sha256 cellar: :any, ventura: "a72d4bb60872a50043f2894fa70d7c9546f5c22f2a2f56ac7f5307be1d93f3f6"
21-
sha256 cellar: :any, monterey: "f518cf358c04a34ce0a43947c2c3cf4687ab8f4928580e2aa5b5dd7f7ee5a77b"
22-
sha256 cellar: :any_skip_relocation, x86_64_linux: "29a2c4acb419f6642cab1937305b7c7f9c4cbc54e525e06b0042272c3a354c13"
16+
rebuild 1
17+
sha256 cellar: :any, arm64_sonoma: "a9c523fa03df3a333919f2d47f3ac0e4715b599f59911bb13aa157aae56d58a7"
18+
sha256 cellar: :any, arm64_ventura: "7ce8546e60d3a2ddf7ea2aa4f32c3968275449a696f2b4a5a7750b6cab1d2e8a"
19+
sha256 cellar: :any, arm64_monterey: "354fc5fa57511bf0e741de878346508b7e0f81e998747c438874f33b8879b4a2"
20+
sha256 cellar: :any, sonoma: "1ff1bde23f8e305460df7fe17c461ed710b45ffe82f9b0dd2523a74d35aa52cb"
21+
sha256 cellar: :any, ventura: "d675053c8a99ebbe6ac37986bd171a1a29240c1ea1100ae75f97b4220d4e30b5"
22+
sha256 cellar: :any, monterey: "cd81236d6a7bf4621b6fd8db5d3bb293e74523e7ed25f3e0bd847b96a246b1e2"
2323
end
2424

2525
depends_on "cmake" => :build # Needed to build LLVM
@@ -30,6 +30,7 @@ class Julia < Formula
3030
depends_on "ca-certificates"
3131
depends_on "curl"
3232
depends_on "gmp"
33+
depends_on "libblastrampoline"
3334
depends_on "libgit2"
3435
depends_on "libnghttp2"
3536
depends_on "libssh2"
@@ -74,6 +75,7 @@ def install
7475
USE_SYSTEM_CURL=1
7576
USE_SYSTEM_GMP=1
7677
USE_SYSTEM_LAPACK=1
78+
USE_SYSTEM_LIBBLASTRAMPOLINE=1
7779
USE_SYSTEM_LIBGIT2=1
7880
USE_SYSTEM_LIBSSH2=1
7981
USE_SYSTEM_LIBSUITESPARSE=0

Formula/lib/libblastrampoline.rb

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
class Libblastrampoline < Formula
2+
desc "Using PLT trampolines to provide a BLAS and LAPACK demuxing library"
3+
homepage "https://github.com/JuliaLinearAlgebra/libblastrampoline"
4+
url "https://github.com/JuliaLinearAlgebra/libblastrampoline/archive/refs/tags/v5.11.0.tar.gz"
5+
sha256 "4ea6c134843bd868f78d7ee0c61bf8bdda5334f20deaa6d3cd5bc6caafc4af17"
6+
license all_of: [
7+
"MIT",
8+
"BSD-2-Clause-Views", # include/common/f77blas.h
9+
"BSD-3-Clause", # include/common/lapacke*
10+
]
11+
12+
bottle do
13+
sha256 cellar: :any, arm64_sonoma: "70c25f76601949269e21048be82f671ca0d97bf5b71c11eddae338b3916b198f"
14+
sha256 cellar: :any, arm64_ventura: "51cee0c324df3077f746332e9a428d0ca1b7d81faab257e371b2d92147b02973"
15+
sha256 cellar: :any, arm64_monterey: "254d9acb9cfb8be58703c06e621cd4df120bac6c1464eb6bdc73325b0e3002d8"
16+
sha256 cellar: :any, sonoma: "48f2f7813d5b7c04267e924fed7ba578acb8e4e139d70df80a2dc8cb4ebbfdd7"
17+
sha256 cellar: :any, ventura: "84e50ef11eb134a5822d1f765f91ce8235c6ff675020b3bc33a8b6951b0f64c9"
18+
sha256 cellar: :any, monterey: "f3fb195e78ad38bdcdf6d5e68f3290e72ff435d85a9bc9052f5db1bd4bcccfa5"
19+
sha256 cellar: :any_skip_relocation, x86_64_linux: "5b45c0f742c4f3699842d75b19438efc8a49816ab82b46352a4a197ce63fed42"
20+
end
21+
22+
depends_on "openblas" => :test
23+
24+
def install
25+
system "make", "-C", "src", "install", "prefix=#{prefix}"
26+
(pkgshare/"test").install "test/dgemm_test/dgemm_test.c"
27+
end
28+
29+
test do
30+
cp pkgshare/"test/dgemm_test.c", testpath
31+
32+
(testpath/"api_test.c").write <<~EOS
33+
#include <assert.h>
34+
#include <stdio.h>
35+
#include <libblastrampoline.h>
36+
37+
int main() {
38+
const lbt_config_t * config = lbt_get_config();
39+
assert(config != NULL);
40+
41+
lbt_library_info_t ** libs = config->loaded_libs;
42+
assert(libs != NULL);
43+
assert(sizeof(libs) == sizeof(lbt_library_info_t *));
44+
assert(libs[0] != NULL);
45+
46+
printf("%s", libs[0]->libname);
47+
return 0;
48+
}
49+
EOS
50+
51+
system ENV.cc, "dgemm_test.c", "-I#{include}", "-L#{lib}", "-lblastrampoline", "-o", "dgemm_test"
52+
system ENV.cc, "api_test.c", "-I#{include}", "-L#{lib}", "-lblastrampoline", "-o", "api_test"
53+
54+
test_libs = [shared_library("libopenblas")]
55+
if OS.mac?
56+
test_libs << "/System/Library/Frameworks/Accelerate.framework/Accelerate"
57+
ENV["DYLD_LIBRARY_PATH"] = Formula["openblas"].opt_lib.to_s
58+
end
59+
60+
test_libs.each do |test_lib|
61+
with_env(LBT_DEFAULT_LIBS: test_lib) do
62+
assert_equal test_lib, shell_output("./api_test")
63+
system "./dgemm_test"
64+
end
65+
end
66+
end
67+
end

0 commit comments

Comments
 (0)