From 4ae1a73d54b33bc4876535422d3f3bf3d9641c51 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 8 Jun 2023 11:53:02 -0500 Subject: (r-rcpp)ensmallen: new package (#38249) * ensmallen: new package ensmallen is a high-quality C++ library for non-linear numerical optimization. * r-rcppensmallen: new package --------- Co-authored-by: wdconinc --- .../repos/builtin/packages/ensmallen/package.py | 31 ++++++++++++++++++++++ .../builtin/packages/r-rcppensmallen/package.py | 20 ++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 var/spack/repos/builtin/packages/ensmallen/package.py create mode 100644 var/spack/repos/builtin/packages/r-rcppensmallen/package.py diff --git a/var/spack/repos/builtin/packages/ensmallen/package.py b/var/spack/repos/builtin/packages/ensmallen/package.py new file mode 100644 index 0000000000..213e14b51f --- /dev/null +++ b/var/spack/repos/builtin/packages/ensmallen/package.py @@ -0,0 +1,31 @@ +# Copyright 2013-2023 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.package import * + + +class Ensmallen(CMakePackage): + """ensmallen is a high-quality C++ library for non-linear numerical + optimization. + + ensmallen provides many types of optimizers that can be used for + virtually any numerical optimization task. This includes gradient + descent techniques, gradient-free optimizers, and constrained + optimization. ensmallen also allows optional callbacks to customize + the optimization process.""" + + homepage = "https://ensmallen.org" + url = "https://github.com/mlpack/ensmallen/archive/refs/tags/2.19.1.tar.gz" + + version("2.19.1", sha256="f36ad7f08b0688d2a8152e1c73dd437c56ed7a5af5facf65db6ffd977b275b2e") + + variant("openmp", default=True, description="Use OpenMP for parallelization") + + depends_on("cmake@3.3.2:") + depends_on("armadillo@9.800.0:") + + def cmake_args(self): + args = [self.define_from_variant("USE_OPENMP", "openmp")] + return args diff --git a/var/spack/repos/builtin/packages/r-rcppensmallen/package.py b/var/spack/repos/builtin/packages/r-rcppensmallen/package.py new file mode 100644 index 0000000000..c4c1fb3a0e --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rcppensmallen/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2023 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.package import * + + +class RRcppensmallen(RPackage): + """Rcpp integration for the Ensmallen templated C++ mathematical optimization library.""" + + cran = "RcppEnsmallen" + + version( + "0.2.19.0.1", sha256="b4a9bde4dde309a52a47b56790389ecab14fe64066098d2a38b1b588ba3d8631" + ) + + depends_on("r@3.3.0:", type=("build", "run")) + depends_on("r-rcpp", type=("build", "run")) + depends_on("r-rcpparmadillo@0.9.800.0.0:", type=("build", "run")) -- cgit v1.2.3-70-g09d2