45 lines
1.9 KiB
Ruby
45 lines
1.9 KiB
Ruby
class Scalapack < Formula
|
|
desc "High-performance linear algebra for distributed memory machines"
|
|
homepage "https://www.netlib.org/scalapack/"
|
|
url "https://www.netlib.org/scalapack/scalapack-2.0.2.tgz"
|
|
sha256 "0c74aeae690fe5ee4db7926f49c5d0bb69ce09eea75beb915e00bba07530395c"
|
|
revision 13
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "808ad91d5ebad9b0ef33c942dbecd99902caf6bdbf9cedecfb947d8212c22004" => :mojave
|
|
sha256 "af10eb763f1cf74164160a3f03d32409bbe84945622782e1f66197ce14eb0495" => :high_sierra
|
|
sha256 "caa0f69399167c1f684b4074a53a8338c8a896563e17326e7655536850f42f6b" => :sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "gcc" # for gfortran
|
|
depends_on "open-mpi"
|
|
depends_on "openblas"
|
|
|
|
def install
|
|
mkdir "build" do
|
|
blas = "-L#{Formula["openblas"].opt_lib} -lopenblas"
|
|
system "cmake", "..", *std_cmake_args, "-DBUILD_SHARED_LIBS=ON",
|
|
"-DBLAS_LIBRARIES=#{blas}", "-DLAPACK_LIBRARIES=#{blas}"
|
|
system "make", "all"
|
|
system "make", "install"
|
|
end
|
|
|
|
pkgshare.install "EXAMPLE"
|
|
end
|
|
|
|
test do
|
|
cp_r pkgshare/"EXAMPLE", testpath
|
|
cd "EXAMPLE" do
|
|
system "mpif90", "-o", "xsscaex", "psscaex.f", "pdscaexinfo.f", "-L#{opt_lib}", "-lscalapack"
|
|
assert `mpirun -np 4 ./xsscaex | grep 'INFO code' | awk '{print $NF}'`.to_i.zero?
|
|
system "mpif90", "-o", "xdscaex", "pdscaex.f", "pdscaexinfo.f", "-L#{opt_lib}", "-lscalapack"
|
|
assert `mpirun -np 4 ./xdscaex | grep 'INFO code' | awk '{print $NF}'`.to_i.zero?
|
|
system "mpif90", "-o", "xcscaex", "pcscaex.f", "pdscaexinfo.f", "-L#{opt_lib}", "-lscalapack"
|
|
assert `mpirun -np 4 ./xcscaex | grep 'INFO code' | awk '{print $NF}'`.to_i.zero?
|
|
system "mpif90", "-o", "xzscaex", "pzscaex.f", "pdscaexinfo.f", "-L#{opt_lib}", "-lscalapack"
|
|
assert `mpirun -np 4 ./xzscaex | grep 'INFO code' | awk '{print $NF}'`.to_i.zero?
|
|
end
|
|
end
|
|
end
|