homebrew-core/Formula/scalapack.rb
2019-05-05 18:58:55 +02:00

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 14
bottle do
cellar :any
sha256 "5fc67a092ec4aaabdf8b85fe60798e38ada319dd1ccb4173ef48b6a2b1348799" => :mojave
sha256 "920217297bbe88433445bb8682a8835f18382faa6ab3634c0bad893afefad952" => :high_sierra
sha256 "a0f825d013e09970c73cb9c2873e8ae958db685665a63561636213d8cce7e875" => :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