@@ -17,17 +17,19 @@ class Openblas < Formula
1717 end
1818
1919 bottle do
20- sha256 cellar : :any , arm64_sequoia : "19429463a737ea1ca72573210238f7d5000731431a442679d9c00b215722fdbd"
21- sha256 cellar : :any , arm64_sonoma : "81233b55f062b049f559ed43f37674648e0b7dfe06a6dc7f776251fc46144811"
22- sha256 cellar : :any , arm64_ventura : "4351d5aa370ac2f7cb661062b9b272fdf7ef7373d0b2dfe10f5a2c2cf9ffc95b"
23- sha256 cellar : :any , sonoma : "0cc19e345f5e4b4f0b32e9dc39247a0f97adbb48c10dd9e4655d00822b1c9539"
24- sha256 cellar : :any , ventura : "f6bb911cce1ea42486696f1dfc50bd22c8ec6ce6d972047a7c8ca58778c8d320"
25- sha256 cellar : :any_skip_relocation , arm64_linux : "644c21828d8f3fdaf5d6cabdd815abf71b2bd7446a4a5d9640411fb64028d9a1"
26- sha256 cellar : :any_skip_relocation , x86_64_linux : "47a79133b44870b5f5e23c546efb25da93edd4671ba2bd56a1aa43907054df81"
20+ rebuild 1
21+ sha256 cellar : :any , arm64_sequoia : "f194baff998d5d4418c0a647f592f14c10f8c26cd1542f64b310ac72844a095a"
22+ sha256 cellar : :any , arm64_sonoma : "46471ce1e3f44f4c765bb6fad1690a9aa69fe9c948379e6f40b9c5e38652c4b9"
23+ sha256 cellar : :any , arm64_ventura : "0b711f2254dc6c5ce89d21cba9f67d89da72b3cfe55bb840f4130dd2bab62fd6"
24+ sha256 cellar : :any , sonoma : "dcef53fdbfa90411375b209ac11ae5b41e6c63f9f139e155d892bb2e4616feb6"
25+ sha256 cellar : :any , ventura : "ebd50b45068b81d33f2269f523ade1e357a230234ef27524a37365de0b657580"
26+ sha256 cellar : :any_skip_relocation , arm64_linux : "60f63379659c38cea3a544c5e85e612ce0a0d02433aeb581fce3e1264f909eef"
27+ sha256 cellar : :any_skip_relocation , x86_64_linux : "08c0a5b778704cdfbf09b0db18a87cbfc2ba2a82241d2d999488a771cb308447"
2728 end
2829
2930 keg_only :shadowed_by_macos , "macOS provides BLAS in Accelerate.framework"
3031
32+ depends_on "pkgconf" => :test
3133 depends_on "gcc" # for gfortran
3234 fails_with :clang
3335
@@ -61,6 +63,7 @@ def install
6163
6264 lib . install_symlink shared_library ( "libopenblas" ) => shared_library ( "libblas" )
6365 lib . install_symlink shared_library ( "libopenblas" ) => shared_library ( "liblapack" )
66+ pkgshare . install "cpp_thread_test"
6467 end
6568
6669 test do
@@ -85,8 +88,16 @@ def install
8588 return 0;
8689 }
8790 C
88- system ENV . cc , "test.c" , "-I#{ include } " , "-L#{ lib } " , "-lopenblas" ,
89- "-o" , "test"
91+ system ENV . cc , "test.c" , "-I#{ include } " , "-L#{ lib } " , "-lopenblas" , "-o" , "test"
9092 system "./test"
93+
94+ cp_r pkgshare /"cpp_thread_test/." , testpath
95+ ENV . prepend_path "PKG_CONFIG_PATH" , lib /"pkgconfig" if OS . mac?
96+ flags = shell_output ( "pkgconf --cflags --libs openblas" ) . chomp . split
97+ %w[ dgemm_thread_safety dgemv_thread_safety ] . each do |test |
98+ inreplace "#{ test } .cpp" , '"../cblas.h"' , '"cblas.h"'
99+ system ENV . cxx , *ENV . cxxflags . to_s . split , "-std=c++11" , "#{ test } .cpp" , "-o" , test , *flags
100+ system "./#{ test } "
101+ end
91102 end
92103end
0 commit comments