Skip to content

Commit

Permalink
Merge pull request #200404 from joseeroman/jose/new-slepc-formula
Browse files Browse the repository at this point in the history
slepc slepc-complex 3.22.2 (new formula)
  • Loading branch information
BrewTestBot authored Dec 13, 2024
2 parents fa51dd1 + 3061e0b commit 76b4f7e
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
57 changes: 57 additions & 0 deletions Formula/s/slepc-complex.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
class SlepcComplex < Formula
desc "Scalable Library for Eigenvalue Problem Computations (complex)"
homepage "https://slepc.upv.es"
url "https://slepc.upv.es/download/distrib/slepc-3.22.2.tar.gz"
sha256 "b60e58b2fa5eb7db05ce5e3a585811b43b1cc7cf89c32266e37b05f0cefd8899"
license "BSD-2-Clause"

livecheck do
formula "slepc"
end

bottle do
sha256 arm64_sequoia: "ab7353a6dabe7d12b44fe9f606178d93ea79319d12f18196ab8eb7ecdb363e5e"
sha256 arm64_sonoma: "8c83602b8ee3da9d3c6037acc701892a06427dcc65196521240f3a28f0d0e425"
sha256 arm64_ventura: "2454ec267bb175ee89e152eb83ad919099f4469e49f80ec98da6deba0da1510c"
sha256 sonoma: "1bf269557030623c97a6524ac992f20ccae2337c41cb0027888d042874d2e82a"
sha256 ventura: "74c1ece8bf8ae685f8f9b0817cea8c3b005e949ef8953999c0485af27dd30578"
sha256 x86_64_linux: "29b2f617d5cae86c0a023d2aaea35d053f73b06e40f6e705aeeedbc99e2aadb7"
end

depends_on "open-mpi"
depends_on "openblas"
depends_on "petsc-complex"

uses_from_macos "python" => :build

on_macos do
depends_on "gcc"
end

conflicts_with "slepc", because: "slepc must be installed with either real or complex support, not both"

def install
ENV["PETSC_DIR"] = Formula["petsc-complex"].prefix.realpath
ENV["SLEPC_DIR"] = buildpath

# This is not an autoconf script so cannot use `std_configure_args`
system "./configure", "--prefix=#{prefix}"
system "make", "all"
system "make", "install", "PYTHON=#{which("python3")}"

# Avoid references to Homebrew shims
rm(lib/"slepc/conf/configure-hash")
end

test do
pform = "petsc-complex"
flags = %W[-I#{include} -L#{lib} -lslepc -I#{Formula[pform].include} -L#{Formula[pform].lib} -lpetsc]
flags << "-Wl,-rpath,#{lib},-rpath,#{Formula[pform].lib}" if OS.linux?
system "mpicc", pkgshare/"../slepc/examples/src/eps/tutorials/ex2.c", "-o", "test", *flags
output = shell_output("./test -terse")
# This SLEPc example prints several lines of output. The 7th line contains
# a specific message if everything went well
line = output.lines.at(-3)
assert_match "All requested eigenvalues computed up to the required tolerance:", line
end
end
58 changes: 58 additions & 0 deletions Formula/s/slepc.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
class Slepc < Formula
desc "Scalable Library for Eigenvalue Problem Computations (real)"
homepage "https://slepc.upv.es"
url "https://slepc.upv.es/download/distrib/slepc-3.22.2.tar.gz"
sha256 "b60e58b2fa5eb7db05ce5e3a585811b43b1cc7cf89c32266e37b05f0cefd8899"
license "BSD-2-Clause"

livecheck do
url "https://slepc.upv.es/download/distrib/"
regex(/href=.*?slepc[._-]v?(\d+(?:\.\d+)+)\.t/i)
end

bottle do
sha256 arm64_sequoia: "d65d1f7f316b0262f89880602af589790ebe17a1f5b9031e77db219ba9fcc365"
sha256 arm64_sonoma: "9c4e461e155f83e922980cae2864824891b327f78562c3fe92d79afc3b8b8551"
sha256 arm64_ventura: "b1415373f667cf826e394a40cdfcd653c530ba9e0fd883c9bcf1ac2e3b96eeb5"
sha256 sonoma: "64f48ee58323e9b79092bb356ed3dc231b9fe06dc3e91341ea95ec3089ff9083"
sha256 ventura: "f7f143d03d5f90821ff06740345e7f4b939a59fdad3c821759fd29904243d087"
sha256 x86_64_linux: "a5ff1205d46e9b21332791a2695bac0c48386e08e6fbc2b8a1ee27b02421220c"
end

depends_on "open-mpi"
depends_on "openblas"
depends_on "petsc"

uses_from_macos "python" => :build

on_macos do
depends_on "gcc"
end

conflicts_with "slepc-complex", because: "slepc must be installed with either real or complex support, not both"

def install
ENV["PETSC_DIR"] = Formula["petsc"].prefix.realpath
ENV["SLEPC_DIR"] = buildpath

# This is not an autoconf script so cannot use `std_configure_args`
system "./configure", "--prefix=#{prefix}"
system "make", "all"
system "make", "install", "PYTHON=#{which("python3")}"

# Avoid references to Homebrew shims
rm(lib/"slepc/conf/configure-hash")
end

test do
pform = "petsc"
flags = %W[-I#{include} -L#{lib} -lslepc -I#{Formula[pform].include} -L#{Formula[pform].lib} -lpetsc]
flags << "-Wl,-rpath,#{lib},-rpath,#{Formula[pform].lib}" if OS.linux?
system "mpicc", pkgshare/"examples/src/eps/tutorials/ex2.c", "-o", "test", *flags
output = shell_output("./test -terse")
# This SLEPc example prints several lines of output. The 7th line contains
# a specific message if everything went well
line = output.lines.at(-3)
assert_match "All requested eigenvalues computed up to the required tolerance:", line
end
end

0 comments on commit 76b4f7e

Please sign in to comment.