From patchwork Mon Jun 26 01:06:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 51347 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7A64C27BBE2; Mon, 26 Jun 2023 02:08:27 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0F39027BBEB for ; Mon, 26 Jun 2023 02:08:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDai4-0007l1-Kh; Sun, 25 Jun 2023 21:08:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDai2-0007kV-Af for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDai1-0004cp-W0 for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qDai1-0004f4-Rh for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48785] [PATCH v6 1/3] gnu: Add fast-double-parser. References: <20210601220510.78230-1-monego@posteo.net> In-Reply-To: <20210601220510.78230-1-monego@posteo.net> Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Jun 2023 01:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48785 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48785@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48785-submit@debbugs.gnu.org id=B48785.168774164517843 (code B ref 48785); Mon, 26 Jun 2023 01:08:01 +0000 Received: (at 48785) by debbugs.gnu.org; 26 Jun 2023 01:07:25 +0000 Received: from localhost ([127.0.0.1]:44019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDahR-0004dg-2w for submit@debbugs.gnu.org; Sun, 25 Jun 2023 21:07:25 -0400 Received: from mout01.posteo.de ([185.67.36.65]:40625) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDahM-0004dN-8p for 48785@debbugs.gnu.org; Sun, 25 Jun 2023 21:07:23 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AE7B9240027 for <48785@debbugs.gnu.org>; Mon, 26 Jun 2023 03:07:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1687741633; bh=QYt00Z0Qnk7HSTC9sxFsyJfzjtsS41kVU3fJ2gYgopk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=cpfztuCml9294kZglMGwyCe5RL2ObavZ/pMsw+zYcKGWE/Ya7Ht3otWzdeCLO4je8 S4PNXVBfxuyyZQv8PIePDjc80jwjZYq9juHIQaSWR68s6cd10YAYQmwq8sGUOM6R+t 92m6UeQN8xTTfGm877tqsBvsLICni89bnFe/H4WlHFD1GwfytQdmP8/Qmp1RifX1Zo gbWd0jGOq6pmpSMD0x5fdgBFGUhJlZ9Ng4KIDoYEmjGKUoZGxlispZAAbY08f3z/od VQzu90m02XA6nPBYmTnw/zzkpIQ1tldeeVVHrt4gOSJGwCyJM59ley7O4bacDlQ4rl sTOayB3XyNjHw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Qq8nr28TNz6txP; Mon, 26 Jun 2023 03:07:11 +0200 (CEST) From: Vinicius Monego Date: Mon, 26 Jun 2023 01:06:33 +0000 Message-Id: <20230626010635.129221-1-monego@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/cpp.scm (fast-double-parser): New variable. --- gnu/packages/cpp.scm | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) base-commit: 41e8726c8924e9f5b79a9f44fad94ab5586bfc50 diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 39a34c20dd..65e040700c 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -10,7 +10,7 @@ ;;; Copyright © 2020 Roel Janssen ;;; Copyright © 2020, 2021, 2023 Ricardo Wurmus ;;; Copyright © 2020 Brice Waegeneire -;;; Copyright © 2020, 2021, 2022 Vinicius Monego +;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego ;;; Copyright © 2020, 2022 Marius Bakke ;;; Copyright © 2020 Michael Rohleder ;;; Copyright © 2020 Alexandros Theodotou @@ -448,6 +448,40 @@ (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.") + ;; Dual-licensed, either license applies. + (license (list license:asl2.0 license:boost1.0)))) + (define-public google-highway (package (name "google-highway") From patchwork Mon Jun 26 01:06:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 51346 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9739E27BBEC; Mon, 26 Jun 2023 02:08:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1CFC827BBE2 for ; Mon, 26 Jun 2023 02:08:24 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDai4-0007l0-Hq; Sun, 25 Jun 2023 21:08:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDai2-0007kb-NE for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDai2-0004dK-EC for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qDai2-0004fC-AI for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48785] [PATCH v6 2/3] gnu: lightgbm: Update to 3.3.5. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Jun 2023 01:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48785 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48785@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48785-submit@debbugs.gnu.org id=B48785.168774165817874 (code B ref 48785); Mon, 26 Jun 2023 01:08:02 +0000 Received: (at 48785) by debbugs.gnu.org; 26 Jun 2023 01:07:38 +0000 Received: from localhost ([127.0.0.1]:44023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDahd-0004eD-Hm for submit@debbugs.gnu.org; Sun, 25 Jun 2023 21:07:38 -0400 Received: from mout01.posteo.de ([185.67.36.65]:40389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDahb-0004du-Fv for 48785@debbugs.gnu.org; Sun, 25 Jun 2023 21:07:36 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id ED186240027 for <48785@debbugs.gnu.org>; Mon, 26 Jun 2023 03:07:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1687741650; bh=i9J74ScobBm4bwFk0vB9UfSJm5RSteNw5pKq5xTDODA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=eeWgyVysRGxZARqpPp36vnSEdGgzqCRsFz6NGTJUzmzCnpR/b4iE15UY/Lx72Okn4 OR/iWuESl9mvpnCdnx0cNqmhT9so/XKbz3BBV8ZLduASjKkkXeUC+klMhDtVdviPaQ Rpm4av2jFjukFK8FtAGKcE40TVmJfiEJW+Vx3TVKmP2fXc1Hw12KG0JXfDrMXc5ZjX cSUnI+WKXq+CZ/eDTzkIra0tsF6TiTAdjMV5K4QLuoHAFUq8D/aqlT5iReuEpw58lE zpFQdQc44dMa/HsRgCNptOHgkGdINc9lj8bzjtVXVU+U8Dl1tSmdvdBoQlUONpsdEX RtS1tC6wGfV+g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Qq8p56yVDz6tww; Mon, 26 Jun 2023 03:07:25 +0200 (CEST) From: Vinicius Monego Date: Mon, 26 Jun 2023 01:06:34 +0000 Message-Id: <20230626010635.129221-2-monego@posteo.net> In-Reply-To: <20230626010635.129221-1-monego@posteo.net> References: <20230626010635.129221-1-monego@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 | 57 +++++++++++++++++++ 3 files changed, 80 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 4566f1b4a4..4445a08fb7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1527,6 +1527,7 @@ dist_patch_DATA = \ %D%/packages/patches/lierolibre-remove-arch-warning.patch \ %D%/packages/patches/lierolibre-try-building-other-arch.patch \ %D%/packages/patches/libcdio-glibc-compat.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 8fbb0274d4..17de467f46 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -88,9 +88,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) @@ -1800,31 +1802,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..c0665cfff9 --- /dev/null +++ b/gnu/packages/patches/lightgbm-use-system-libraries.patch @@ -0,0 +1,57 @@ +From 894648291b9629d51785e4fd1cae820d2858e039 Mon Sep 17 00:00:00 2001 +From: Vinicius Monego +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 +-- +2.31.1 From patchwork Mon Jun 26 01:06:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 51345 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 72F5127BBE9; Mon, 26 Jun 2023 02:08:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3DA9627BBE2 for ; Mon, 26 Jun 2023 02:08:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDai4-0007l8-TW; Sun, 25 Jun 2023 21:08:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDai3-0007kr-43 for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDai2-0004db-RR for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qDai2-0004fJ-Mz for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48785] [PATCH v6 3/3] gnu: Add python-lightgbm. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Jun 2023 01:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48785 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48785@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48785-submit@debbugs.gnu.org id=B48785.168774166417892 (code B ref 48785); Mon, 26 Jun 2023 01:08:02 +0000 Received: (at 48785) by debbugs.gnu.org; 26 Jun 2023 01:07:44 +0000 Received: from localhost ([127.0.0.1]:44027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDahk-0004eV-4u for submit@debbugs.gnu.org; Sun, 25 Jun 2023 21:07:44 -0400 Received: from mout02.posteo.de ([185.67.36.66]:35933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDahh-0004e6-Pd for 48785@debbugs.gnu.org; Sun, 25 Jun 2023 21:07:42 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 0FD8D240101 for <48785@debbugs.gnu.org>; Mon, 26 Jun 2023 03:07:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1687741656; bh=S+xWvyBJjg2cVGsH9kacXcLqQ2lWfEsqC8TqrPl4Q9g=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=CA2e7bHqDUI1t8WJJ1cTdeWUnFgjIzlcDh/NjI5PsA4D4YydtT+txeK3udI8xCRtg ARuMEqQB0WQ5TEH0cdtWiyHUcREutbffoylW7UEhIJfHAnAe9umXr2F6/TKE00klAl RScSw/Df8D6yuZyoIgC18LUCgQA8xsoHJQhmmBBAzAmoMShPjz4ZgLTuesvcAWVkna sDBAPzfuaohDyB1VBnKf0oFV6uVpcDt4vHN+wZdDKTHZMXZfzC7q4DC9lZGkfhjj22 kCBPWl8RH2d/qo6lN0o4xT6Sl0eq022WP6u3CEJ/D/2ME8Ryn7MNObPQsSky9i2Ru4 3reFBFAbkM3Aw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Qq8pG337zz6txw; Mon, 26 Jun 2023 03:07:34 +0200 (CEST) From: Vinicius Monego Date: Mon, 26 Jun 2023 01:06:35 +0000 Message-Id: <20230626010635.129221-3-monego@posteo.net> In-Reply-To: <20230626010635.129221-1-monego@posteo.net> References: <20230626010635.129221-1-monego@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/machine-learning.scm (python-lightgbm): New variable. --- Removed symlinks in favor of substituting lib_path. gnu/packages/machine-learning.scm | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 17de467f46..bba89d789d 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1839,6 +1839,45 @@ (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,") "")) + ;; Change lib_path to look for our package's lib. + (substitute* "lightgbm/libpath.py" + (("lib_path = \\[str\\(p\\) for p in dll_path if p\\.is_file\\(\\)]") + ;; lib_path is a list of paths. + (format #f "lib_path = ['~a/lib/lib_lightgbm.so']" + #$(this-package-input "lightgbm")))))) + (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