homebrew-core/Formula/jags.rb

52 lines
1.7 KiB
Ruby

class Jags < Formula
desc "Just Another Gibbs Sampler for Bayesian MCMC simulation"
homepage "https://mcmc-jags.sourceforge.io"
url "https://downloads.sourceforge.net/project/mcmc-jags/JAGS/4.x/Source/JAGS-4.3.0.tar.gz"
sha256 "8ac5dd57982bfd7d5f0ee384499d62f3e0bb35b5f1660feb368545f1186371fc"
revision 2
livecheck do
url :stable
regex(%r{url=.*?/JAGS[._-]v?(\d+(?:\.\d+)+)\.t}i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "09d3c994c48f7963911ea011e9e4397ccb1bd3971a0a750118be110dd5c80333"
sha256 cellar: :any, big_sur: "5e15b0663aa9a2b8bdd795beaec52b84e1ddf00f3af5768c6621d2b47a9ef977"
sha256 cellar: :any, catalina: "f40e6af27e11d70df8d967dfdf56b9f51f97b6d7b26922efc1e0a7c564d6a82e"
sha256 cellar: :any, mojave: "73dd05de303d75d9a252fd9cf40242036d6227d20ff0e40bdad8a9b4fb5ac093"
sha256 cellar: :any, high_sierra: "6f3e40e482b03deb728487e3b9c7089d900f1aa518c74de0859a2877833b16b0"
sha256 cellar: :any, sierra: "0651db81905348bb0c48c20529c5bab0d4eb735da50fcc9ec26aef38672cf26f"
sha256 cellar: :any, el_capitan: "6c82f61d6cacec46e7863f9b9cb92f33eac63339822fd196e6a029a75dfb01f7"
end
depends_on "gcc" # for gfortran
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"model.bug").write <<~EOS
data {
obs <- 1
}
model {
parameter ~ dunif(0,1)
obs ~ dbern(parameter)
}
EOS
(testpath/"script").write <<~EOS
model in model.bug
compile
initialize
monitor parameter
update 100
coda *
EOS
system "#{bin}/jags", "script"
end
end