arpack: migrate from homebrew/science
Closes #15840. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
parent
704b113b47
commit
498e5aedff
1 changed files with 55 additions and 0 deletions
55
Formula/arpack.rb
Normal file
55
Formula/arpack.rb
Normal file
|
@ -0,0 +1,55 @@
|
|||
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.5.0.tar.gz"
|
||||
sha256 "50f7a3e3aec2e08e732a487919262238f8504c3ef927246ec3495617dde81239"
|
||||
head "https://github.com/opencollab/arpack-ng.git"
|
||||
|
||||
depends_on "autoconf" => :build
|
||||
depends_on "automake" => :build
|
||||
depends_on "libtool" => :build
|
||||
|
||||
depends_on :fortran
|
||||
depends_on "veclibfort"
|
||||
depends_on :mpi => [:optional, :f77]
|
||||
|
||||
def install
|
||||
args = %W[ --disable-dependency-tracking
|
||||
--prefix=#{libexec}
|
||||
--with-blas=-L#{Formula["veclibfort"].opt_lib}\ -lvecLibFort ]
|
||||
|
||||
if build.with? "mpi"
|
||||
args << "F77=#{ENV["MPIF77"]}" << "--enable-mpi"
|
||||
end
|
||||
|
||||
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"
|
||||
|
||||
if build.with? "mpi"
|
||||
(libexec/"bin").install (buildpath/"PARPACK/EXAMPLES/MPI").children
|
||||
end
|
||||
end
|
||||
|
||||
test do
|
||||
ENV.fortran
|
||||
system ENV.fc, "-o", "test", pkgshare/"dnsimp.f", pkgshare/"mmio.f",
|
||||
"-L#{lib}", "-larpack", "-lvecLibFort"
|
||||
cp_r pkgshare/"testA.mtx", testpath
|
||||
assert_match "reached", shell_output("./test")
|
||||
|
||||
if build.with? "mpi"
|
||||
cp_r (libexec/"bin").children, testpath
|
||||
%w[pcndrv1 pdndrv1 pdndrv3 pdsdrv1
|
||||
psndrv1 psndrv3 pssdrv1 pzndrv1].each do |slv|
|
||||
system "mpirun", "-np", "4", slv
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue