summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/unuran/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/unuran/package.py')
-rw-r--r--var/spack/repos/builtin/packages/unuran/package.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/unuran/package.py b/var/spack/repos/builtin/packages/unuran/package.py
new file mode 100644
index 0000000000..2708882c6e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/unuran/package.py
@@ -0,0 +1,41 @@
+# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class Unuran(AutotoolsPackage):
+ """Universal Non-Uniform Random number generator."""
+
+ homepage = "http://statmath.wu.ac.at/unuran"
+ url = "http://statmath.wu.ac.at/unuran/unuran-1.8.1.tar.gz"
+
+ version('1.8.1', 'a5885baab53a2608c1d85517bf5d06a5')
+
+ variant('shared', default=True,
+ description="Enable the build of shared libraries")
+ variant('rngstreams', default=True,
+ description="Use RNGSTREAM library for uniform random generation")
+ variant('gsl', default=False,
+ description="Use random number generators from GNU Scientific Library")
+
+ depends_on('gsl', when="+gsl")
+ depends_on('rngstreams', when="+rngstreams")
+
+ def configure_args(self):
+
+ spec = self.spec
+
+ args = [
+ '--%s-shared' % ('enable' if '+shared' in spec else 'disable'),
+ '--with-urgn-default=%s' % (
+ 'rngstream' if '+rngstreams' in spec else 'builtin'),
+ '--%s-urng-gsl' % (
+ 'with' if '+gsl' in spec else 'without'),
+ '--%s-urng-rngstreams' % (
+ 'with' if '+rngstreams' in spec else 'without')
+ ]
+
+ return args