From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH 04/18] gnu: Add r-spams. Date: Thu, 24 Nov 2016 17:51:25 +0100 Message-ID: <20161124165139.13740-5-rekado@elephly.net> References: <20161124165139.13740-1-rekado@elephly.net> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9xFp-0005bt-Jq for guix-devel@gnu.org; Thu, 24 Nov 2016 11:52:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9xFo-0002B5-Bt for guix-devel@gnu.org; Thu, 24 Nov 2016 11:52:09 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c9xFo-00029W-2Q for guix-devel@gnu.org; Thu, 24 Nov 2016 11:52:08 -0500 In-Reply-To: <20161124165139.13740-1-rekado@elephly.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/statistics.scm (r-spams): New variable. --- gnu/packages/statistics.scm | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 0ba3316..dcf6dbe 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3342,6 +3342,58 @@ character vector.") from within R.") (license license:expat))) +(define-public r-spams + (package + (name "r-spams") + (version "2.5-svn2014-07-04") + (source + (origin + (method url-fetch) + (uri (string-append "https://gforge.inria.fr/frs/download.php/33815/" + "spams-R-v" version ".tar.gz")) + (sha256 + (base32 + "1k459jg9a334slkw31w63l4d39xszjzsng7dv5j1mp78zifz7hvx")))) + (build-system r-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ (chdir "spams") #t)) + ;; Since R 3.3.0 including R headers inside of an extern "C" block + ;; causes C headers to be included, which results in a lot of + ;; duplicate definitions. This can be avoided by defining + ;; NO_C_HEADERS before including the R headers. + (add-after 'chdir 'patch-use-of-R-headers + (lambda _ + (substitute* "src/spams.cpp" + (("#include " line) + (string-append "#define NO_C_HEADERS\n" line))) + #t)) + ;; This looks like a syntax error. + (add-after 'chdir 'patch-isnan + (lambda _ + (substitute* '"src/spams/linalg/linalg.h" + (("if isnan\\(lambda\\) \\{") + "if (isnan(lambda)) {")) + #t))))) + (home-page "http://spams-devel.gforge.inria.fr") + (synopsis "Toolbox for solving sparse estimation problems") + (description "SPAMS (SPArse Modeling Software) is an optimization toolbox +for solving various sparse estimation problems. It includes tools for the +following problems: + +@enumerate +@item Dictionary learning and matrix factorization (NMF, sparse @dfn{principle + component analysis} (PCA), ...) +@item Solving sparse decomposition problems with LARS, coordinate descent, + OMP, SOMP, proximal methods +@item Solving structured sparse decomposition problems (l1/l2, l1/linf, sparse + group lasso, tree-structured regularization, structured sparsity with + overlapping groups,...). +@end enumerate\n") + (license license:gpl3+))) + (define-public r-rpart (package (name "r-rpart") -- 2.10.2