GNU bug report logs - #48785
[PATCH 0/3] Update LightGBM and split frontends.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Vinicius Monego <monego@HIDDEN>; Keywords: patch; dated Tue, 1 Jun 2021 22:06:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 7 Apr 2023 15:17:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 07 11:17:43 2023
Received: from localhost ([127.0.0.1]:57055 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pknqR-0007yv-FF
	for submit <at> debbugs.gnu.org; Fri, 07 Apr 2023 11:17:43 -0400
Received: from mout01.posteo.de ([185.67.36.65]:50835)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1pknqO-0007yP-QB
 for 48785 <at> debbugs.gnu.org; Fri, 07 Apr 2023 11:17:42 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 49E1B24027F
 for <48785 <at> debbugs.gnu.org>; Fri,  7 Apr 2023 17:17:35 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1680880655; bh=G8dFfDtfqDiXDa5uP7HwtHSZfbDzYan/Bj8mDwcJVBc=;
 h=From:To:Cc:Subject:Date:From;
 b=lL7kCc+8eiUT7O6nzoiTqSzY+6LHNT5aAjK1adGl36yF+5l7U7mKDtoyx71VpBs1h
 /uFElNDA4hqPdaIz/IGtAACIvVDYNL9JJ/Kt7WhUsPIhQCaWHEM7HmBxgRNWGg7Nmm
 9Z9VavtNZ5VUOcNS+hB/Y4wzKH9qq63FvWIWW1w0gjbr2MImrzROBUKZt7eZbNTuXL
 flNaZS7nnr7Rphtmmrq6onHJtE4w62v+Yh3nHOfLdYerlPxlngg/n3GdY555GGrcZg
 gOnvmYnQRjWyFVDaZiXGZ+ZGxUKbDQF6ZZysyz0Q4ptsWkIK7cKk7cXFiTwRu9IBl0
 om5uPf5x9Qb9Q==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4PtMRy1wB8z6trm;
 Fri,  7 Apr 2023 17:17:34 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v5 3/3] gnu: Add python-lightgbm.
Date: Fri,  7 Apr 2023 15:17:17 +0000
Message-Id: <20230407151717.1429006-3-monego@HIDDEN>
In-Reply-To: <20230407151717.1429006-1-monego@HIDDEN>
References: <20230407151717.1429006-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/machine-learning.scm (python-lightgbm): New variable.
---
 gnu/packages/machine-learning.scm | 55 +++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 248e318eea..1585f09992 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1511,6 +1511,61 @@ (define-public lightgbm
 @end itemize\n")
     (license license:expat)))
 
+(define-public python-lightgbm
+  (package
+    (inherit lightgbm)
+    (name "python-lightgbm")
+    (source (package-source lightgbm))
+    (build-system python-build-system)
+    (arguments
+     (list #:configure-flags #~(list "--precompile") ; use our library
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'preparations
+                 (lambda _
+                   (setenv "HOME" "/tmp") ; to write a log file
+                   (rename-file "python-package/setup.py" "setup.py")
+                   (rename-file "python-package/README.rst" "README.rst")
+                   (rename-file "python-package/lightgbm" "lightgbm")
+                   ;; Write the version so the module identifies it.
+                   (with-output-to-file "lightgbm/VERSION.txt"
+                     (lambda () (display #$(package-version lightgbm))))
+                   ;; Manually install the lib.
+                   (substitute* "setup.py"
+                     (("'install_lib': CustomInstallLib,") ""))))
+               (add-after 'install 'install-liblightgbm
+                 ;; LightGBM's setup.py hardcodes LIB_PATH to look for
+                 ;; lib_lightgbm.so in this source, which we can't modify.
+                 ;; So, we symlink it in the install phase.
+                 (lambda _
+                   (let* ((pylib (string-append #$output
+                                                "/lib/python"
+                                                #$(version-major+minor
+                                                   (package-version
+                                                    python))
+                                                "/site-packages"))
+                          (lgbdir (string-append pylib "/lightgbm"))
+                          (lib-lightgbm (string-append
+                                         #$(this-package-input "lightgbm")
+                                         "/lib/lib_lightgbm.so")))
+                     ;; For whatever reason, the first symlink is required for
+                     ;; the check phase and the second for sanity-check.
+                     (symlink lib-lightgbm "lightgbm/lib_lightgbm.so")
+                     (mkdir-p (string-append lgbdir "/lib"))
+                     (symlink lib-lightgbm
+                              (string-append lgbdir
+                                             "/lib_lightgbm.so")))))
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (invoke "python" "-m" "pytest"
+                             "tests/python_package_test")))))))
+    (native-inputs (list python-psutil python-pytest python-wheel))
+    (inputs (list lightgbm))
+    (propagated-inputs (list python-numpy python-pandas python-scikit-learn
+                             python-scipy))
+    (synopsis "Python interface for LightGBM")))
+
 (define-public vowpal-wabbit
   ;; Language bindings not included.
   (package
-- 
2.34.1





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 7 Apr 2023 15:17:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 07 11:17:40 2023
Received: from localhost ([127.0.0.1]:57051 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pknqN-0007yg-Tm
	for submit <at> debbugs.gnu.org; Fri, 07 Apr 2023 11:17:40 -0400
Received: from mout01.posteo.de ([185.67.36.65]:47291)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1pknqL-0007yF-2w
 for 48785 <at> debbugs.gnu.org; Fri, 07 Apr 2023 11:17:37 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 3901C24027F
 for <48785 <at> debbugs.gnu.org>; Fri,  7 Apr 2023 17:17:31 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1680880651; bh=1Di1BKwRFM47g7xv3KaI3BFVhs7W4+DqVtHQVE9ESf8=;
 h=From:To:Cc:Subject:Date:From;
 b=OvC4m+p+C+Uh8q/FsuAuCLKvPtJYKY6rUX/YrJqUbbMeQq7PbjlDJQFH5jKHrwKl4
 WFH1FN45HZ+DvPg6kIJxTrTObwbcYmxfKvakhUIyXGtoTo3XTXOWax+fZ4vmcYRZnu
 F/LQacSVM9M/4FUdjYpbuuaaXroA7VOHo+6tpCxj5bBE0TNolQ2T+bs8ZBN8VwTqsN
 HQKlohNNdEGtMEouynXTphukyuu3owZkyZf/IDEhgvupfct00aEEWUINTXWJVT3wPF
 +ulcVtsWRfhnkwZ1cnnvRdrDHR7IrPn1b9nO6nh+oCeW9c69r3OLtlRogdNNuI+Lb8
 73H2shjlD7p/w==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4PtMRt1Yrdz6tvm;
 Fri,  7 Apr 2023 17:17:29 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v5 2/3] gnu: lightgbm: Update to 3.3.5.
Date: Fri,  7 Apr 2023 15:17:16 +0000
Message-Id: <20230407151717.1429006-2-monego@HIDDEN>
In-Reply-To: <20230407151717.1429006-1-monego@HIDDEN>
References: <20230407151717.1429006-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/machine-learning.scm (lightgbm): Update to 3.3.5.
[source]: Add patch.
[native-inputs]: Add opencl-headers.
[inputs]: Add boost, eigen, fast-double-parser, fmt, ocl-icd.
[propagated-inputs]: Remove python-numpy, python-scipy.
[arguments]: Add #:tests?, #:test-target.  Pass "-DBUILD_CPP_TEST=OFF"
and "-DUSE_GPU=ON" to #:configure-flags.  Don't override the check
phase.  Use G-expressions.
* gnu/packages/patches/lightgbm-use-system-libraries.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/machine-learning.scm             | 46 +++++++--------
 .../lightgbm-use-system-libraries.patch       | 58 +++++++++++++++++++
 3 files changed, 81 insertions(+), 24 deletions(-)
 create mode 100644 gnu/packages/patches/lightgbm-use-system-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b7e19b6bc2..2ed70c98bf 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1489,6 +1489,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lierolibre-newer-libconfig.patch		\
   %D%/packages/patches/lierolibre-remove-arch-warning.patch	\
   %D%/packages/patches/lierolibre-try-building-other-arch.patch	\
+  %D%/packages/patches/lightgbm-use-system-libraries.patch	\
   %D%/packages/patches/linbox-fix-pkgconfig.patch		\
   %D%/packages/patches/linphone-desktop-without-sdk.patch	\
   %D%/packages/patches/linux-libre-infodocs-target.patch	\
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 37d4ef78ad..248e318eea 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -83,9 +83,11 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages ninja)
   #:use-module (gnu packages ocaml)
   #:use-module (gnu packages onc-rpc)
+  #:use-module (gnu packages opencl)
   #:use-module (gnu packages parallel)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -1472,31 +1474,27 @@ (define-public python-autograd
 (define-public lightgbm
   (package
     (name "lightgbm")
-    (version "2.0.12")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                     (url "https://github.com/Microsoft/LightGBM")
-                     (commit (string-append "v" version))))
-              (sha256
-               (base32
-                "0jlvyn7k81dzrh9ij3zw576wbgiwmmr26rzpdxjn1dbpc3njpvzi"))
-              (file-name (git-file-name name version))))
-    (native-inputs
-     (list python-pytest python-nose))
-    (inputs
-     (list openmpi))
-    (propagated-inputs
-     (list python-numpy python-scipy))
+    (version "3.3.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Microsoft/LightGBM")
+             (commit (string-append "v" version))))
+       (patches
+        (search-patches "lightgbm-use-system-libraries.patch"))
+       (sha256
+        (base32 "0fljcnlj02pn2y5lxq16rsg6hm0wq4adzrl52i0s8whpcdrgsc0a"))
+       (file-name (git-file-name name version))))
     (arguments
-     `(#:configure-flags
-       '("-DUSE_MPI=ON")
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             (with-directory-excursion "../source"
-               (invoke "pytest" "tests/c_api_test/test_.py")))))))
+     (list
+      #:tests? #f        ; FIXME: googletest is not found by CMake
+      #:test-target "testlightgbm"
+      #:configure-flags #~(list "-DBUILD_CPP_TEST=OFF"
+                                "-DUSE_GPU=ON" ;using OpenCL
+                                "-DUSE_MPI=ON")))
+    (native-inputs (list opencl-headers))
+    (inputs (list boost eigen fast-double-parser fmt ocl-icd openmpi))
     (build-system cmake-build-system)
     (home-page "https://github.com/Microsoft/LightGBM")
     (synopsis "Gradient boosting framework based on decision tree algorithms")
diff --git a/gnu/packages/patches/lightgbm-use-system-libraries.patch b/gnu/packages/patches/lightgbm-use-system-libraries.patch
new file mode 100644
index 0000000000..115ca02775
--- /dev/null
+++ b/gnu/packages/patches/lightgbm-use-system-libraries.patch
@@ -0,0 +1,58 @@
+From 894648291b9629d51785e4fd1cae820d2858e039 Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@HIDDEN>
+Date: Mon, 31 May 2021 21:23:52 -0300
+Subject: [PATCH] Use system libraries.
+
+---
+ CMakeLists.txt                  | 11 ++++++++---
+ include/LightGBM/utils/common.h |  4 ++--
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b845f36..560e477 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -93,9 +93,6 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
+-SET(EIGEN_DIR "${PROJECT_SOURCE_DIR}/external_libs/eigen")
+-include_directories(${EIGEN_DIR})
+-
+ # See https://gitlab.com/libeigen/eigen/-/blob/master/COPYING.README
+ ADD_DEFINITIONS(-DEIGEN_MPL2_ONLY)
+ 
+@@ -399,6 +396,14 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
++find_package (Eigen3 3.3 REQUIRED NO_MODULE)
++TARGET_LINK_LIBRARIES (lightgbm Eigen3::Eigen)
++TARGET_LINK_LIBRARIES (_lightgbm Eigen3::Eigen)
++
++find_package(fmt)
++TARGET_LINK_LIBRARIES(lightgbm fmt::fmt)
++TARGET_LINK_LIBRARIES(_lightgbm fmt::fmt)
++
+ if(USE_MPI)
+   TARGET_LINK_LIBRARIES(lightgbm ${MPI_CXX_LIBRARIES})
+   TARGET_LINK_LIBRARIES(_lightgbm ${MPI_CXX_LIBRARIES})
+diff --git a/include/LightGBM/utils/common.h b/include/LightGBM/utils/common.h
+index 4357357..00101a5 100644
+--- a/include/LightGBM/utils/common.h
++++ b/include/LightGBM/utils/common.h
+@@ -32,9 +32,9 @@
+ 
+ #if (!((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))))
+ #define FMT_HEADER_ONLY
+-#include "../../../external_libs/fmt/include/fmt/format.h"
++#include "fmt/format.h"
+ #endif
+-#include "../../../external_libs/fast_double_parser/include/fast_double_parser.h"
++#include "fast_double_parser.h"
+ 
+ #ifdef _MSC_VER
+ #include <intrin.h>
+-- 
+2.31.1
+
-- 
2.34.1





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 7 Apr 2023 15:17:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 07 11:17:35 2023
Received: from localhost ([127.0.0.1]:57047 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pknqJ-0007yO-ER
	for submit <at> debbugs.gnu.org; Fri, 07 Apr 2023 11:17:35 -0400
Received: from mout02.posteo.de ([185.67.36.66]:33347)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1pknqG-0007yA-Uo
 for 48785 <at> debbugs.gnu.org; Fri, 07 Apr 2023 11:17:34 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id D1AB02403F5
 for <48785 <at> debbugs.gnu.org>; Fri,  7 Apr 2023 17:17:26 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1680880646; bh=yPq/VKqiYXBWq36RdeY5S/8E9ICKLMG1VOAUh1PhpEE=;
 h=From:To:Cc:Subject:Date:From;
 b=ZCiyKn5Mh+SHpbtXnozdNprqmL+oUO85/pj9sLk5JanN71OAElehApXNVNYBFSeMZ
 jLk20WPorJTJC3LffFZ+LjKQCkWAu4S9aS+XwQXB8vN8ks9eTlT7njgkpEplUdh7oD
 wqWmKeGk3sYp1SEgptTyZvlkdHdQE77IDKQ+2/kV9smaBILDlHpNllD/HAq9ySiKsl
 tdXujzzstR8XmgYDu5lEW0rF2stHfwA06QGEr2h+ut0f3R5TF5eC98vqJ/1bHWKoFs
 mgMmDvMiKCkUbYchw+3/mlrHYTRoPTNRTp8+6tNwgXNIOTVM0zdEkv7wITKNmc9CBR
 /oKbXIPBq9pmg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4PtMRn63HXz6twX;
 Fri,  7 Apr 2023 17:17:25 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v5 1/3] gnu: Add fast-double-parser.
Date: Fri,  7 Apr 2023 15:17:15 +0000
Message-Id: <20230407151717.1429006-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/cpp.scm (fast-double-parser): New variable.
---
 gnu/packages/cpp.scm | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index ed6ae69198..af1d436bc2 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Roel Janssen <roel@HIDDEN>
 ;;; Copyright © 2020, 2021, 2023 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2020 Brice Waegeneire <brice@HIDDEN>
-;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@HIDDEN>
+;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego <monego@HIDDEN>
 ;;; Copyright © 2020, 2022 Marius Bakke <marius@HIDDEN>
 ;;; Copyright © 2020 Michael Rohleder <mike@HIDDEN>
 ;;; Copyright © 2020 Alexandros Theodotou <alex@HIDDEN>
@@ -445,6 +445,39 @@ (define-public xsimd
 operating on batches.")
     (license license:bsd-3)))
 
+(define-public fast-double-parser
+  (package
+    (name "fast-double-parser")
+    (version "0.7.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/lemire/fast_double_parser")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0c3ajwm65yip61iq3ybvrkx5d3136r9dc68j1c1fmrv61n5nfmlb"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               ;; There is no install target, we have to do it manually.
+               (replace 'install
+                 (lambda _
+                   (mkdir-p (string-append #$output "/include"))
+                   (copy-file
+                    (string-append #$(package-source this-package)
+                                   "/include/fast_double_parser.h")
+                    (string-append #$output
+                                   "/include/fast_double_parser.h")))))))
+    (home-page "https://github.com/lemire/fast_double_parser")
+    (synopsis "Parse strings into double floating-point values")
+    (description "@code{fast-double-parser} provides a fast function to parse
+strings into double (binary64) floating-point values, enforces the RFC 7159
+(JSON standard) grammar.")
+    (license license:asl2.0)))
+
 (define-public google-highway
   (package
     (name "google-highway")

base-commit: 2853a4dd5eee7eedb1c19a5fd2d0f2ca468a4509
-- 
2.34.1





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 31 Oct 2021 01:45:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 30 21:45:33 2021
Received: from localhost ([127.0.0.1]:58697 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mgzuf-0000s8-Ey
	for submit <at> debbugs.gnu.org; Sat, 30 Oct 2021 21:45:33 -0400
Received: from mout02.posteo.de ([185.67.36.66]:52561)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1mgzub-0000rV-JR
 for 48785 <at> debbugs.gnu.org; Sat, 30 Oct 2021 21:45:30 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id E2447240101
 for <48785 <at> debbugs.gnu.org>; Sun, 31 Oct 2021 02:45:23 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1635644723; bh=t6w17uoPP4XRJNb7cZWrWmwDl7CgY+YCegf9CASefNo=;
 h=From:To:Cc:Subject:Date:From;
 b=Cb+6ea0Brb8qwJhXJoKii67m+8pKQDsKbPD5lRpDdK40pP4vTpq/UCfCQyZti8QLr
 /+/rmhWFKsb37MXyMiGoKrDJdFyLzkT6ZIfFVL+e3RwwcpjwUzkEdwyYu2WFaMEWEo
 vu3HrNKqVA5DBWoUrOhvNl8MzAULh6b/WqDbLYDlRhoO/ClV/wACtqtkhGRCjQuAZF
 2uNcbPm8XVIsp/90zIOYoDVAQhRapuN6GyRbPNcMjTRT5aUiXI0VP2VGI+A0qYqoYE
 dTuQst494hq90S/uWT5eagKGY3RhoC8aAlPNq+Lzou27uG7UV2/qNkFdCi0WRASM+W
 +1wOZmioFZf1g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4HhfBC069jz9rxQ;
 Sun, 31 Oct 2021 02:45:22 +0100 (CET)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v4 3/3] gnu: Add python-lightgbm.
Date: Sun, 31 Oct 2021 01:40:28 +0000
Message-Id: <20211031014028.82583-3-monego@HIDDEN>
In-Reply-To: <20211031014028.82583-1-monego@HIDDEN>
References: <20211031014028.82583-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/machine-learning.scm (python-lightgbm): New variable.
---
 gnu/packages/machine-learning.scm | 59 +++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index c7613ebe4e..59e9fdc75b 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1268,6 +1268,65 @@ the following advantages:
 @end itemize\n")
     (license license:expat)))
 
+(define-public python-lightgbm
+  (package
+    (inherit lightgbm)
+    (name "python-lightgbm")
+    (source (package-source lightgbm))
+    (build-system python-build-system)
+    (arguments
+     `(#:configure-flags (list "--precompile") ; use precompiled library
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'preparations
+           (lambda _
+             (setenv "HOME" "/tmp")     ;to write a log file
+             ;; Move Python files to source root to silence some warnings.
+             (rename-file "python-package/setup.py" "setup.py")
+             (rename-file "python-package/README.rst" "README.rst")
+             (rename-file "python-package/lightgbm" "lightgbm")
+             ;; Install version file to read the library's version.
+             (with-output-to-file "lightgbm/VERSION.txt"
+               (lambda ()
+                 (display ,(package-version lightgbm))))
+             ;; Skip building the shared library.
+             (substitute* "setup.py"
+               (("'install_lib': CustomInstallLib,") ""))))
+         (add-after 'install 'install-liblightgbm
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (pylib (string-append out "/lib/python"
+                                          ,(version-major+minor
+                                            (package-version python))
+                                          "/site-packages"))
+                    (lgbdir (string-append pylib "/lightgbm"))
+                    (lib-lightgbm (string-append (assoc-ref inputs "lightgbm")
+                                                 "/lib/lib_lightgbm.so")))
+               ;; This symlink is necessary for tests.
+               (symlink lib-lightgbm "lightgbm/lib_lightgbm.so")
+               ;; And this one for runtime.
+               (mkdir-p (string-append lgbdir "/lib"))
+               (symlink lib-lightgbm (string-append lgbdir
+                                                    "/lib_lightgbm.so")))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest"
+                       "tests/python_package_test")))))))
+    (native-inputs
+     `(("python-psutil" ,python-psutil)
+       ("python-pytest" ,python-pytest)
+       ("python-wheel" ,python-wheel)))
+    (inputs
+     `(("lightgbm" ,lightgbm)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-pandas" ,python-pandas)
+       ("python-scikit-learn" ,python-scikit-learn)
+       ("python-scipy" ,python-scipy)))
+    (synopsis "Python frontend for LightGBM")))
+
 (define-public vowpal-wabbit
   ;; Language bindings not included.
   (package
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 31 Oct 2021 01:45:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 30 21:45:32 2021
Received: from localhost ([127.0.0.1]:58695 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mgzud-0000ru-UV
	for submit <at> debbugs.gnu.org; Sat, 30 Oct 2021 21:45:32 -0400
Received: from mout02.posteo.de ([185.67.36.66]:48339)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1mgzuX-0000rP-93
 for 48785 <at> debbugs.gnu.org; Sat, 30 Oct 2021 21:45:26 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 95F10240101
 for <48785 <at> debbugs.gnu.org>; Sun, 31 Oct 2021 02:45:19 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1635644719; bh=Zyy1/0WKKEYKJz9vM/X3LMxDdhnentyW4LzqBzA87NM=;
 h=From:To:Cc:Subject:Date:From;
 b=D2zsi0VHrdUmqz5smB/TL8X8f2CZTytKMiXs+CYqBbbJoubSZMF5GCXp8P73akthc
 OuQ9yEvEjgwXbHvTpgrg2uFxdBP+bQAbfFGHDtfveS3L9NYhySHycwfOhGcVYsFWya
 +iojIXlOb+OYq+YswS0iQ019URBS7dX8ddfjuTDWNwVDMcTfJlHcsmMJrrzvB2DFlI
 QKKgEW2Wesc93n1HtsmJ9J1NsMomzOZiPIdw8ybryRvJcCcaiPp+QjSmGhJ2UuAno+
 A/gJMfpB9kZbAgKTZiejS1/EFaQF1xcCLE7Ay4cO1yI3i9u5CVi+2jhwY5+aypgmn7
 3xR2kxr1+nrSA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4HhfB65ZM1z6tm5;
 Sun, 31 Oct 2021 02:45:18 +0100 (CET)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v4 2/3] gnu: lightgbm: Update to 3.3.1.
Date: Sun, 31 Oct 2021 01:40:27 +0000
Message-Id: <20211031014028.82583-2-monego@HIDDEN>
In-Reply-To: <20211031014028.82583-1-monego@HIDDEN>
References: <20211031014028.82583-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/machine-learning.scm (lightgbm): Update to 3.3.1.
[source]: Add patch.
[native-inputs]: Add opencl-headers.
[inputs]: Add boost, eigen, fast-double-parser, fmt, ocl-icd.
[propagated-inputs]: Remove.
[arguments]: Add #:tests?, #:test-target. Pass "-DBUILD_CPP_TEST=OFF" and
"-DUSE_GPU=ON" to #:configure-flags. Don't override 'check phase.
* gnu/packages/patches/lightgbm-use-system-libraries.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
---
Updated to 3.3.1.

 gnu/local.mk                                  |  1 +
 gnu/packages/machine-learning.scm             | 52 +++++++++--------
 .../lightgbm-use-system-libraries.patch       | 58 +++++++++++++++++++
 3 files changed, 87 insertions(+), 24 deletions(-)
 create mode 100644 gnu/packages/patches/lightgbm-use-system-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index baba6be058..4dcfe9996c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1437,6 +1437,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lierolibre-newer-libconfig.patch		\
   %D%/packages/patches/lierolibre-remove-arch-warning.patch	\
   %D%/packages/patches/lierolibre-try-building-other-arch.patch	\
+  %D%/packages/patches/lightgbm-use-system-libraries.patch	\
   %D%/packages/patches/linbox-fix-pkgconfig.patch		\
   %D%/packages/patches/linphone-desktop-without-sdk.patch           \
   %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 029422677a..c7613ebe4e 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -74,8 +74,10 @@
   #:use-module (gnu packages ocaml)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages parallel)
+  #:use-module (gnu packages opencl)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
@@ -1221,33 +1223,35 @@ main intended application of Autograd is gradient-based optimization.")
 (define-public lightgbm
   (package
     (name "lightgbm")
-    (version "2.0.12")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                     (url "https://github.com/Microsoft/LightGBM")
-                     (commit (string-append "v" version))))
-              (sha256
-               (base32
-                "0jlvyn7k81dzrh9ij3zw576wbgiwmmr26rzpdxjn1dbpc3njpvzi"))
-              (file-name (git-file-name name version))))
+    (version "3.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Microsoft/LightGBM")
+             (commit (string-append "v" version))))
+       (patches
+        (search-patches "lightgbm-use-system-libraries.patch"))
+       (sha256
+        (base32 "0cwyb371xra5qnwkhpn223z3yqrppisgvx173an8i3f6m83zwb38"))
+       (file-name (git-file-name name version))))
     (native-inputs
-     `(("python-pytest" ,python-pytest)
-       ("python-nose" ,python-nose)))
+     `(;; ("googletest" ,googletest)
+       ("opencl-headers" ,opencl-headers)))
     (inputs
-     `(("openmpi" ,openmpi)))
-    (propagated-inputs
-     `(("python-numpy" ,python-numpy)
-       ("python-scipy" ,python-scipy)))
+     `(("boost" ,boost)
+       ("eigen" ,eigen)
+       ("fast-double-parser" ,fast-double-parser)
+       ("fmt" ,fmt)
+       ("ocl-icd" ,ocl-icd)
+       ("openmpi" ,openmpi)))
     (arguments
-     `(#:configure-flags
-       '("-DUSE_MPI=ON")
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             (with-directory-excursion "../source"
-               (invoke "pytest" "tests/c_api_test/test_.py")))))))
+     `(#:tests? #f ;; FIXME: googletest is not found by CMake
+       #:test-target "testlightgbm"
+       #:configure-flags
+       (list "-DBUILD_CPP_TEST=OFF"
+             "-DUSE_GPU=ON" ;using OpenCL
+             "-DUSE_MPI=ON")))
     (build-system cmake-build-system)
     (home-page "https://github.com/Microsoft/LightGBM")
     (synopsis "Gradient boosting framework based on decision tree algorithms")
diff --git a/gnu/packages/patches/lightgbm-use-system-libraries.patch b/gnu/packages/patches/lightgbm-use-system-libraries.patch
new file mode 100644
index 0000000000..115ca02775
--- /dev/null
+++ b/gnu/packages/patches/lightgbm-use-system-libraries.patch
@@ -0,0 +1,58 @@
+From 894648291b9629d51785e4fd1cae820d2858e039 Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@HIDDEN>
+Date: Mon, 31 May 2021 21:23:52 -0300
+Subject: [PATCH] Use system libraries.
+
+---
+ CMakeLists.txt                  | 11 ++++++++---
+ include/LightGBM/utils/common.h |  4 ++--
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b845f36..560e477 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -93,9 +93,6 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
+-SET(EIGEN_DIR "${PROJECT_SOURCE_DIR}/external_libs/eigen")
+-include_directories(${EIGEN_DIR})
+-
+ # See https://gitlab.com/libeigen/eigen/-/blob/master/COPYING.README
+ ADD_DEFINITIONS(-DEIGEN_MPL2_ONLY)
+ 
+@@ -399,6 +396,14 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
++find_package (Eigen3 3.3 REQUIRED NO_MODULE)
++TARGET_LINK_LIBRARIES (lightgbm Eigen3::Eigen)
++TARGET_LINK_LIBRARIES (_lightgbm Eigen3::Eigen)
++
++find_package(fmt)
++TARGET_LINK_LIBRARIES(lightgbm fmt::fmt)
++TARGET_LINK_LIBRARIES(_lightgbm fmt::fmt)
++
+ if(USE_MPI)
+   TARGET_LINK_LIBRARIES(lightgbm ${MPI_CXX_LIBRARIES})
+   TARGET_LINK_LIBRARIES(_lightgbm ${MPI_CXX_LIBRARIES})
+diff --git a/include/LightGBM/utils/common.h b/include/LightGBM/utils/common.h
+index 4357357..00101a5 100644
+--- a/include/LightGBM/utils/common.h
++++ b/include/LightGBM/utils/common.h
+@@ -32,9 +32,9 @@
+ 
+ #if (!((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))))
+ #define FMT_HEADER_ONLY
+-#include "../../../external_libs/fmt/include/fmt/format.h"
++#include "fmt/format.h"
+ #endif
+-#include "../../../external_libs/fast_double_parser/include/fast_double_parser.h"
++#include "fast_double_parser.h"
+ 
+ #ifdef _MSC_VER
+ #include <intrin.h>
+-- 
+2.31.1
+
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 31 Oct 2021 01:45:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 30 21:45:31 2021
Received: from localhost ([127.0.0.1]:58692 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mgzuZ-0000ri-40
	for submit <at> debbugs.gnu.org; Sat, 30 Oct 2021 21:45:31 -0400
Received: from mout02.posteo.de ([185.67.36.66]:55925)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1mgzuU-0000rL-De
 for 48785 <at> debbugs.gnu.org; Sat, 30 Oct 2021 21:45:26 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id E5EF8240101
 for <48785 <at> debbugs.gnu.org>; Sun, 31 Oct 2021 02:45:15 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1635644715; bh=mBdpECEOYzfD8QjI1nLEDxyKmgw2s0gwyWxJqCjnvjQ=;
 h=From:To:Cc:Subject:Date:From;
 b=B40PpKZohK6VrY9Tp6eWQMZjSmCDXIdGXB0DM9B2PIhlWzmCWW2miDxLLJKwhgVH2
 eqynil2X8OeudCkoBGcwPSPc/ndzAp46eczPziTbes6f2tP1qizOoeBDk9Jr8UGYlh
 QlKTvDtv8us1Yq5ZGtB9zvYerWzg9T8CKKLVCruW5iFy6uGGCVY1WPjon/vMDXMQf+
 5GcjDZq6Y1G/0cq6w9pBXScZM7c7P0PQdFlVIkpINAD+i9jQdAxJDGiKbjPOuwLRDH
 rl7zfZ+ELPe+rDF+Ewvx0I+9tq3glejWPMv6OfViN6s1wkBVecVjy5uZGXXvMDzp66
 I9Mbtr5JhDhTQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4HhfB14xP7z6tm4;
 Sun, 31 Oct 2021 02:45:13 +0100 (CET)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v4 1/3] gnu: Add fast-double-parser.
Date: Sun, 31 Oct 2021 01:40:26 +0000
Message-Id: <20211031014028.82583-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/cpp.scm (fast-double-parser): New variable.
---
 gnu/packages/cpp.scm | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 643b85a8db..3bf51e6e78 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Roel Janssen <roel@HIDDEN>
 ;;; Copyright © 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2020 Brice Waegeneire <brice@HIDDEN>
-;;; Copyright © 2020 Vinicius Monego <monego@HIDDEN>
+;;; Copyright © 2020, 2021 Vinicius Monego <monego@HIDDEN>
 ;;; Copyright © 2020 Marius Bakke <marius@HIDDEN>
 ;;; Copyright © 2020 Michael Rohleder <mike@HIDDEN>
 ;;; Copyright © 2020 Alexandros Theodotou <alex@HIDDEN>
@@ -330,6 +330,42 @@ functions, class methods, and stl containers.
 @end enumerate\n")
     (license license:bsd-3)))
 
+(define-public fast-double-parser
+  (package
+    (name "fast-double-parser")
+    (version "0.5.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/lemire/fast_double_parser")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "10mfpy4i7lpavghb15s4d0920nlwsac1ri2sxkcqbrj9iq94qj71"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'install ;no install target, have to do it manually
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out-include (string-append (assoc-ref outputs "out")
+                                               "/include")))
+               (mkdir-p out-include)
+               (copy-file "../source/include/fast_double_parser.h"
+                          (string-append out-include
+                                         "/fast_double_parser.h"))))))))
+    (home-page "https://github.com/lemire/fast_double_parser")
+    (synopsis "Parse strings into double (binary64) floating-point values")
+    (description "Fast function to parse strings containing decimal numbers
+into double-precision (binary64) floating-point values.  That is, given the
+string @code{1.0e10}, it should return a 64-bit floating-point value equal to
+10000000000.  The function will match exactly (down the smallest bit) the
+result of a standard function like @code{strtod}.")
+    ;; Dual-licensed, either license applies.
+    (license (list license:asl2.0
+                   license:boost1.0))))
+
 (define-public fifo-map
   (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
          (revision "0")

base-commit: 142344b6efa42e1a4d57a4bdf14dfb3ca1cba25a
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 8 Oct 2021 02:54:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 22:54:38 2021
Received: from localhost ([127.0.0.1]:48827 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYg1t-0008GF-UF
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 22:54:38 -0400
Received: from mout01.posteo.de ([185.67.36.65]:35741)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1mYg1p-0008Fg-PA
 for 48785 <at> debbugs.gnu.org; Thu, 07 Oct 2021 22:54:34 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 23E79240026
 for <48785 <at> debbugs.gnu.org>; Fri,  8 Oct 2021 04:54:28 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1633661668; bh=fKv8AJpRvGIjhAg0SM7ANLDe6TuoGHeOy4B7aXtBRhg=;
 h=From:To:Cc:Subject:Date:From;
 b=i0Au1Z7Ci6oEGomrYukiHle4u3FyOUNIwK/s+nrXdBIZBcwq8Ugfadbfs0aaPB17E
 mC+TrQC/+clK0uP9sqLiw/jGUN6X5BLSR38EERJe4qpi1s1ztmG7F/KHHYE+mHIhwz
 1GeXeTc4p8OkBdTN2zQA2aDN2SSYSiogoEXRkbG2U/HJq9UUo3qSXC1iCXCpc+244a
 2oM4vrvZYCzBS0yWmuLCjvdhJstR28QpgL0jT3R5wFAljioxPAgU+USNpUpLzgf4jI
 x2IZ/oVZBxP5BtHJC5ddnCY3Xj/a2/dFPiTMOeLOVeT0RH3+G1P7uipo5pkcX7e5Eq
 KR54Gp3YIe0kw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4HQXpW2RYMz9rxG;
 Fri,  8 Oct 2021 04:54:27 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v3 3/3] gnu: Add python-lightgbm.
Date: Fri,  8 Oct 2021 02:54:09 +0000
Message-Id: <20211008025409.80602-3-monego@HIDDEN>
In-Reply-To: <20211008025409.80602-1-monego@HIDDEN>
References: <20211008025409.80602-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/machine-learning.scm (python-lightgbm): New variable.
---
Rebase only.

 gnu/packages/machine-learning.scm | 59 +++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 99d864a25c..e7ce107637 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1271,6 +1271,65 @@ the following advantages:
 @end itemize\n")
     (license license:expat)))
 
+(define-public python-lightgbm
+  (package
+    (inherit lightgbm)
+    (name "python-lightgbm")
+    (source (package-source lightgbm))
+    (build-system python-build-system)
+    (arguments
+     `(#:configure-flags (list "--precompile")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'preparations
+           (lambda _
+             (setenv "HOME" "/tmp") ;to write a log file
+             ;; Move Python files to source root to silence some warnings.
+             (rename-file "python-package/setup.py" "setup.py")
+             (rename-file "python-package/README.rst" "README.rst")
+             (rename-file "python-package/lightgbm" "lightgbm")
+             ;; Install version file to read the library's version.
+             (with-output-to-file "lightgbm/VERSION.txt"
+               (lambda ()
+                 (display ,(package-version lightgbm))))
+             ;; Skip building the shared library.
+             (substitute* "setup.py"
+               (("'install_lib': CustomInstallLib,") ""))))
+         (add-after 'install 'install-liblightgbm
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (pylib (string-append out "/lib/python"
+                                          ,(version-major+minor
+                                            (package-version python))
+                                          "/site-packages"))
+                    (lgbdir (string-append pylib "/lightgbm"))
+                    (lib-lightgbm (string-append (assoc-ref inputs "lightgbm")
+                                                 "/lib/lib_lightgbm.so")))
+               ;; This symlink is necessary for tests.
+               (symlink lib-lightgbm "lightgbm/lib_lightgbm.so")
+               ;; And this one for runtime.
+               (mkdir-p (string-append lgbdir "/lib"))
+               (symlink lib-lightgbm (string-append lgbdir
+                                                    "/lib_lightgbm.so")))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest"
+                       "tests/python_package_test")))))))
+    (native-inputs
+     `(("python-psutil" ,python-psutil)
+       ("python-pytest" ,python-pytest)
+       ("python-wheel" ,python-wheel)))
+    (inputs
+     `(("lightgbm" ,lightgbm)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-pandas" ,python-pandas)
+       ("python-scikit-learn" ,python-scikit-learn)
+       ("python-scipy" ,python-scipy)))
+    (synopsis "Python frontend for LightGBM")))
+
 (define-public vowpal-wabbit
   ;; Language bindings not included.
   (package
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 8 Oct 2021 02:54:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 22:54:37 2021
Received: from localhost ([127.0.0.1]:48825 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYg1t-0008G8-Bf
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 22:54:37 -0400
Received: from mout02.posteo.de ([185.67.36.66]:54983)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1mYg1m-0008Fb-KP
 for 48785 <at> debbugs.gnu.org; Thu, 07 Oct 2021 22:54:32 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 6A8D4240101
 for <48785 <at> debbugs.gnu.org>; Fri,  8 Oct 2021 04:54:24 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1633661664; bh=Tjs3E5HXVLGNztk5l0oN24N0k+5V2drghuVWpxUqIFA=;
 h=From:To:Cc:Subject:Date:From;
 b=TM8e8dU0JyYWb/dTP3dZ4BLI/wXJTXPbmVluYcMChv+ebBuH7rW1jat9dbFtMXqme
 vHs6+K91lVtlnMPXvr8MSbzeXmbHdctG52odCEO6tDZF+hv0CJhD1CHyYUUynHptc1
 ib9JLivR3nquZhpKEb/sAW1al3qbTpeXggp4B6aDK0OkmXPGqSHU75NlexSmaMVwG4
 eMGgGPUBhWkzMeCjZYSiV0IRUXNeOMhOIXLfoZ98VnSaYTaS+BqUISxteJVhO6Z6hM
 0ckL/wJWzl/xG4Qvp7siDb/4k3l3k2EChvMCJ/PdmlXALBz1x/VWiXw7Lvz6bIt6pf
 UInN1DFWyXadA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4HQXpR28dTz9rxG;
 Fri,  8 Oct 2021 04:54:23 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v3 2/3] gnu: lightgbm: Update to 3.2.1.
Date: Fri,  8 Oct 2021 02:54:08 +0000
Message-Id: <20211008025409.80602-2-monego@HIDDEN>
In-Reply-To: <20211008025409.80602-1-monego@HIDDEN>
References: <20211008025409.80602-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/machine-learning.scm (lightgbm): Update to 3.2.1.
[source]: Add patch. Make some cosmetic changes.
[native-inputs]: Add googletest, opencl-headers.
[inputs]: Add boost, eigen, fast-double-parser, fmt, ocl-icd.
[propagated-inputs]: Remove.
[arguments]: Add #:tests?, #:test-target. Pass "-DBUILD_CPP_TEST=OFF" and
"-DUSE_GPU=ON" to #:configure-flags. Remove custom 'check phase and skip
running tests.
* gnu/packages/patches/lightgbm-use-system-libraries.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
---
Changed commit message slightly.

 gnu/local.mk                                  |  1 +
 gnu/packages/machine-learning.scm             | 55 ++++++++++--------
 .../lightgbm-use-system-libraries.patch       | 58 +++++++++++++++++++
 3 files changed, 90 insertions(+), 24 deletions(-)
 create mode 100644 gnu/packages/patches/lightgbm-use-system-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index d415b892e9..35942e9188 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1420,6 +1420,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lierolibre-newer-libconfig.patch		\
   %D%/packages/patches/lierolibre-remove-arch-warning.patch	\
   %D%/packages/patches/lierolibre-try-building-other-arch.patch	\
+  %D%/packages/patches/lightgbm-use-system-libraries.patch	\
   %D%/packages/patches/linbox-fix-pkgconfig.patch		\
   %D%/packages/patches/linphone-desktop-without-sdk.patch           \
   %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 029422677a..99d864a25c 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -74,8 +74,10 @@
   #:use-module (gnu packages ocaml)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages parallel)
+  #:use-module (gnu packages opencl)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
@@ -1221,33 +1223,38 @@ main intended application of Autograd is gradient-based optimization.")
 (define-public lightgbm
   (package
     (name "lightgbm")
-    (version "2.0.12")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                     (url "https://github.com/Microsoft/LightGBM")
-                     (commit (string-append "v" version))))
-              (sha256
-               (base32
-                "0jlvyn7k81dzrh9ij3zw576wbgiwmmr26rzpdxjn1dbpc3njpvzi"))
-              (file-name (git-file-name name version))))
+    (version "3.2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Microsoft/LightGBM")
+             (commit (string-append "v" version))))
+       (patches
+        (search-patches "lightgbm-use-system-libraries.patch"))
+       (sha256
+        (base32 "1fchiiwl3pz1kpi0kbfanif6c6b688wmmjjbqz4ff4djc6g2sg7z"))
+       (file-name (git-file-name name version))))
     (native-inputs
-     `(("python-pytest" ,python-pytest)
-       ("python-nose" ,python-nose)))
+     `(("googletest" ,googletest)
+       ("opencl-headers" ,opencl-headers)))
     (inputs
-     `(("openmpi" ,openmpi)))
-    (propagated-inputs
-     `(("python-numpy" ,python-numpy)
-       ("python-scipy" ,python-scipy)))
+     `(("boost" ,boost)
+       ("eigen" ,eigen)
+       ("fast-double-parser" ,fast-double-parser)
+       ("fmt" ,fmt)
+       ("ocl-icd" ,ocl-icd)
+       ("openmpi" ,openmpi)))
     (arguments
-     `(#:configure-flags
-       '("-DUSE_MPI=ON")
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             (with-directory-excursion "../source"
-               (invoke "pytest" "tests/c_api_test/test_.py")))))))
+     `(;; FIXME: With 'find_package(GTest CONFIG)' (default), googletest
+       ;; is not found by CMake.  If we replace CONFIG with REQUIRED, the
+       ;; test files fail to link with googletest in the build phase.
+       #:tests? #f
+       #:test-target "testlightgbm"
+       #:configure-flags
+       (list "-DBUILD_CPP_TEST=OFF"
+             "-DUSE_GPU=ON" ;using OpenCL
+             "-DUSE_MPI=ON")))
     (build-system cmake-build-system)
     (home-page "https://github.com/Microsoft/LightGBM")
     (synopsis "Gradient boosting framework based on decision tree algorithms")
diff --git a/gnu/packages/patches/lightgbm-use-system-libraries.patch b/gnu/packages/patches/lightgbm-use-system-libraries.patch
new file mode 100644
index 0000000000..115ca02775
--- /dev/null
+++ b/gnu/packages/patches/lightgbm-use-system-libraries.patch
@@ -0,0 +1,58 @@
+From 894648291b9629d51785e4fd1cae820d2858e039 Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@HIDDEN>
+Date: Mon, 31 May 2021 21:23:52 -0300
+Subject: [PATCH] Use system libraries.
+
+---
+ CMakeLists.txt                  | 11 ++++++++---
+ include/LightGBM/utils/common.h |  4 ++--
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b845f36..560e477 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -93,9 +93,6 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
+-SET(EIGEN_DIR "${PROJECT_SOURCE_DIR}/external_libs/eigen")
+-include_directories(${EIGEN_DIR})
+-
+ # See https://gitlab.com/libeigen/eigen/-/blob/master/COPYING.README
+ ADD_DEFINITIONS(-DEIGEN_MPL2_ONLY)
+ 
+@@ -399,6 +396,14 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
++find_package (Eigen3 3.3 REQUIRED NO_MODULE)
++TARGET_LINK_LIBRARIES (lightgbm Eigen3::Eigen)
++TARGET_LINK_LIBRARIES (_lightgbm Eigen3::Eigen)
++
++find_package(fmt)
++TARGET_LINK_LIBRARIES(lightgbm fmt::fmt)
++TARGET_LINK_LIBRARIES(_lightgbm fmt::fmt)
++
+ if(USE_MPI)
+   TARGET_LINK_LIBRARIES(lightgbm ${MPI_CXX_LIBRARIES})
+   TARGET_LINK_LIBRARIES(_lightgbm ${MPI_CXX_LIBRARIES})
+diff --git a/include/LightGBM/utils/common.h b/include/LightGBM/utils/common.h
+index 4357357..00101a5 100644
+--- a/include/LightGBM/utils/common.h
++++ b/include/LightGBM/utils/common.h
+@@ -32,9 +32,9 @@
+ 
+ #if (!((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))))
+ #define FMT_HEADER_ONLY
+-#include "../../../external_libs/fmt/include/fmt/format.h"
++#include "fmt/format.h"
+ #endif
+-#include "../../../external_libs/fast_double_parser/include/fast_double_parser.h"
++#include "fast_double_parser.h"
+ 
+ #ifdef _MSC_VER
+ #include <intrin.h>
+-- 
+2.31.1
+
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 8 Oct 2021 02:54:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 22:54:37 2021
Received: from localhost ([127.0.0.1]:48821 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYg1o-0008Fr-AP
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 22:54:37 -0400
Received: from mout01.posteo.de ([185.67.36.65]:47971)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1mYg1j-0008FW-8x
 for 48785 <at> debbugs.gnu.org; Thu, 07 Oct 2021 22:54:31 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 77843240026
 for <48785 <at> debbugs.gnu.org>; Fri,  8 Oct 2021 04:54:20 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1633661660; bh=8cROjl+jM4DxxCglaFG+O8nPdRbaOZDSv9D7KVCWrlo=;
 h=From:To:Cc:Subject:Date:From;
 b=cmp5XLm5KYC0uk+m0s6JxSx/QO6boEepKuBOONK7J4lPFxb1B7DEikjDcHQI1V0YK
 C5XnPMxNDkt8Fpkes1wDygK5LAXQjBS8m6x7j//WyY+2SexZby1aEJYd7jbGwHLoD9
 aGjUDiEPu5568HNwHUhwSNRLOGvzYbRkqbf4JTWPwxqf5bRKgA6OSeSyweCd9yiOFW
 nhIvW56BnArpeKUnDF5WmWS6W9pr4/LssBE8IoQZKEB/MYjuORRNDIKDtZ9CbDOMpX
 V9ttg0TvdNDxV1REdUyO1l+gl8UHM+0Z3ehVFPLkc37abFBnSgcbLQRjszCmKAqqGP
 gFdn7GBCXog4Q==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4HQXpM1lm1z9rxG;
 Fri,  8 Oct 2021 04:54:18 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v3 1/3] gnu: Add fast-double-parser.
Date: Fri,  8 Oct 2021 02:54:07 +0000
Message-Id: <20211008025409.80602-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/cpp.scm (fast-double-parser): New variable.
---
Changed string to @code{} in description.

 gnu/packages/cpp.scm | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 4af71ba93a..4a8cd3a120 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Roel Janssen <roel@HIDDEN>
 ;;; Copyright © 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2020 Brice Waegeneire <brice@HIDDEN>
-;;; Copyright © 2020 Vinicius Monego <monego@HIDDEN>
+;;; Copyright © 2020, 2021 Vinicius Monego <monego@HIDDEN>
 ;;; Copyright © 2020 Marius Bakke <marius@HIDDEN>
 ;;; Copyright © 2020 Michael Rohleder <mike@HIDDEN>
 ;;; Copyright © 2020 Alexandros Theodotou <alex@HIDDEN>
@@ -331,6 +331,42 @@ functions, class methods, and stl containers.
 @end enumerate\n")
     (license license:bsd-3)))
 
+(define-public fast-double-parser
+  (package
+    (name "fast-double-parser")
+    (version "0.5.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/lemire/fast_double_parser")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "10mfpy4i7lpavghb15s4d0920nlwsac1ri2sxkcqbrj9iq94qj71"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'install ;no install target, have to do it manually
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out-include (string-append (assoc-ref outputs "out")
+                                               "/include")))
+               (mkdir-p out-include)
+               (copy-file "../source/include/fast_double_parser.h"
+                          (string-append out-include
+                                         "/fast_double_parser.h"))))))))
+    (home-page "https://github.com/lemire/fast_double_parser")
+    (synopsis "Parse strings into double (binary64) floating-point values")
+    (description "Fast function to parse strings containing decimal numbers
+into double-precision (binary64) floating-point values.  That is, given the
+string @code{1.0e10}, it should return a 64-bit floating-point value equal to
+10000000000.  The function will match exactly (down the smallest bit) the
+result of a standard function like @code{strtod}.")
+    ;; Dual-licensed, either license applies.
+    (license (list license:asl2.0
+                   license:boost1.0))))
+
 (define-public fifo-map
   (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
          (revision "0")
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 30 Jun 2021 20:10:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 30 16:10:56 2021
Received: from localhost ([127.0.0.1]:58850 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lygXw-0003zr-Hh
	for submit <at> debbugs.gnu.org; Wed, 30 Jun 2021 16:10:56 -0400
Received: from mout01.posteo.de ([185.67.36.65]:37309)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1lygXq-0003z9-8u
 for 48785 <at> debbugs.gnu.org; Wed, 30 Jun 2021 16:10:51 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 50E1B240026
 for <48785 <at> debbugs.gnu.org>; Wed, 30 Jun 2021 22:10:44 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1625083844; bh=hNCxpMTcYNyZbcxKjoeVAoS/rwmBamIGzHW750mFe9I=;
 h=From:To:Cc:Subject:Date:From;
 b=CdvJrPNB2Q0sqbGXVnuNNNEzbjzc+RuUM5I1e9nfBKY2pr4BvaUqUDpEGzae16qVh
 iaPPVwblZNUgK+S9ZehzoZkC0njKjnrtSJVlfS9DIZCTDtHWIWf8YrxpVZGTvwl/Xc
 hD8iYYNEMe6S15xQP0ajKPzIYAIzJDt1TzyiHeFK0WcPA3IQhzIre+CLEMDyw01I1a
 uhoBYfIBl3yLMbNYF7hPf3YEqbW8pbQiYgFLPFaaPcDMEMQcwp3l+J6n2tMnB2vIIS
 umoXXG6AFXWNgm6aZ0KNH2hqZSH5hgnpVlk94LhEO5yWwLz6XUQBOtjO0ExP5nuwK3
 Q5AU+6fsea3jw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4GFXXL5DLXz6tm5;
 Wed, 30 Jun 2021 22:10:42 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v2 3/3] gnu: Add python-lightgbm.
Date: Wed, 30 Jun 2021 20:09:19 +0000
Message-Id: <20210630200919.912223-3-monego@HIDDEN>
In-Reply-To: <20210630200919.912223-1-monego@HIDDEN>
References: <20210630200919.912223-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/machine-learning.scm (python-lightgbm): New variable.
---
Replace patch changes with code in 'preparations phase and added phase 'install-liblightgbm

 gnu/packages/machine-learning.scm | 59 +++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 04d1fa0c4d..79bf0bbbfd 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1109,6 +1109,65 @@ the following advantages:
 @end itemize\n")
     (license license:expat)))
 
+(define-public python-lightgbm
+  (package
+    (inherit lightgbm)
+    (name "python-lightgbm")
+    (source (package-source lightgbm))
+    (build-system python-build-system)
+    (arguments
+     `(#:configure-flags (list "--precompile")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'preparations
+           (lambda _
+             (setenv "HOME" "/tmp") ;to write a log file
+             ;; Move Python files to source root to silence some warnings.
+             (rename-file "python-package/setup.py" "setup.py")
+             (rename-file "python-package/README.rst" "README.rst")
+             (rename-file "python-package/lightgbm" "lightgbm")
+             ;; Install version file to read the library's version.
+             (with-output-to-file "lightgbm/VERSION.txt"
+               (lambda ()
+                 (display ,(package-version lightgbm))))
+             ;; Skip building the shared library.
+             (substitute* "setup.py"
+               (("'install_lib': CustomInstallLib,") ""))))
+         (add-after 'install 'install-liblightgbm
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (pylib (string-append out "/lib/python"
+                                          ,(version-major+minor
+                                            (package-version python))
+                                          "/site-packages"))
+                    (lgbdir (string-append pylib "/lightgbm"))
+                    (lib-lightgbm (string-append (assoc-ref inputs "lightgbm")
+                                                 "/lib/lib_lightgbm.so")))
+               ;; This symlink is necessary for tests.
+               (symlink lib-lightgbm "lightgbm/lib_lightgbm.so")
+               ;; And this one for runtime.
+               (mkdir-p (string-append lgbdir "/lib"))
+               (symlink lib-lightgbm (string-append lgbdir
+                                                    "/lib_lightgbm.so")))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest"
+                       "tests/python_package_test")))))))
+    (native-inputs
+     `(("python-psutil" ,python-psutil)
+       ("python-pytest" ,python-pytest)
+       ("python-wheel" ,python-wheel)))
+    (inputs
+     `(("lightgbm" ,lightgbm)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-pandas" ,python-pandas)
+       ("python-scipy" ,python-scipy)
+       ("python-scikit-learn" ,python-scikit-learn)))
+    (synopsis "Python frontend for LightGBM")))
+
 (define-public vowpal-wabbit
   ;; Language bindings not included.
   (package
-- 
2.32.0





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 30 Jun 2021 20:10:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 30 16:10:55 2021
Received: from localhost ([127.0.0.1]:58848 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lygXq-0003zT-Fm
	for submit <at> debbugs.gnu.org; Wed, 30 Jun 2021 16:10:55 -0400
Received: from mout02.posteo.de ([185.67.36.66]:34959)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1lygXn-0003z0-Ha
 for 48785 <at> debbugs.gnu.org; Wed, 30 Jun 2021 16:10:48 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 1FE5F2400FF
 for <48785 <at> debbugs.gnu.org>; Wed, 30 Jun 2021 22:10:40 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1625083841; bh=SlJ1JnrX4wopV3KE+YzkfuYXmv/YWbVZ48vnAbXes4c=;
 h=From:To:Cc:Subject:Date:From;
 b=Q3TWwbt2C8iYw/fHgRgsLO32xgtu/0Pah4bs6tf75Lg3oEBLuJyzYget9LrNsar78
 +MxE4CmK89hl+igIFaSsvndEU6c9cmgQhrurFr7J7kGofHGfE95Ge+W9mEJVT53yTm
 m85Qxgv7gTPePPvV6kOKbErTXcz6k9zgUZOgskDmqPnwdMCyTHvAk5Ou9rPTRe6jc+
 aQ/aM60DKYEwj2wOkPFhi27XxlJ006prJcG27tSwWUUeDTG0FNwnLH945AMNb62EWE
 V8NaGPE5nIlU5urZcz1w4Rsqg9nzQ8g21wPA9vHKTwa/G9Fpc4iqhmYWbryN2yfHhF
 Ie5denQmZk2FA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4GFXXH39bCz6tm5;
 Wed, 30 Jun 2021 22:10:38 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v2 1/3] gnu: Add fast-double-parser.
Date: Wed, 30 Jun 2021 20:09:17 +0000
Message-Id: <20210630200919.912223-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/cpp.scm (fast-double-parser): New variable.
---
 gnu/packages/cpp.scm | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 54f9da4b27..3ca184b4b0 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Roel Janssen <roel@HIDDEN>
 ;;; Copyright © 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2020 Brice Waegeneire <brice@HIDDEN>
-;;; Copyright © 2020 Vinicius Monego <monego@HIDDEN>
+;;; Copyright © 2020, 2021 Vinicius Monego <monego@HIDDEN>
 ;;; Copyright © 2020 Marius Bakke <marius@HIDDEN>
 ;;; Copyright © 2020 Michael Rohleder <mike@HIDDEN>
 ;;; Copyright © 2020 Alexandros Theodotou <alex@HIDDEN>
@@ -330,6 +330,42 @@ functions, class methods, and stl containers.
 @end enumerate\n")
     (license license:bsd-3)))
 
+(define-public fast-double-parser
+  (package
+    (name "fast-double-parser")
+    (version "0.5.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/lemire/fast_double_parser")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "10mfpy4i7lpavghb15s4d0920nlwsac1ri2sxkcqbrj9iq94qj71"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'install ;no install target, have to do it manually
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out-include (string-append (assoc-ref outputs "out")
+                                               "/include")))
+               (mkdir-p out-include)
+               (copy-file "../source/include/fast_double_parser.h"
+                          (string-append out-include
+                                         "/fast_double_parser.h"))))))))
+    (home-page "https://github.com/lemire/fast_double_parser")
+    (synopsis "Parse strings into double (binary64) floating-point values")
+    (description "Fast function to parse strings containing decimal numbers
+into double-precision (binary64) floating-point values.  That is, given the
+string \"1.0e10\", it should return a 64-bit floating-point value equal to
+10000000000.  The function will match exactly (down the smallest bit) the
+result of a standard function like @code{strtod}.")
+    ;; Dual-licensed, either license applies.
+    (license (list license:asl2.0
+                   license:boost1.0))))
+
 (define-public fifo-map
   (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
          (revision "0")
-- 
2.32.0





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 30 Jun 2021 20:10:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 30 16:10:50 2021
Received: from localhost ([127.0.0.1]:58845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lygXp-0003zR-VO
	for submit <at> debbugs.gnu.org; Wed, 30 Jun 2021 16:10:50 -0400
Received: from mout02.posteo.de ([185.67.36.66]:55591)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1lygXo-0003z6-5d
 for 48785 <at> debbugs.gnu.org; Wed, 30 Jun 2021 16:10:48 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 83C5D240100
 for <48785 <at> debbugs.gnu.org>; Wed, 30 Jun 2021 22:10:42 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1625083842; bh=vUq34YNoD4lmGRUeSWi6/2cVs4wCOx898hXfYjvPpPk=;
 h=From:To:Cc:Subject:Date:From;
 b=Lz1CaCtkMi41Jai+dY+P3WDXCUrXaXH3f/q3E5XZ+plNKCIL97uBrjdo0b1ZNgV+T
 1S0nquk9SvDQKNE5Z7aszOe4wJiF/TQnVpadZU/O3VjwO5XubNSNRmuo2gqsQvuvmj
 sk0Rt1IXSNcUkmyEPXkDNEzJvJC4un4PiLf0J/tUJaqxiKpgz78BfXl/Ew96aCiyrr
 toJpgxTm2zh24S5TMh2elzwNRee6GR8cYqT7kwtEzTTyfwOxmwO8SeUCxIlktEMBmq
 Wp2Sz9rOA3qFwsuLRwEvKGWRVH0vt/coFg8emOGyudQ7XPYZEvQztUEclp3H3PuQNa
 vkxku4J210R+w==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4GFXXK0W4gz6tm5;
 Wed, 30 Jun 2021 22:10:40 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH v2 2/3] gnu: lightgbm: Update to 3.2.1.
Date: Wed, 30 Jun 2021 20:09:18 +0000
Message-Id: <20210630200919.912223-2-monego@HIDDEN>
In-Reply-To: <20210630200919.912223-1-monego@HIDDEN>
References: <20210630200919.912223-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/machine-learning.scm (lightgbm): Update to 3.2.1.
[source]: Add patch. Make cosmetic changes.
[native-inputs]: Add googletest, opencl-headers.
[inputs]: Add boost, eigen, fast-double-parser, fmt, ocl-icd.
[propagated-inputs]: Remove.
[arguments]: Add #:tests?, #:test-target. Pass "-DBUILD_CPP_TEST=OFF" and
"-DUSE_GPU=ON" to #:configure-flags. Do not replace check phase.
* gnu/packages/patches/lightgbm-use-system-libraries.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
Removed the python patch.

 gnu/local.mk                                  |  1 +
 gnu/packages/machine-learning.scm             | 56 ++++++++++--------
 .../lightgbm-use-system-libraries.patch       | 58 +++++++++++++++++++
 3 files changed, 91 insertions(+), 24 deletions(-)
 create mode 100644 gnu/packages/patches/lightgbm-use-system-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 19db9787dc..fa30cc7e9b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1386,6 +1386,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lierolibre-newer-libconfig.patch		\
   %D%/packages/patches/lierolibre-remove-arch-warning.patch	\
   %D%/packages/patches/lierolibre-try-building-other-arch.patch	\
+  %D%/packages/patches/lightgbm-use-system-libraries.patch	\
   %D%/packages/patches/linbox-fix-pkgconfig.patch		\
   %D%/packages/patches/linphone-desktop-without-sdk.patch           \
   %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index b8d79821e0..04d1fa0c4d 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -56,6 +56,7 @@
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cmake)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages cran)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dejagnu)
@@ -70,8 +71,10 @@
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages ocaml)
   #:use-module (gnu packages onc-rpc)
+  #:use-module (gnu packages opencl)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
@@ -1058,33 +1061,38 @@ main intended application of Autograd is gradient-based optimization.")
 (define-public lightgbm
   (package
     (name "lightgbm")
-    (version "2.0.12")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                     (url "https://github.com/Microsoft/LightGBM")
-                     (commit (string-append "v" version))))
-              (sha256
-               (base32
-                "0jlvyn7k81dzrh9ij3zw576wbgiwmmr26rzpdxjn1dbpc3njpvzi"))
-              (file-name (git-file-name name version))))
+    (version "3.2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Microsoft/LightGBM")
+             (commit (string-append "v" version))))
+       (patches
+        (search-patches "lightgbm-use-system-libraries.patch"))
+       (sha256
+        (base32 "1fchiiwl3pz1kpi0kbfanif6c6b688wmmjjbqz4ff4djc6g2sg7z"))
+       (file-name (git-file-name name version))))
     (native-inputs
-     `(("python-pytest" ,python-pytest)
-       ("python-nose" ,python-nose)))
+     `(("googletest" ,googletest)
+       ("opencl-headers" ,opencl-headers)))
     (inputs
-     `(("openmpi" ,openmpi)))
-    (propagated-inputs
-     `(("python-numpy" ,python-numpy)
-       ("python-scipy" ,python-scipy)))
+     `(("boost" ,boost)
+       ("eigen" ,eigen)
+       ("fast-double-parser" ,fast-double-parser)
+       ("fmt" ,fmt)
+       ("ocl-icd" ,ocl-icd)
+       ("openmpi" ,openmpi)))
     (arguments
-     `(#:configure-flags
-       '("-DUSE_MPI=ON")
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             (with-directory-excursion "../source"
-               (invoke "pytest" "tests/c_api_test/test_.py")))))))
+     `(;; FIXME: With 'find_package(GTest CONFIG)' (default), googletest
+       ;; is not found by CMake.  If we replace CONFIG with REQUIRED, the
+       ;; test files fail to link with googletest in the build phase.
+       #:tests? #f
+       #:test-target "testlightgbm"
+       #:configure-flags
+       (list "-DBUILD_CPP_TEST=OFF"
+             "-DUSE_GPU=ON" ;using OpenCL
+             "-DUSE_MPI=ON")))
     (build-system cmake-build-system)
     (home-page "https://github.com/Microsoft/LightGBM")
     (synopsis "Gradient boosting framework based on decision tree algorithms")
diff --git a/gnu/packages/patches/lightgbm-use-system-libraries.patch b/gnu/packages/patches/lightgbm-use-system-libraries.patch
new file mode 100644
index 0000000000..115ca02775
--- /dev/null
+++ b/gnu/packages/patches/lightgbm-use-system-libraries.patch
@@ -0,0 +1,58 @@
+From 894648291b9629d51785e4fd1cae820d2858e039 Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@HIDDEN>
+Date: Mon, 31 May 2021 21:23:52 -0300
+Subject: [PATCH] Use system libraries.
+
+---
+ CMakeLists.txt                  | 11 ++++++++---
+ include/LightGBM/utils/common.h |  4 ++--
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b845f36..560e477 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -93,9 +93,6 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
+-SET(EIGEN_DIR "${PROJECT_SOURCE_DIR}/external_libs/eigen")
+-include_directories(${EIGEN_DIR})
+-
+ # See https://gitlab.com/libeigen/eigen/-/blob/master/COPYING.README
+ ADD_DEFINITIONS(-DEIGEN_MPL2_ONLY)
+ 
+@@ -399,6 +396,14 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
++find_package (Eigen3 3.3 REQUIRED NO_MODULE)
++TARGET_LINK_LIBRARIES (lightgbm Eigen3::Eigen)
++TARGET_LINK_LIBRARIES (_lightgbm Eigen3::Eigen)
++
++find_package(fmt)
++TARGET_LINK_LIBRARIES(lightgbm fmt::fmt)
++TARGET_LINK_LIBRARIES(_lightgbm fmt::fmt)
++
+ if(USE_MPI)
+   TARGET_LINK_LIBRARIES(lightgbm ${MPI_CXX_LIBRARIES})
+   TARGET_LINK_LIBRARIES(_lightgbm ${MPI_CXX_LIBRARIES})
+diff --git a/include/LightGBM/utils/common.h b/include/LightGBM/utils/common.h
+index 4357357..00101a5 100644
+--- a/include/LightGBM/utils/common.h
++++ b/include/LightGBM/utils/common.h
+@@ -32,9 +32,9 @@
+ 
+ #if (!((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))))
+ #define FMT_HEADER_ONLY
+-#include "../../../external_libs/fmt/include/fmt/format.h"
++#include "fmt/format.h"
+ #endif
+-#include "../../../external_libs/fast_double_parser/include/fast_double_parser.h"
++#include "fast_double_parser.h"
+ 
+ #ifdef _MSC_VER
+ #include <intrin.h>
+-- 
+2.31.1
+
-- 
2.32.0





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 1 Jun 2021 22:07:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 01 18:07:23 2021
Received: from localhost ([127.0.0.1]:38124 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1loCXi-0003QB-Vx
	for submit <at> debbugs.gnu.org; Tue, 01 Jun 2021 18:07:23 -0400
Received: from mout01.posteo.de ([185.67.36.65]:38003)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1loCXh-0003Pp-6m
 for 48785 <at> debbugs.gnu.org; Tue, 01 Jun 2021 18:07:21 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id B349A240027
 for <48785 <at> debbugs.gnu.org>; Wed,  2 Jun 2021 00:07:15 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1622585235; bh=fWDkpn3y+GvpLB3TvwB7ap+RXVf/PA9pUY2CkAYgBN4=;
 h=From:To:Cc:Subject:Date:From;
 b=k5HQ2+JWPpou8ahmjs3IIlQcppYKt943O1B79VrvDNF3gM/88K/ngq7X6iCUtLQWG
 v5DYLnCj4QyLFOpf8QU9qI1bG2Hsvkb5Swo2g8tnlCYZAPg1hKvztATHb0F1wRfB8F
 3/lapK/jYCddf+HSWu1lLYa/6jEytkPzKtcArNSWyImT32idIC5FhwVX+2BIhcPWvI
 kynpFa7FIn7e2/nknRejfPLkGwNf6tdHhDWlTqsPOjRFSH/hcDhGVBuJpqtsHR1I+c
 aQHtLs70W0sCkz57kSqDPb6DucGOfHppJo7P03y77zYK6bQX5Jlf0Cj4TzHTtQHqvW
 EP1INidwfquFA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4FvmVB3V35z6tmQ;
 Wed,  2 Jun 2021 00:07:14 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH 3/3] gnu: Add python-lightgbm.
Date: Tue,  1 Jun 2021 22:06:43 +0000
Message-Id: <20210601220643.78439-3-monego@HIDDEN>
In-Reply-To: <20210601220643.78439-1-monego@HIDDEN>
References: <20210601220643.78439-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

* gnu/packages/machine-learning.scm (python-lightgbm): New variable.
---
 gnu/packages/machine-learning.scm | 43 +++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 1a3f647dde..900ca15b28 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1110,6 +1110,49 @@ the following advantages:
 @end itemize\n")
     (license license:expat)))
 
+(define-public python-lightgbm
+  (package
+    (inherit lightgbm)
+    (name "python-lightgbm")
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'preparations
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "HOME" "/tmp") ;to write a log file
+             ;; Move Python files to source root to silence some warnings.
+             (rename-file "python-package/setup.py" "setup.py")
+             (rename-file "python-package/README.rst" "README.rst")
+             (rename-file "python-package/lightgbm" "lightgbm")
+             (substitute* "setup.py"
+               (("version = ''")
+                (string-append "version = " "'"
+                               ,(package-version lightgbm) "'")))
+             (substitute* "lightgbm/libpath.py"
+               (("lib_lightgbm_path = ''")
+                (string-append "lib_lightgbm_path = " "'"
+                               (assoc-ref inputs "lightgbm")
+                               "/lib" "'")))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest"
+                       "tests/python_package_test")))))))
+    (native-inputs
+     `(("python-psutil" ,python-psutil)
+       ("python-pytest" ,python-pytest)
+       ("python-wheel" ,python-wheel)))
+    (inputs
+     `(("lightgbm" ,lightgbm)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-pandas" ,python-pandas)
+       ("python-scipy" ,python-scipy)
+       ("python-scikit-learn" ,python-scikit-learn)))
+    (synopsis "Python frontend for LightGBM")))
+
 (define-public vowpal-wabbit
   ;; Language bindings not included.
   (package
-- 
2.31.1





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 1 Jun 2021 22:07:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 01 18:07:21 2021
Received: from localhost ([127.0.0.1]:38121 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1loCXc-0003Pr-HL
	for submit <at> debbugs.gnu.org; Tue, 01 Jun 2021 18:07:21 -0400
Received: from mout01.posteo.de ([185.67.36.65]:34521)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1loCXZ-0003PV-Ug
 for 48785 <at> debbugs.gnu.org; Tue, 01 Jun 2021 18:07:14 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 0284B240026
 for <48785 <at> debbugs.gnu.org>; Wed,  2 Jun 2021 00:07:07 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1622585228; bh=kfPVRjbE42c/fOVdk4jSsXTh9dqDP8JE9rid5U8OSCQ=;
 h=From:To:Cc:Subject:Date:From;
 b=ULJpe+H2rwmD+rPAY/MjUskX6dzkeyZUJlgbWinnA6rUv9kydppZTVw4rs0anXzCR
 +J/pS8XgpVPb9aXkgR1PlUMiaIy1dRks2y0N0NJXPbZxdWqBixxxtk4VNnJuZAdNOY
 RcRZ2RndFhGAjwUG0S2Q1RdLWt1TXIQqeB7JKm3zqC27NlCYByDo1CmWnGHNnX8aTw
 HBoU+CRH+SAS0ygi3kzdabkn29X4YnoSkcLm+IStVgtnVDcuGir3604Hsx51wA90Eu
 4iEs83auUAQmpU8bABoQaBl6mgsIb7dIiGZXR+u4rMTPvi1+2VKye9LRQCi5R+43pK
 7FS0E2cN5wcUw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4FvmV24C1Sz6tmQ;
 Wed,  2 Jun 2021 00:07:06 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH 2/3] gnu: lightgbm: Update to 3.2.1.
Date: Tue,  1 Jun 2021 22:06:42 +0000
Message-Id: <20210601220643.78439-2-monego@HIDDEN>
In-Reply-To: <20210601220643.78439-1-monego@HIDDEN>
References: <20210601220643.78439-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/machine-learning.scm (lightgbm): Update to 3.2.1.
[source]: Add patches.
[native-inputs]: Add googletest, opencl-headers.
[inputs]: Add boost, eigen, fast-double-parser, fmt, ocl-icd.
[propagated-inputs]: Remove.
[arguments]: Add #:tests?, #:test-target. Pass "-DBUILD_CPP_TEST=OFF" and
"-DUSE_GPU=ON" to #:configure-flags. Do not replace check phase.
* gnu/packages/patches/lightgbm-use-system-libraries.patch,
gnu/packages/patches/lightgbm-python-use-system-lib-lightgbm.patch: New files.
* gnu/local.mk (dist_PATCH_DATA): Add them.
---
 gnu/local.mk                                  |  2 +
 gnu/packages/machine-learning.scm             | 57 ++++++++------
 ...htgbm-python-use-system-lib-lightgbm.patch | 74 +++++++++++++++++++
 .../lightgbm-use-system-libraries.patch       | 58 +++++++++++++++
 4 files changed, 167 insertions(+), 24 deletions(-)
 create mode 100644 gnu/packages/patches/lightgbm-python-use-system-lib-lightgbm.patch
 create mode 100644 gnu/packages/patches/lightgbm-use-system-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 6a1e459e4e..0016ac12af 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1375,6 +1375,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/lierolibre-newer-libconfig.patch		\
   %D%/packages/patches/lierolibre-remove-arch-warning.patch	\
   %D%/packages/patches/lierolibre-try-building-other-arch.patch	\
+  %D%/packages/patches/lightgbm-python-use-system-lib-lightgbm.patch \
+  %D%/packages/patches/lightgbm-use-system-libraries.patch	\
   %D%/packages/patches/linbox-fix-pkgconfig.patch		\
   %D%/packages/patches/linkchecker-tests-require-network.patch	\
   %D%/packages/patches/linphone-desktop-without-sdk.patch           \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index ead47a534a..1a3f647dde 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -56,6 +56,7 @@
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cmake)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages cran)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dejagnu)
@@ -70,8 +71,10 @@
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages ocaml)
   #:use-module (gnu packages onc-rpc)
+  #:use-module (gnu packages opencl)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
@@ -1058,33 +1061,39 @@ main intended application of Autograd is gradient-based optimization.")
 (define-public lightgbm
   (package
     (name "lightgbm")
-    (version "2.0.12")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                     (url "https://github.com/Microsoft/LightGBM")
-                     (commit (string-append "v" version))))
-              (sha256
-               (base32
-                "0jlvyn7k81dzrh9ij3zw576wbgiwmmr26rzpdxjn1dbpc3njpvzi"))
-              (file-name (git-file-name name version))))
+    (version "3.2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Microsoft/LightGBM")
+             (commit (string-append "v" version))))
+       (patches
+        (search-patches "lightgbm-use-system-libraries.patch"
+                        "lightgbm-python-use-system-lib-lightgbm.patch"))
+       (sha256
+        (base32 "1fchiiwl3pz1kpi0kbfanif6c6b688wmmjjbqz4ff4djc6g2sg7z"))
+       (file-name (git-file-name name version))))
     (native-inputs
-     `(("python-pytest" ,python-pytest)
-       ("python-nose" ,python-nose)))
+     `(("googletest" ,googletest)
+       ("opencl-headers" ,opencl-headers)))
     (inputs
-     `(("openmpi" ,openmpi)))
-    (propagated-inputs
-     `(("python-numpy" ,python-numpy)
-       ("python-scipy" ,python-scipy)))
+     `(("boost" ,boost)
+       ("eigen" ,eigen)
+       ("fast-double-parser" ,fast-double-parser)
+       ("fmt" ,fmt)
+       ("ocl-icd" ,ocl-icd)
+       ("openmpi" ,openmpi)))
     (arguments
-     `(#:configure-flags
-       '("-DUSE_MPI=ON")
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             (with-directory-excursion "../source"
-               (invoke "pytest" "tests/c_api_test/test_.py")))))))
+     `(;; FIXME: With 'find_package(GTest CONFIG)' (default), googletest
+       ;; is not found by CMake.  If we replace CONFIG with REQUIRED, the
+       ;; test files fail to link with googletest in the build phase.
+       #:tests? #f
+       #:test-target "testlightgbm"
+       #:configure-flags
+       (list "-DBUILD_CPP_TEST=OFF"
+             "-DUSE_GPU=ON" ;using OpenCL
+             "-DUSE_MPI=ON")))
     (build-system cmake-build-system)
     (home-page "https://github.com/Microsoft/LightGBM")
     (synopsis "Gradient boosting framework based on decision tree algorithms")
diff --git a/gnu/packages/patches/lightgbm-python-use-system-lib-lightgbm.patch b/gnu/packages/patches/lightgbm-python-use-system-lib-lightgbm.patch
new file mode 100644
index 0000000000..69cb721daa
--- /dev/null
+++ b/gnu/packages/patches/lightgbm-python-use-system-lib-lightgbm.patch
@@ -0,0 +1,74 @@
+From c73be84d8ec6ac71dfdaa71b7943ae344f5d7cde Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@HIDDEN>
+Date: Tue, 1 Jun 2021 00:24:38 -0300
+Subject: [PATCH] Use system lib_lightgbm.
+
+---
+ python-package/lightgbm/libpath.py |  4 ++++
+ python-package/setup.py            | 12 ++++++++----
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/python-package/lightgbm/libpath.py b/python-package/lightgbm/libpath.py
+index 6533792..27af2b9 100644
+--- a/python-package/lightgbm/libpath.py
++++ b/python-package/lightgbm/libpath.py
+@@ -17,8 +17,12 @@ def find_lib_path() -> List[str]:
+         # we don't need lib_lightgbm while building docs
+         return []
+ 
++    # This variable will be set during substitution.
++    lib_lightgbm_path = ''
++
+     curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
+     dll_path = [curr_path,
++                lib_lightgbm_path,
+                 os.path.join(curr_path, '../../'),
+                 os.path.join(curr_path, 'compile'),
+                 os.path.join(curr_path, '../compile'),
+diff --git a/python-package/setup.py b/python-package/setup.py
+index ee98b1a..2f7ce38 100644
+--- a/python-package/setup.py
++++ b/python-package/setup.py
+@@ -231,7 +231,7 @@ class CustomInstall(install):
+         self.opencl_library = None
+         self.mpi = 0
+         self.hdfs = 0
+-        self.precompile = 0
++        self.precompile = 1
+         self.nomp = 0
+         self.bit32 = 0
+ 
+@@ -274,7 +274,7 @@ class CustomBdistWheel(bdist_wheel):
+         self.opencl_library = None
+         self.mpi = 0
+         self.hdfs = 0
+-        self.precompile = 0
++        self.precompile = 1
+         self.nomp = 0
+         self.bit32 = 0
+ 
+@@ -324,7 +324,10 @@ if __name__ == "__main__":
+         copy_file(os.path.join(CURRENT_DIR, os.path.pardir, 'VERSION.txt'),
+                   os.path.join(CURRENT_DIR, 'lightgbm', 'VERSION.txt'),
+                   verbose=0)  # type:ignore
+-    version = open(os.path.join(CURRENT_DIR, 'lightgbm', 'VERSION.txt'), encoding='utf-8').read().strip()
++
++    # This variable will be set during substitution.
++    version = ''
++
+     readme = open(os.path.join(CURRENT_DIR, 'README.rst'), encoding='utf-8').read()
+ 
+     sys.path.insert(0, CURRENT_DIR)
+@@ -355,7 +358,8 @@ if __name__ == "__main__":
+           zip_safe=False,
+           cmdclass={
+               'install': CustomInstall,
+-              'install_lib': CustomInstallLib,
++              # Lib will be loaded from the lightgbm package.
++              # 'install_lib': CustomInstallLib,
+               'bdist_wheel': CustomBdistWheel,
+               'sdist': CustomSdist,
+           },
+-- 
+2.31.1
+
diff --git a/gnu/packages/patches/lightgbm-use-system-libraries.patch b/gnu/packages/patches/lightgbm-use-system-libraries.patch
new file mode 100644
index 0000000000..115ca02775
--- /dev/null
+++ b/gnu/packages/patches/lightgbm-use-system-libraries.patch
@@ -0,0 +1,58 @@
+From 894648291b9629d51785e4fd1cae820d2858e039 Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@HIDDEN>
+Date: Mon, 31 May 2021 21:23:52 -0300
+Subject: [PATCH] Use system libraries.
+
+---
+ CMakeLists.txt                  | 11 ++++++++---
+ include/LightGBM/utils/common.h |  4 ++--
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b845f36..560e477 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -93,9 +93,6 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
+-SET(EIGEN_DIR "${PROJECT_SOURCE_DIR}/external_libs/eigen")
+-include_directories(${EIGEN_DIR})
+-
+ # See https://gitlab.com/libeigen/eigen/-/blob/master/COPYING.README
+ ADD_DEFINITIONS(-DEIGEN_MPL2_ONLY)
+ 
+@@ -399,6 +396,14 @@ if(USE_SWIG)
+   endif()
+ endif(USE_SWIG)
+ 
++find_package (Eigen3 3.3 REQUIRED NO_MODULE)
++TARGET_LINK_LIBRARIES (lightgbm Eigen3::Eigen)
++TARGET_LINK_LIBRARIES (_lightgbm Eigen3::Eigen)
++
++find_package(fmt)
++TARGET_LINK_LIBRARIES(lightgbm fmt::fmt)
++TARGET_LINK_LIBRARIES(_lightgbm fmt::fmt)
++
+ if(USE_MPI)
+   TARGET_LINK_LIBRARIES(lightgbm ${MPI_CXX_LIBRARIES})
+   TARGET_LINK_LIBRARIES(_lightgbm ${MPI_CXX_LIBRARIES})
+diff --git a/include/LightGBM/utils/common.h b/include/LightGBM/utils/common.h
+index 4357357..00101a5 100644
+--- a/include/LightGBM/utils/common.h
++++ b/include/LightGBM/utils/common.h
+@@ -32,9 +32,9 @@
+ 
+ #if (!((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))))
+ #define FMT_HEADER_ONLY
+-#include "../../../external_libs/fmt/include/fmt/format.h"
++#include "fmt/format.h"
+ #endif
+-#include "../../../external_libs/fast_double_parser/include/fast_double_parser.h"
++#include "fast_double_parser.h"
+ 
+ #ifdef _MSC_VER
+ #include <intrin.h>
+-- 
+2.31.1
+
-- 
2.31.1





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at 48785 <at> debbugs.gnu.org:


Received: (at 48785) by debbugs.gnu.org; 1 Jun 2021 22:07:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 01 18:07:12 2021
Received: from localhost ([127.0.0.1]:38118 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1loCXT-0003PU-Nh
	for submit <at> debbugs.gnu.org; Tue, 01 Jun 2021 18:07:12 -0400
Received: from mout02.posteo.de ([185.67.36.66]:44985)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1loCXS-0003P4-OB
 for 48785 <at> debbugs.gnu.org; Tue, 01 Jun 2021 18:07:07 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 1ECE92400E5
 for <48785 <at> debbugs.gnu.org>; Wed,  2 Jun 2021 00:07:00 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1622585221; bh=GZJoXYgWQzOR2ACo0yZFf6jCPmUGeUfa8wWcYLF3qn0=;
 h=From:To:Cc:Subject:Date:From;
 b=JFCSYawKAGWlJp0llZ5XBWUNzj0cMPzHepFKYx08/KWo+aVNF8AgfVM0AbzJG4/y9
 Ue1SNQ6WWB0Wp2ExMMydou0Hlnr97fTony7RhgiphnSegctiHM8f+xmfSakpSlDyYS
 xLL6tU5myryJ6+pmUcY3WLz7kboGsofmG3skqQPvvTzPj09a3gd5Stu4W7S82g5wnS
 NEmh8RMepvXE0CkSmjxSQ9fxhMLiujqnOh0lo6nOPYZmhpIU/MdoUIs+2UCJZJpSJE
 HgAVNR1rKULZwCUXXptgAeel68PpgZHVVqZ/qPQudlpP4YbdMVvMuvN1wfeSuHeTq/
 RDjAHgPyI3qoQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4FvmTv4gtCz6tmT;
 Wed,  2 Jun 2021 00:06:59 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: 48785 <at> debbugs.gnu.org
Subject: [PATCH 1/3] gnu: Add fast-double-parser.
Date: Tue,  1 Jun 2021 22:06:41 +0000
Message-Id: <20210601220643.78439-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 48785
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/cpp.scm (fast-double-parser): New variable.
---
 gnu/packages/cpp.scm | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 3089094eb8..1cddf7209b 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Roel Janssen <roel@HIDDEN>
 ;;; Copyright © 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2020 Brice Waegeneire <brice@HIDDEN>
-;;; Copyright © 2020 Vinicius Monego <monego@HIDDEN>
+;;; Copyright © 2020, 2021 Vinicius Monego <monego@HIDDEN>
 ;;; Copyright © 2020 Marius Bakke <marius@HIDDEN>
 ;;; Copyright © 2020 Michael Rohleder <mike@HIDDEN>
 ;;; Copyright © 2020 Alexandros Theodotou <alex@HIDDEN>
@@ -330,6 +330,42 @@ functions, class methods, and stl containers.
 @end enumerate\n")
     (license license:bsd-3)))
 
+(define-public fast-double-parser
+  (package
+    (name "fast-double-parser")
+    (version "0.5.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/lemire/fast_double_parser")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "10mfpy4i7lpavghb15s4d0920nlwsac1ri2sxkcqbrj9iq94qj71"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'install ;no install target, have to do it manually
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out-include (string-append (assoc-ref outputs "out")
+                                               "/include")))
+               (mkdir-p out-include)
+               (copy-file "../source/include/fast_double_parser.h"
+                          (string-append out-include
+                                         "/fast_double_parser.h"))))))))
+    (home-page "https://github.com/lemire/fast_double_parser")
+    (synopsis "Parse strings into double (binary64) floating-point values")
+    (description "Fast function to parse strings containing decimal numbers
+into double-precision (binary64) floating-point values.  That is, given the
+string \"1.0e10\", it should return a 64-bit floating-point value equal to
+10000000000.  The function will match exactly (down the smallest bit) the
+result of a standard function like @code{strtod}.")
+    ;; Dual-licensed, either license applies.
+    (license (list license:asl2.0
+                   license:boost1.0))))
+
 (define-public fifo-map
   (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9")
          (revision "0")
-- 
2.31.1





Information forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Jun 2021 22:05:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 01 18:05:38 2021
Received: from localhost ([127.0.0.1]:38112 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1loCW2-0003Mi-DT
	for submit <at> debbugs.gnu.org; Tue, 01 Jun 2021 18:05:38 -0400
Received: from lists.gnu.org ([209.51.188.17]:52732)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monego@HIDDEN>) id 1loCW1-0003Mb-9R
 for submit <at> debbugs.gnu.org; Tue, 01 Jun 2021 18:05:37 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:37662)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monego@HIDDEN>) id 1loCW0-0000Wn-0q
 for guix-patches@HIDDEN; Tue, 01 Jun 2021 18:05:36 -0400
Received: from mout02.posteo.de ([185.67.36.66]:58489)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monego@HIDDEN>) id 1loCVv-0007ff-PV
 for guix-patches@HIDDEN; Tue, 01 Jun 2021 18:05:33 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 9C8852400E5
 for <guix-patches@HIDDEN>; Wed,  2 Jun 2021 00:05:28 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1622585128; bh=crmfprhXSuD6DJTKEJf09AOSavKOhsFOJTUQfwyhpd8=;
 h=From:To:Cc:Subject:Date:From;
 b=cjsOUYaPYAu4nH1b5uPWjRM2IwBA/lsH9DM2+8c5fVoxKCTdghz+NZPq3UW32Xrc4
 awN5GBjaUVSu1s3iDyrUhnWg19fu7LShEVKNKE90ZqvKvm4rEIthvmOH3aGUvoc+SQ
 d61siI1biIvA+0EpgGEePUzX2mFhOgj/Q5h+1vThLomgEz+TUzZCpYSdIuEZpfItMY
 7t1or1Gxm6PlUf/aWqbRJDRksECCukAn/K3Kf845e2AlYEU7tiqpOMrY/dnA9g7YiQ
 hFNplCt7DVIgFnIUA0hb/U1GEwqcFT+xb13gXNMPkDrxE6c7D83Yyq7xs7v0hy6Eml
 HZG8ttQCmZa3g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4FvmS720szz6tmF;
 Wed,  2 Jun 2021 00:05:26 +0200 (CEST)
From: Vinicius Monego <monego@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/3] Update LightGBM and split frontends.
Date: Tue,  1 Jun 2021 22:05:10 +0000
Message-Id: <20210601220510.78230-1-monego@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=185.67.36.66; envelope-from=monego@HIDDEN;
 helo=mout02.posteo.de
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Vinicius Monego <monego@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Same considerations from https://issues.guix.gnu.org/48388

Vinicius Monego (3):
  gnu: Add fast-double-parser.
  gnu: lightgbm: Update to 3.2.1.
  gnu: Add python-lightgbm.

 gnu/local.mk                                  |   2 +
 gnu/packages/cpp.scm                          |  38 ++++++-
 gnu/packages/machine-learning.scm             | 100 +++++++++++++-----
 ...htgbm-python-use-system-lib-lightgbm.patch |  74 +++++++++++++
 .../lightgbm-use-system-libraries.patch       |  58 ++++++++++
 5 files changed, 247 insertions(+), 25 deletions(-)
 create mode 100644 gnu/packages/patches/lightgbm-python-use-system-lib-lightgbm.patch
 create mode 100644 gnu/packages/patches/lightgbm-use-system-libraries.patch

-- 
2.31.1





Acknowledgement sent to Vinicius Monego <monego@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#48785; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 7 Apr 2023 15:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.