Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 8 additions & 9 deletions Formula/c/cp2k.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Cp2k < Formula
url "https://github.com/cp2k/cp2k/releases/download/v2025.1/cp2k-2025.1.tar.bz2"
sha256 "65c8ad5488897b0f995919b9fa77f2aba4b61677ba1e3c19bb093d5c08a8ce1d"
license "GPL-2.0-or-later"
revision 1

livecheck do
url :stable
Expand Down Expand Up @@ -32,8 +33,8 @@ class Cp2k < Formula
depends_on "openblas"
depends_on "scalapack"

fails_with :clang do
cause "needs OpenMP support for C/C++ and Fortran"
on_macos do
depends_on "libomp"
end

resource "libint" do
Expand All @@ -58,12 +59,12 @@ def install
ENV.prepend_path "PKG_CONFIG_PATH", libexec/"lib/pkgconfig"
end

# TODO: Add workaround to link to LLVM OpenMP (libomp) with gfortran after migrating OpenBLAS
# Workaround to link to LLVM OpenMP (libomp) with gfortran
omp_args = []
# if OS.mac?
# omp_args << "-DOpenMP_Fortran_LIB_NAMES=omp"
# omp_args << "-DOpenMP_omp_LIBRARY=#{Formula["libomp"].opt_lib}/libomp.dylib"
# end
if OS.mac?
omp_args << "-DOpenMP_Fortran_LIB_NAMES=omp"
omp_args << "-DOpenMP_omp_LIBRARY=#{Formula["libomp"].opt_lib}/libomp.dylib"
end

# TODO: Remove dbcsr build along with corresponding CMAKE_PREFIX_PATH
# and add -DCP2K_BUILD_DBCSR=ON once `cp2k` build supports this option.
Expand All @@ -85,9 +86,7 @@ def install
# Avoid trying to access /proc/self/statm on macOS
ENV.append "FFLAGS", "-D__NO_STATM_ACCESS" if OS.mac?

# Set -lstdc++ to allow gfortran to link libint
cp2k_cmake_args = %W[
-DCMAKE_SHARED_LINKER_FLAGS=-lstdc++
-DCMAKE_INSTALL_RPATH=#{rpath};#{rpath(target: libexec/"lib")}
-DCP2K_BLAS_VENDOR=OpenBLAS
-DCP2K_USE_LIBINT2=ON
Expand Down
12 changes: 11 additions & 1 deletion Formula/d/dynare.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class Dynare < Formula
desc "Platform for economic models, particularly DSGE and OLG models"
homepage "https://www.dynare.org/"
url "https://www.dynare.org/release/source/dynare-6.4.tar.xz"
sha256 "9865e2e7f6b3705155538d5fb1fb0b01bc9decf07250b3b054d3555d651c3843"
license "GPL-3.0-or-later"
revision 1
revision 2
head "https://git.dynare.org/Dynare/dynare.git", branch: "master"

livecheck do
Expand Down Expand Up @@ -37,6 +37,10 @@
depends_on "openblas"
depends_on "suite-sparse"

on_macos do
depends_on "libomp"
end

fails_with :clang do
cause <<~EOS
GCC is the only compiler supported by upstream
Expand Down Expand Up @@ -72,6 +76,12 @@
ENV.append_path "LIBRARY_PATH", Formula["suite-sparse"].opt_lib
ENV.append_path "LIBRARY_PATH", buildpath/"slicot/lib"

# Workaround to unofficially link to LLVM OpenMP (libomp) with GCC
if OS.mac?
inreplace "meson.build", "openmp_dep = dependency('openmp')",
"openmp_dep = declare_dependency(compile_args : '-fopenmp', link_args : '-lomp')"
end

system "meson", "setup", "build", "-Dbuild_for=octave", *std_meson_args
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
Expand Down
11 changes: 7 additions & 4 deletions Formula/f/fftw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Fftw < Formula
url "https://fftw.org/fftw-3.3.10.tar.gz"
sha256 "56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467"
license all_of: ["GPL-2.0-or-later", "BSD-2-Clause"]
revision 2
revision 3

livecheck do
url :homepage
Expand All @@ -27,11 +27,9 @@ class Fftw < Formula
depends_on "open-mpi"

on_macos do
depends_on "gcc"
depends_on "libomp"
end

fails_with :clang

# Fix the cmake config file when configured with autotools, upstream pr ref, https://github.com/FFTW/fftw3/pull/338
patch do
url "https://github.com/FFTW/fftw3/commit/394fa85ab5f8914b82b3404844444c53f5c7f095.patch?full_index=1"
Expand All @@ -41,6 +39,11 @@ class Fftw < Formula
def install
ENV.runtime_cpu_detection

if OS.mac?
ENV["OPENMP_CFLAGS"] = "-Xpreprocessor -fopenmp"
ENV.append "LIBS", "-lomp"
end

args = [
"--enable-shared",
"--disable-debug",
Expand Down
25 changes: 7 additions & 18 deletions Formula/g/gromacs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Gromacs < Formula
url "https://ftp.gromacs.org/pub/gromacs/gromacs-2025.3.tar.gz"
sha256 "8bdfca0268f3f10a7ca3c06e59b62f73ea02420c67211c0ff3912f32d7833c65"
license "LGPL-2.1-or-later"
revision 1

livecheck do
url "https://ftp.gromacs.org/pub/gromacs/"
Expand All @@ -23,31 +24,25 @@ class Gromacs < Formula
depends_on "cmake" => :build
depends_on "pkgconf" => :build
depends_on "fftw"
depends_on "gcc" # for OpenMP
depends_on "lmfit"
depends_on "muparser"
depends_on "openblas"

uses_from_macos "zlib"

on_macos do
conflicts_with "muparser", because: "gromacs ships its own copy of muparser"
depends_on "libomp"
end

on_linux do
depends_on "muparser"
end

fails_with :clang

def install
# Non-executable GMXRC files should be installed in DATADIR
inreplace "scripts/CMakeLists.txt", "CMAKE_INSTALL_BINDIR",
"CMAKE_INSTALL_DATADIR"

# Avoid superenv shim reference
gcc = Formula["gcc"]
cc = gcc.opt_bin/"gcc-#{gcc.any_installed_version.major}"
cxx = gcc.opt_bin/"g++-#{gcc.any_installed_version.major}"
cc = DevelopmentTools.locate(ENV.cc)
cxx = DevelopmentTools.locate(ENV.cxx)

inreplace "src/gromacs/gromacs-hints.in.cmake" do |s|
s.gsub! "@CMAKE_LINKER@", "/usr/bin/ld"
s.gsub! "@CMAKE_C_COMPILER@", cc
Expand Down Expand Up @@ -75,15 +70,9 @@ def install
-DGMX_INSTALL_LEGACY_API=ON
-DGMX_EXTERNAL_ZLIB=ON
-DGMX_USE_LMFIT=EXTERNAL
-DGMX_USE_MUPARSER=EXTERNAL
-DGMX_SIMD=#{gmx_simd}
]
args << if OS.mac?
# Use bundled `muparser` as brew formula is linked to libc++ on macOS but we need libstdc++.
# TODO: Try switching `gromacs` and its dependency tree to use Apple Clang + `libomp`
"-DFETCHCONTENT_SOURCE_DIR_MUPARSER=#{buildpath}/src/external/muparser"
else
"-DGMX_USE_MUPARSER=EXTERNAL"
end

system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args
system "cmake", "--build", "build"
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/muparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Muparser < Formula
url "https://github.com/beltoforion/muparser/archive/refs/tags/v2.3.5.tar.gz"
sha256 "20b43cc68c655665db83711906f01b20c51909368973116dfc8d7b3c4ddb5dd4"
license "BSD-2-Clause"
revision 1
revision 2
head "https://github.com/beltoforion/muparser.git", branch: "master"

bottle do
Expand All @@ -20,13 +20,13 @@ class Muparser < Formula
depends_on "cmake" => :build

on_macos do
conflicts_with "gromacs", because: "gromacs ships its own copy of muparser"
depends_on "libomp"
end

def install
ENV.cxx11 if OS.linux?

system "cmake", "-S", ".", "-B", "build", "-DENABLE_OPENMP=#{OS.mac? ? "OFF" : "ON"}", *std_cmake_args
system "cmake", "-S", ".", "-B", "build", "-DENABLE_OPENMP=ON", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end
Expand Down
9 changes: 8 additions & 1 deletion Formula/n/nwchem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Nwchem < Formula
version "7.2.3"
sha256 "7788e6af9be8681e6384b8df4df5ac57d010b2c7aa50842d735c562d92f94c25"
license "ECL-2.0"
revision 1
revision 2

livecheck do
url :stable
Expand Down Expand Up @@ -36,6 +36,10 @@ class Nwchem < Formula

uses_from_macos "libxcrypt"

on_macos do
depends_on "libomp"
end

# fix download url in build_dftd3a.sh, upstream pr ref, https://github.com/nwchemgit/nwchem/pull/1054
patch do
url "https://github.com/nwchemgit/nwchem/commit/65ce7726d9fa418f7c01665bebfc1e2181f15adf.patch?full_index=1"
Expand All @@ -46,6 +50,9 @@ def install
pkgshare.install "QA"

cd "src" do
# Workaround to link to LLVM OpenMP (libomp) with gfortran
inreplace "config/makefile.h", /(\bLDOPTIONS *\+= *)-fopenmp$/, "\\1-lomp" if OS.mac?

(prefix/"etc").mkdir
(prefix/"etc/nwchemrc").write <<~EOS
nwchem_basis_library #{pkgshare}/libraries/
Expand Down
40 changes: 39 additions & 1 deletion Formula/o/openblas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# 3. interface/{gemmt.c,sbgemmt.c} is BSD-2-Clause
# 4. relapack/ is MIT but license is omitted as it is not enabled
license all_of: ["BSD-3-Clause", "BSD-2-Clause-Views", "BSD-3-Clause-Open-MPI", "BSD-2-Clause"]
revision 1
head "https://github.com/OpenMathLib/OpenBLAS.git", branch: "develop"

livecheck do
Expand All @@ -28,10 +29,27 @@

keg_only :shadowed_by_macos, "macOS provides BLAS in Accelerate.framework"

depends_on "pkgconf" => :test
depends_on "gcc" # for gfortran
fails_with :clang

on_macos do
depends_on "libomp"
end

def install
# Workaround to use Apple Clang and link to `libomp`
if ENV.compiler == :clang
inreplace "Makefile.system" do |s|
s.gsub! "+= -fopenmp", "+= -Xpreprocessor -fopenmp"
# Also add GCC path to pkgconfig file as we don't symlink libgfortran to HOMEBREW_PREFIX/lib
s.gsub! "+= -lgfortran", "+= -L#{Formula["gcc"].opt_lib}/gcc/current -lgfortran"
end
inreplace "Makefile.install" do |s|
s.gsub! ":= -fopenmp", ":= -I#{Formula["libomp"].opt_include} -Xpreprocessor -fopenmp"
s.gsub! "+= -lgomp", "+= -L#{Formula["libomp"].opt_lib} -lomp"
end
end

ENV.runtime_cpu_detection
ENV.deparallelize # build is parallel by default, but setting -j confuses it

Expand Down Expand Up @@ -61,9 +79,10 @@

lib.install_symlink shared_library("libopenblas") => shared_library("libblas")
lib.install_symlink shared_library("libopenblas") => shared_library("liblapack")
pkgshare.install "cpp_thread_test"
end

test do

Check failure on line 85 in Formula/o/openblas.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

`brew test --verbose openblas` failed on macOS Ventura (13) on Apple Silicon!

==> ./test 11.000000 -9.000000 5.000000 -9.000000 21.000000 -1.000000 5.000000 -1.000000 3.000000 ==> pkgconf --cflags --libs --static openblas ==> /usr/bin/clang++ dgemm_thread_safety.cpp -o dgemm_thread_safety -I/opt/homebrew/Cellar/openblas/0.3.30_1/include -I/opt/homebrew/opt/libomp/include -Xpreprocessor -fopenmp -L/opt/homebrew/Cellar/openblas/0.3.30_1/lib -lopenblas -lpthread -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -lpthread -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -L/opt/homebrew/opt/libomp/lib -lomp In file included from dgemm_thread_safety.cpp:7: ./cpp_thread_safety_common.h:16:49: error: a space is required between consecutive right angle brackets (use '> >') void FillMatrices(std::vector<std::vector<double>>& matBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){ ^~ > > ./cpp_thread_safety_common.h:29:48: error: a space is required between consecutive right angle brackets (use '> >') void FillVectors(std::vector<std::vector<double>>& vecBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numVec){ ^~ > > ./cpp_thread_safety_common.h:45:48: error: expected ';' at end of declaration std::uniform_real_distribution<double> rngdist{-1.0, 1.0}; ^ ; ./cpp_thread_safety_common.h:52:56: error: a space is required between consecutive right angle brackets (use '> >') void PrintMatrices(const std::vector<std::vector<double>>& matBlock, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){ ^~ > > dgemm_thread_safety.cpp:38:48: error: expected ';' at end of declaration std::uniform_real_distribution<double> rngdist{-1.0, 1.0}; ^ ; dgemm_thread_safety.cpp:39:32: error: a space is required between consecutive right angle brackets (use '> >') std::vector<std::vector<double>> matBlock(numConcurrentThreads*3); ^~ > > dgemm_thread_safety.cpp:40:30: error: a space is required between consecutive right angle brackets (use '> >') std::vector<std::future<void>> futureBlock(numConcurrentThreads); ^~ > > dgemm_thread_safety.cpp:74:26: error: no member named 'async' in namespace 'std' futureBlock[i] = std::async(std::launch::async, launch_cblas_dgemm, &matBlock[i*3][0], &matBlock[i*3+1][0], &matBlock[i*3+2][0], randomMatSize); ~~~~~^ 8 errors generated. ::error::openblas: failed An exception occurred within a child process: BuildError: Failed executing: /usr/bin/clang++ dgemm_thread_safety.cpp -o dgemm_thread_safety -I/opt/homebrew/Cellar/openblas/0.3.30_1/include -I/opt/homebrew/opt/libomp/include -Xpreprocessor -fopenmp -L/opt/homebrew/Cellar/openblas/0.3.30_1/lib -lopenblas -lpthread -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -lpthread -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -L/opt/homebrew/opt/libomp/lib -lomp /opt/homebrew/Library/Homebrew/formula.rb:3175:in 'block in Formula#system' /opt/homebrew/Library/Homebrew/formula.rb:3111:in 'IO.open' /opt/homebrew/Library/Homebrew/formula.rb:3111:in 'Formula#system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.6.12479/lib/types/private/methods/call_validation.rb:179:in 'Unboun

Check failure on line 85 in Formula/o/openblas.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

`brew test --verbose openblas` failed on macOS Ventura (13)!

==> ./test 11.000000 -9.000000 5.000000 -9.000000 21.000000 -1.000000 5.000000 -1.000000 3.000000 ==> pkgconf --cflags --libs --static openblas ==> /usr/bin/clang++ dgemm_thread_safety.cpp -o dgemm_thread_safety -I/usr/local/Cellar/openblas/0.3.30_1/include -I/usr/local/opt/libomp/include -Xpreprocessor -fopenmp -L/usr/local/Cellar/openblas/0.3.30_1/lib -lopenblas -lpthread -L/usr/local/opt/gcc/lib/gcc/current -lgfortran -lpthread -L/usr/local/opt/gcc/lib/gcc/current -lgfortran -L/usr/local/opt/libomp/lib -lomp In file included from dgemm_thread_safety.cpp:7: ./cpp_thread_safety_common.h:16:49: error: a space is required between consecutive right angle brackets (use '> >') void FillMatrices(std::vector<std::vector<double>>& matBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){ ^~ > > ./cpp_thread_safety_common.h:29:48: error: a space is required between consecutive right angle brackets (use '> >') void FillVectors(std::vector<std::vector<double>>& vecBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numVec){ ^~ > > ./cpp_thread_safety_common.h:45:48: error: expected ';' at end of declaration std::uniform_real_distribution<double> rngdist{-1.0, 1.0}; ^ ; ./cpp_thread_safety_common.h:52:56: error: a space is required between consecutive right angle brackets (use '> >') void PrintMatrices(const std::vector<std::vector<double>>& matBlock, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){ ^~ > > dgemm_thread_safety.cpp:38:48: error: expected ';' at end of declaration std::uniform_real_distribution<double> rngdist{-1.0, 1.0}; ^ ; dgemm_thread_safety.cpp:39:32: error: a space is required between consecutive right angle brackets (use '> >') std::vector<std::vector<double>> matBlock(numConcurrentThreads*3); ^~ > > dgemm_thread_safety.cpp:40:30: error: a space is required between consecutive right angle brackets (use '> >') std::vector<std::future<void>> futureBlock(numConcurrentThreads); ^~ > > dgemm_thread_safety.cpp:74:26: error: no member named 'async' in namespace 'std' futureBlock[i] = std::async(std::launch::async, launch_cblas_dgemm, &matBlock[i*3][0], &matBlock[i*3+1][0], &matBlock[i*3+2][0], randomMatSize); ~~~~~^ 8 errors generated. ::error::openblas: failed An exception occurred within a child process: BuildError: Failed executing: /usr/bin/clang++ dgemm_thread_safety.cpp -o dgemm_thread_safety -I/usr/local/Cellar/openblas/0.3.30_1/include -I/usr/local/opt/libomp/include -Xpreprocessor -fopenmp -L/usr/local/Cellar/openblas/0.3.30_1/lib -lopenblas -lpthread -L/usr/local/opt/gcc/lib/gcc/current -lgfortran -lpthread -L/usr/local/opt/gcc/lib/gcc/current -lgfortran -L/usr/local/opt/libomp/lib -lomp /usr/local/Homebrew/Library/Homebrew/formula.rb:3175:in 'block in Formula#system' /usr/local/Homebrew/Library/Homebrew/formula.rb:3111:in 'IO.open' /usr/local/Homebrew/Library/Homebrew/formula.rb:3111:in 'Formula#system' /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.6.12479/lib/types/private/methods/call_validation.rb:179:in 'UnboundMethod#bin

Check failure on line 85 in Formula/o/openblas.rb

View workflow job for this annotation

GitHub Actions / macOS 14-x86_64

`brew test --verbose openblas` failed on macOS Sonoma (14)!

==> ./test 11.000000 -9.000000 5.000000 -9.000000 21.000000 -1.000000 5.000000 -1.000000 3.000000 ==> pkgconf --cflags --libs --static openblas ==> /usr/bin/clang++ dgemm_thread_safety.cpp -o dgemm_thread_safety -I/usr/local/Cellar/openblas/0.3.30_1/include -I/usr/local/opt/libomp/include -Xpreprocessor -fopenmp -L/usr/local/Cellar/openblas/0.3.30_1/lib -lopenblas -lpthread -L/usr/local/opt/gcc/lib/gcc/current -lgfortran -lpthread -L/usr/local/opt/gcc/lib/gcc/current -lgfortran -L/usr/local/opt/libomp/lib -lomp In file included from dgemm_thread_safety.cpp:7: ./cpp_thread_safety_common.h:16:49: error: a space is required between consecutive right angle brackets (use '> >') 16 | void FillMatrices(std::vector<std::vector<double>>& matBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){ | ^~ | > > ./cpp_thread_safety_common.h:29:48: error: a space is required between consecutive right angle brackets (use '> >') 29 | void FillVectors(std::vector<std::vector<double>>& vecBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numVec){ | ^~ | > > ./cpp_thread_safety_common.h:45:48: error: expected ';' at end of declaration 45 | std::uniform_real_distribution<double> rngdist{-1.0, 1.0}; | ^ | ; ./cpp_thread_safety_common.h:52:56: error: a space is required between consecutive right angle brackets (use '> >') 52 | void PrintMatrices(const std::vector<std::vector<double>>& matBlock, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){ | ^~ | > > dgemm_thread_safety.cpp:38:48: error: expected ';' at end of declaration 38 | std::uniform_real_distribution<double> rngdist{-1.0, 1.0}; | ^ | ; dgemm_thread_safety.cpp:39:32: error: a space is required between consecutive right angle brackets (use '> >') 39 | std::vector<std::vector<double>> matBlock(numConcurrentThreads*3); | ^~ | > > dgemm_thread_safety.cpp:40:30: error: a space is required between consecutive right angle brackets (use '> >') 40 | std::vector<std::future<void>> futureBlock(numConcurrentThreads); | ^~ | > > dgemm_thread_safety.cpp:74:26: error: no member named 'async' in namespace 'std' 74 | futureBlock[i] = std::async(std::launch::async, launch_cblas_dgemm, &matBlock[i*3][0], &matBlock[i*3+1][0], &matBlock[i*3+2][0], randomMatSize); | ~~~~~^ 8 errors generated. ::error::openblas: failed An exception occurred within a child process: BuildError: Failed executing: /usr/bin/clang++ dgemm_thread_safety.cpp -o dgemm_thread_safety -I/usr/local/Cellar/openblas/0.3.30_1/include -I/usr/local/opt/libomp/include -Xpreprocessor -fopenmp -L/usr/local/Cellar/openblas/0.3.30_1/lib -lopenblas -lpthread -L/usr/local/opt/gcc/lib/gcc/current -lgfortran -lpthread -L/usr/local/opt/gcc/lib/gcc/current -lgfortran -L/usr/local/opt/libomp/lib -lomp /usr/local/Homebrew/Library/Homebrew/formula.rb:3175:in 'block in Formula#system' /usr/local/Homebrew/Library/Homebrew/formula.rb:3111:in 'IO.open' /usr/local/Homebrew/Library/Homebrew/formula.rb:3111

Check failure on line 85 in Formula/o/openblas.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew test --verbose openblas` failed on macOS Sonoma (14) on Apple Silicon!

==> ./test 11.000000 -9.000000 5.000000 -9.000000 21.000000 -1.000000 5.000000 -1.000000 3.000000 ==> pkgconf --cflags --libs --static openblas ==> /usr/bin/clang++ dgemm_thread_safety.cpp -o dgemm_thread_safety -I/opt/homebrew/Cellar/openblas/0.3.30_1/include -I/opt/homebrew/opt/libomp/include -Xpreprocessor -fopenmp -L/opt/homebrew/Cellar/openblas/0.3.30_1/lib -lopenblas -lpthread -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -lpthread -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -L/opt/homebrew/opt/libomp/lib -lomp In file included from dgemm_thread_safety.cpp:7: ./cpp_thread_safety_common.h:16:49: error: a space is required between consecutive right angle brackets (use '> >') 16 | void FillMatrices(std::vector<std::vector<double>>& matBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){ | ^~ | > > ./cpp_thread_safety_common.h:29:48: error: a space is required between consecutive right angle brackets (use '> >') 29 | void FillVectors(std::vector<std::vector<double>>& vecBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numVec){ | ^~ | > > ./cpp_thread_safety_common.h:45:48: error: expected ';' at end of declaration 45 | std::uniform_real_distribution<double> rngdist{-1.0, 1.0}; | ^ | ; ./cpp_thread_safety_common.h:52:56: error: a space is required between consecutive right angle brackets (use '> >') 52 | void PrintMatrices(const std::vector<std::vector<double>>& matBlock, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){ | ^~ | > > dgemm_thread_safety.cpp:38:48: error: expected ';' at end of declaration 38 | std::uniform_real_distribution<double> rngdist{-1.0, 1.0}; | ^ | ; dgemm_thread_safety.cpp:39:32: error: a space is required between consecutive right angle brackets (use '> >') 39 | std::vector<std::vector<double>> matBlock(numConcurrentThreads*3); | ^~ | > > dgemm_thread_safety.cpp:40:30: error: a space is required between consecutive right angle brackets (use '> >') 40 | std::vector<std::future<void>> futureBlock(numConcurrentThreads); | ^~ | > > dgemm_thread_safety.cpp:74:26: error: no member named 'async' in namespace 'std' 74 | futureBlock[i] = std::async(std::launch::async, launch_cblas_dgemm, &matBlock[i*3][0], &matBlock[i*3+1][0], &matBlock[i*3+2][0], randomMatSize); | ~~~~~^ 8 errors generated. ::error::openblas: failed An exception occurred within a child process: BuildError: Failed executing: /usr/bin/clang++ dgemm_thread_safety.cpp -o dgemm_thread_safety -I/opt/homebrew/Cellar/openblas/0.3.30_1/include -I/opt/homebrew/opt/libomp/include -Xpreprocessor -fopenmp -L/opt/homebrew/Cellar/openblas/0.3.30_1/lib -lopenblas -lpthread -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -lpthread -L/opt/homebrew/opt/gcc/lib/gcc/current -lgfortran -L/opt/homebrew/opt/libomp/lib -lomp /opt/homebrew/Library/Homebrew/formula.rb:3175:in 'block in Formula#system' /opt/homebrew/Library/Homebrew/formula.rb:3111:in 'IO.open' /opt/homebrew/Library/Homebr
(testpath/"test.c").write <<~C
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -88,5 +107,24 @@
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lopenblas",
"-o", "test"
system "./test"

cp_r pkgshare/"cpp_thread_test/.", testpath
ENV.prepend_path "PKG_CONFIG_PATH", lib/"pkgconfig"
flags = shell_output("pkgconf --cflags --libs --static openblas").chomp.split
["dgemm_thread_safety", "dgemv_thread_safety"].each do |test|
inreplace "#{test}.cpp", '"../cblas.h"', '"cblas.h"'
system ENV.cxx, "#{test}.cpp", "-o", test, *flags
system "./#{test}"
end

return unless OS.mac?

# Check linkage uses correct OpenMP
require "utils/linkage"
libopenblas = lib/shared_library("libopenblas")
libomp = Formula["libomp"].opt_lib/shared_library("libomp")
libgomp = Formula["gcc"].opt_lib/"gcc/current"/shared_library("libgomp")
assert Utils.binary_linked_to_library?(libopenblas, libomp), "No linkage with #{libomp.basename}!"
refute Utils.binary_linked_to_library?(libopenblas, libgomp), "Unwanted linkage with #{libgomp.basename}!"
end
end
2 changes: 1 addition & 1 deletion Formula/p/pytorch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
url "https://github.com/pytorch/pytorch/releases/download/v2.8.0/pytorch-v2.8.0.tar.gz"
sha256 "c70a2c9488f6f6e8af5982a10d1cc2c37b7df5e6506d839daa5d5e250953d7b5"
license "BSD-3-Clause"
revision 2
revision 3

livecheck do
url :stable
Expand Down Expand Up @@ -98,7 +98,7 @@
sha256 "38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36"
end

def install

Check warning on line 101 in Formula/p/pytorch.rb

View workflow job for this annotation

GitHub Actions / Linux arm64

`brew install --verbose --formula --build-bottle pytorch` failed on Linux arm64!

Successfully installed setuptools-80.9.0 Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Running command Getting requirements to build wheel /var/tmp/pip-install-8ocvbjlv/setuptools-scm_b9081ddb18074a308c0045f00446647e/src/setuptools_scm/_integration/setuptools.py:24: RuntimeWarning: ERROR: setuptools==9.2.0 is used in combination with setuptools-scm>=8.x Your build configuration is incomplete and previously worked by accident! setuptools-scm requires setuptools>=61 (recommended: >=80) Suggested workaround if applicable: - migrating from the deprecated setup_requires mechanism to pep517/518 and using a pyproject.toml to declare build dependencies which are reliably pre-installed before running the build tools warnings.warn( /var/tmp/pip-build-env-ci03vyvr/overlay/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated !! ******************************************************************************** Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0). By 2026-Feb-18, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! corresp(dist, value, root_dir) /var/tmp/pip-build-env-ci03vyvr/overlay/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: MIT License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! dist._finalize_license_expression() /var/tmp/pip-build-env-ci03vyvr/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: MIT License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! self._finalize_license_expression() running egg_info writing src/setuptools_scm.egg-info/PKG-INFO writing dependency_links to src/setuptools_scm.egg-info/dependency_links.txt writing entry points to src/setuptools_scm.egg-info/entry_points.txt writing requirements to src/setuptools_scm.egg-info/requires.txt writing top-level names to src/setuptools_scm.egg-info/top_level.txt listing git files failed - pretending there aren't any reading manifest file 'src/setuptools_scm.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching '*.nix' warning: no previously-included files found matching '.pre-commit-config.yaml' warni
python3 = "python3.13"

# Avoid building AVX512 code
Expand Down
Loading