summary refs log tree commit diff
path: root/pkgs/development/compilers/cmdstan
diff options
context:
space:
mode:
authorDavid A Roberts <d@vidr.cc>2015-12-11 22:35:17 +1000
committerDavid A Roberts <d@vidr.cc>2015-12-12 22:42:01 +1000
commit7200a5c07904791b78987fe02775f52386b32a14 (patch)
treea8b289a17d26804c979daaaca8f628713d715b08 /pkgs/development/compilers/cmdstan
parent8908fa880cf9722acb354325df709bf39daea560 (diff)
downloadnixlib-7200a5c07904791b78987fe02775f52386b32a14.tar
nixlib-7200a5c07904791b78987fe02775f52386b32a14.tar.gz
nixlib-7200a5c07904791b78987fe02775f52386b32a14.tar.bz2
nixlib-7200a5c07904791b78987fe02775f52386b32a14.tar.lz
nixlib-7200a5c07904791b78987fe02775f52386b32a14.tar.xz
nixlib-7200a5c07904791b78987fe02775f52386b32a14.tar.zst
nixlib-7200a5c07904791b78987fe02775f52386b32a14.zip
cmdstan: init at 2.9.0
Diffstat (limited to 'pkgs/development/compilers/cmdstan')
-rw-r--r--pkgs/development/compilers/cmdstan/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/development/compilers/cmdstan/default.nix b/pkgs/development/compilers/cmdstan/default.nix
new file mode 100644
index 000000000000..182808031e63
--- /dev/null
+++ b/pkgs/development/compilers/cmdstan/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "cmdstan-2.9.0";
+
+  src = fetchurl {
+    url = "https://github.com/stan-dev/cmdstan/releases/download/v2.9.0/cmdstan-2.9.0.tar.gz";
+    sha256 = "08bim6nxgam989152hm0ga1rfb33mr71pwsym1nmfmavma68bwm9";
+  };
+
+  buildFlags = "build";
+  enableParallelBuilding = true;
+
+  doCheck = true;
+  checkPhase = "./runCmdStanTests.py src/test/interface";
+
+  installPhase = ''
+    mkdir -p $out/opt $out/bin
+    cp -r . $out/opt/cmdstan
+    ln -s $out/opt/cmdstan/bin/stanc $out/bin/stanc
+    ln -s $out/opt/cmdstan/bin/stansummary $out/bin/stansummary
+    cat > $out/bin/stan <<EOF
+    #!/bin/sh
+    make -C $out/opt/cmdstan "\$(realpath "\$1")"
+    EOF
+    chmod a+x $out/bin/stan
+  '';
+
+  meta = {
+    description = "Command-line interface to Stan";
+    longDescription = ''
+      Stan is a probabilistic programming language implementing full Bayesian
+      statistical inference with MCMC sampling (NUTS, HMC), approximate Bayesian
+      inference with Variational inference (ADVI) and penalized maximum
+      likelihood estimation with Optimization (L-BFGS).
+    '';
+    homepage = http://mc-stan.org/interfaces/cmdstan.html;
+    license = stdenv.lib.licenses.bsd3;
+  };
+}