From patchwork Sun Oct 31 01:40:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 34184 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 29B4327BBE3; Sun, 31 Oct 2021 01:46:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 61F4327BBE1 for ; Sun, 31 Oct 2021 01:46:20 +0000 (GMT) Received: from localhost ([::1]:55602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgzvP-0008VB-Dl for patchwork@mira.cbaines.net; Sat, 30 Oct 2021 21:46:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgzv8-0008Uf-Tr for guix-patches@gnu.org; Sat, 30 Oct 2021 21:46:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47152) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgzv8-0006CO-M4 for guix-patches@gnu.org; Sat, 30 Oct 2021 21:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgzv8-0000tE-KN for guix-patches@gnu.org; Sat, 30 Oct 2021 21:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48785] [PATCH v4 2/3] gnu: lightgbm: Update to 3.3.1. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 31 Oct 2021 01:46: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.16356447323351 (code B ref 48785); Sun, 31 Oct 2021 01:46:02 +0000 Received: (at 48785) by debbugs.gnu.org; 31 Oct 2021 01:45:32 +0000 Received: from localhost ([127.0.0.1]:58695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgzud-0000ru-UV for submit@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 ) id 1mgzuX-0000rP-93 for 48785@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@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 Date: Sun, 31 Oct 2021 01:40:27 +0000 Message-Id: <20211031014028.82583-2-monego@posteo.net> In-Reply-To: <20211031014028.82583-1-monego@posteo.net> References: <20211031014028.82583-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" X-getmail-retrieved-from-mailbox: Patches * 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 +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 +