homebrew-core/Formula/arpack.rb
2019-10-01 17:15:29 +02:00

57 lines
1.9 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"
revision 3
head "https://github.com/opencollab/arpack-ng.git"
bottle do
cellar :any
sha256 "16a4a696da2803d4a427508bd4dc27ccec4ac28b072cc82172945d81a895fa13" => :catalina
sha256 "8d6eb8e363467ee3b8a40c875e789edc3c43e3a095b03a383e721495c6905de7" => :mojave
sha256 "41856273d9f50a1738a26c290af692414ced685379eebd69c89db308e2cd48fb" => :high_sierra
sha256 "2c2dfdc439824d04d14c863d22c75f4e70d5f191e3cba9c6a6e567dcd4e0c1a6" => :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
]
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