homebrew-core/Formula/arpack.rb

62 lines
2.0 KiB
Ruby

class Arpack < Formula
desc "Routines to solve large scale eigenvalue problems"
homepage "https://github.com/opencollab/arpack-ng"
url "https://github.com/opencollab/arpack-ng/archive/3.7.0.tar.gz"
sha256 "972e3fc3cd0b9d6b5a737c9bf6fd07515c0d6549319d4ffb06970e64fa3cc2d6"
license "BSD-3-Clause"
revision 5
head "https://github.com/opencollab/arpack-ng.git"
bottle do
cellar :any
sha256 "c4d53dfa06e56a05dfe6c53020a8c5d867b6cf9d0cc37de9b6debc80d1af0d44" => :catalina
sha256 "a5b2d5d34b7c9650d54b7985a4edf979e9c43ddc29830676f042c112f4025967" => :mojave
sha256 "152d4a439d8309460a8d2da947eb611aa5c6dd9fa77bba9afa2db60c09f807f4" => :high_sierra
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "eigen"
depends_on "gcc" # for gfortran
depends_on "open-mpi"
depends_on "openblas"
def install
args = %W[
--disable-dependency-tracking
--prefix=#{libexec}
--with-blas=-L#{Formula["openblas"].opt_lib}\ -lopenblas
F77=mpif77
--enable-mpi
--enable-icb
--enable-icb-exmm
]
# Fix for GCC 10, remove with next version
# https://github.com/opencollab/arpack-ng/commit/ad82dcbc
args << "FFLAGS=-fallow-argument-mismatch"
system "./bootstrap"
system "./configure", *args
system "make"
system "make", "install"
lib.install_symlink Dir["#{libexec}/lib/*"].select { |f| File.file?(f) }
(lib/"pkgconfig").install_symlink Dir["#{libexec}/lib/pkgconfig/*"]
pkgshare.install "TESTS/testA.mtx", "TESTS/dnsimp.f",
"TESTS/mmio.f", "TESTS/debug.h"
end
test do
ENV.fortran
system ENV.fc, "-o", "test", pkgshare/"dnsimp.f", pkgshare/"mmio.f",
"-L#{lib}", "-larpack",
"-L#{Formula["openblas"].opt_lib}", "-lopenblas"
cp_r pkgshare/"testA.mtx", testpath
assert_match "reached", shell_output("./test")
end
end