From: Vinicius Monego <monego@posteo.net>
To: 48785@debbugs.gnu.org
Cc: Vinicius Monego <monego@posteo.net>
Subject: [bug#48785] [PATCH v6 2/3] gnu: lightgbm: Update to 3.3.5.
Date: Mon, 26 Jun 2023 01:06:34 +0000 [thread overview]
Message-ID: <20230626010635.129221-2-monego@posteo.net> (raw)
In-Reply-To: <20230626010635.129221-1-monego@posteo.net>
* 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 <monego@posteo.net>
+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
next prev parent reply other threads:[~2023-06-26 1:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 22:05 [bug#48785] [PATCH 0/3] Update LightGBM and split frontends Vinicius Monego
2021-06-01 22:06 ` [bug#48785] [PATCH 1/3] gnu: Add fast-double-parser Vinicius Monego
2021-06-01 22:06 ` [bug#48785] [PATCH 2/3] gnu: lightgbm: Update to 3.2.1 Vinicius Monego
2021-06-01 22:06 ` [bug#48785] [PATCH 3/3] gnu: Add python-lightgbm Vinicius Monego
2021-06-30 20:09 ` [bug#48785] [PATCH v2 1/3] gnu: Add fast-double-parser Vinicius Monego
2021-06-30 20:09 ` [bug#48785] [PATCH v2 2/3] gnu: lightgbm: Update to 3.2.1 Vinicius Monego
2021-06-30 20:09 ` [bug#48785] [PATCH v2 3/3] gnu: Add python-lightgbm Vinicius Monego
2021-10-08 2:54 ` [bug#48785] [PATCH v3 1/3] gnu: Add fast-double-parser Vinicius Monego
2021-10-08 2:54 ` [bug#48785] [PATCH v3 2/3] gnu: lightgbm: Update to 3.2.1 Vinicius Monego
2021-10-08 2:54 ` [bug#48785] [PATCH v3 3/3] gnu: Add python-lightgbm Vinicius Monego
2021-10-31 1:40 ` [bug#48785] [PATCH v4 1/3] gnu: Add fast-double-parser Vinicius Monego
2021-10-31 1:40 ` [bug#48785] [PATCH v4 2/3] gnu: lightgbm: Update to 3.3.1 Vinicius Monego
2021-10-31 1:40 ` [bug#48785] [PATCH v4 3/3] gnu: Add python-lightgbm Vinicius Monego
2023-04-07 15:17 ` [bug#48785] [PATCH v5 1/3] gnu: Add fast-double-parser Vinicius Monego
2023-04-07 15:17 ` [bug#48785] [PATCH v5 2/3] gnu: lightgbm: Update to 3.3.5 Vinicius Monego
2023-04-07 15:17 ` [bug#48785] [PATCH v5 3/3] gnu: Add python-lightgbm Vinicius Monego
2023-06-26 1:06 ` [bug#48785] [PATCH v6 1/3] gnu: Add fast-double-parser Vinicius Monego
2023-06-26 1:06 ` Vinicius Monego [this message]
2023-06-26 1:06 ` [bug#48785] [PATCH v6 3/3] gnu: Add python-lightgbm Vinicius Monego
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230626010635.129221-2-monego@posteo.net \
--to=monego@posteo.net \
--cc=48785@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.