From patchwork Sat Sep 25 19:36:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 33290 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 61DC827BBE5; Sat, 25 Sep 2021 20:38:36 +0100 (BST) 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 0D7BB27BBE3 for ; Sat, 25 Sep 2021 20:38:36 +0100 (BST) Received: from localhost ([::1]:40622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUDVL-0005Hr-5n for patchwork@mira.cbaines.net; Sat, 25 Sep 2021 15:38:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUDUo-0005Fi-3D for guix-patches@gnu.org; Sat, 25 Sep 2021 15:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUDUn-0004Mj-Rt for guix-patches@gnu.org; Sat, 25 Sep 2021 15:38:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUDUn-0004EX-KJ for guix-patches@gnu.org; Sat, 25 Sep 2021 15:38:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48388] [PATCH v5 1/3] gnu: Add dmlc-core. References: <20210512235649.516594-1-monego@posteo.net> In-Reply-To: <20210512235649.516594-1-monego@posteo.net> Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Sep 2021 19:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48388 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48388@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48388-submit@debbugs.gnu.org id=B48388.163259864016199 (code B ref 48388); Sat, 25 Sep 2021 19:38:01 +0000 Received: (at 48388) by debbugs.gnu.org; 25 Sep 2021 19:37:20 +0000 Received: from localhost ([127.0.0.1]:34806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUDU8-0004DC-IN for submit@debbugs.gnu.org; Sat, 25 Sep 2021 15:37:20 -0400 Received: from mout01.posteo.de ([185.67.36.65]:56003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUDU5-0004Cw-FJ for 48388@debbugs.gnu.org; Sat, 25 Sep 2021 15:37:18 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 2B82F240026 for <48388@debbugs.gnu.org>; Sat, 25 Sep 2021 21:37:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1632598631; bh=8Gm0EMhC29mMhe3gIJCvK8RJ3Gyx/pjw22T/EJEXCdw=; h=From:To:Cc:Subject:Date:From; b=AFcEmTK5mDH7TdacWzJ72HylOJ2IA/k6tJJS7OivDCMYmJnzj4YzRT//Z35mZalg6 9fDo3zPXWuHNOcHSXdwa+0LrWHM/ic6aFn/rGHL2ADHRLOYe4nlt+Fcx4RbKqyFsfY OGZEsetjy9iaB8+bZK7JaDwxkt+LjyatDT97MiPG7EUXnixl/lv6I0j6LgurZoraJX 7622ZdEztFZqekey7bdND/nk1ebVRIYjgXTd5M3LWdWATga4JVGjlGP4xqjV8KBUeW XrZEzMGeDnBZ0KCklKmEhiANsn2HlHudJZU4/BOcSXpy1tDNEH9OjifPktouyMW0pU 7hQH6+ISragJA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HGzgV0Q9fz9rxF; Sat, 25 Sep 2021 21:37:09 +0200 (CEST) From: Vinicius Monego Date: Sat, 25 Sep 2021 19:36:49 +0000 Message-Id: <20210925193651.155981-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 (dmlc-core): New variable. --- Checked out from v0.5 tag instead of a commit. gnu/packages/machine-learning.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 9b5d4c1743..a4768211a0 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -2310,6 +2310,34 @@ learning models. This package provides the \"lite\" variant for mobile devices.") (license license:asl2.0))) +(define-public dmlc-core + (package + (name "dmlc-core") + (version "0.5") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dmlc/dmlc-core") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1x4ad1jhn84fywlk031fmv1kxyiscclmrqn9hhj8gz0mh7z9vcrh")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (list "-DGOOGLE_TEST=ON"))) + (native-inputs + `(("googletest" ,googletest) + ("python" ,python-wrapper))) + (home-page "https://github.com/dmlc/dmlc-core") + (synopsis "Common bricks library for machine learning") + (description + "DMLC-Core is the backbone library to support all DMLC projects, +offers the bricks to build efficient and scalable distributed machine +learning libraries.") + (license license:asl2.0))) + (define-public python-iml (package (name "python-iml") From patchwork Sat Sep 25 19:36:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 33289 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 06D8427BBE1; Sat, 25 Sep 2021 20:38:36 +0100 (BST) 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 7BAC927BBE3 for ; Sat, 25 Sep 2021 20:38:35 +0100 (BST) Received: from localhost ([::1]:40592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUDVK-0005G9-Cp for patchwork@mira.cbaines.net; Sat, 25 Sep 2021 15:38:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUDUo-0005Fq-DC for guix-patches@gnu.org; Sat, 25 Sep 2021 15:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUDUo-0004NK-5f for guix-patches@gnu.org; Sat, 25 Sep 2021 15:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUDUo-0004Ee-0p for guix-patches@gnu.org; Sat, 25 Sep 2021 15:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48388] [PATCH v5 2/3] gnu: Add xgboost. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Sep 2021 19:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48388 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48388@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48388-submit@debbugs.gnu.org id=B48388.163259864516215 (code B ref 48388); Sat, 25 Sep 2021 19:38:01 +0000 Received: (at 48388) by debbugs.gnu.org; 25 Sep 2021 19:37:25 +0000 Received: from localhost ([127.0.0.1]:34810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUDUC-0004DT-Pp for submit@debbugs.gnu.org; Sat, 25 Sep 2021 15:37:25 -0400 Received: from mout02.posteo.de ([185.67.36.66]:44643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUDU9-0004D2-V0 for 48388@debbugs.gnu.org; Sat, 25 Sep 2021 15:37:22 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id C4498240104 for <48388@debbugs.gnu.org>; Sat, 25 Sep 2021 21:37:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1632598635; bh=xnMoUZ8vJTV2dOAgopDJf8GN6iHrCij0cUzeZYvOOMo=; h=From:To:Cc:Subject:Date:From; b=eXSIByJ6aGJHe16QWWEC+is99r2sE0HvrSs7/SIwnSxBw81SNAhZ7nCcI+optIlLx lzE9snRFhPImW078Zj6XrX97Vdk/vfGO/QyU7KBLrkyRpsXoylIrEGa2TQsoEmso+2 K2oQnfmJHQLpevcV9paWT7RbMN8l9ubw3dfLABzvCpage+LUqLNcSIaOqxbWmNasN4 W5k0QkK1sByff9s8m23Yq/HIaS2+JbXoxv9DR/mlhzCgXeBxpiXcLoYL/lhkAlnix2 kGqSY/9mIixsCrltOZDnI0OHxnzhe4Mz9clfVEBjXi27eS0fmICoGaQ90BVaI//CJJ dFsWq9N2mfmuw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HGzgZ3wRSz6tm4; Sat, 25 Sep 2021 21:37:13 +0200 (CEST) From: Vinicius Monego Date: Sat, 25 Sep 2021 19:36:50 +0000 Message-Id: <20210925193651.155981-2-monego@posteo.net> In-Reply-To: <20210925193651.155981-1-monego@posteo.net> References: <20210925193651.155981-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 (xgboost): New variable. * gnu/packages/patches/xgboost-use-system-dmlc-core.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/machine-learning.scm | 32 +++++++++++++++++ .../xgboost-use-system-dmlc-core.patch | 34 +++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 gnu/packages/patches/xgboost-use-system-dmlc-core.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7d706f6f6e..22fc393f0e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1888,6 +1888,7 @@ dist_patch_DATA = \ %D%/packages/patches/xf86-video-voodoo-pcitag.patch \ %D%/packages/patches/xfce4-panel-plugins.patch \ %D%/packages/patches/xfce4-settings-defaults.patch \ + %D%/packages/patches/xgboost-use-system-dmlc-core.patch \ %D%/packages/patches/xmonad-dynamic-linking.patch \ %D%/packages/patches/xnnpack-system-libraries.patch \ %D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \ diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index a4768211a0..454088b1a5 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -2338,6 +2338,38 @@ offers the bricks to build efficient and scalable distributed machine learning libraries.") (license license:asl2.0))) +(define-public xgboost + (package + (name "xgboost") + (version "1.4.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dmlc/xgboost") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (patches (search-patches "xgboost-use-system-dmlc-core.patch")) + (sha256 + (base32 "00liz816ahk9zj3jv3m2fqwlf6xxfbgvpmpl72iklx32vl192w5d")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags (list "-DGOOGLE_TEST=ON"))) + (native-inputs + `(("googletest" ,googletest) + ("python" ,python-wrapper))) + (inputs + `(("dmlc-core" ,dmlc-core))) + (home-page "https://xgboost.ai/") + (synopsis "Gradient boosting (GBDT, GBRT or GBM) library") + (description + "XGBoost is an optimized distributed gradient boosting library designed +to be highly efficient, flexible and portable. It implements machine learning +algorithms under the Gradient Boosting framework. XGBoost provides a parallel +tree boosting (also known as GBDT, GBM) that solve many data science problems +in a fast and accurate way.") + (license license:asl2.0))) + (define-public python-iml (package (name "python-iml") diff --git a/gnu/packages/patches/xgboost-use-system-dmlc-core.patch b/gnu/packages/patches/xgboost-use-system-dmlc-core.patch new file mode 100644 index 0000000000..c654694fec --- /dev/null +++ b/gnu/packages/patches/xgboost-use-system-dmlc-core.patch @@ -0,0 +1,34 @@ +From 34167cc105e47589b86b6f62da76e0ab744002dd Mon Sep 17 00:00:00 2001 +From: Vinicius Monego +Date: Tue, 11 May 2021 19:35:30 -0300 +Subject: [PATCH] Use dmlc-core from Guix. + +--- +This patch is a subset of the following Debian patch: https://sources.debian.org/src/xgboost/1.2.1-1/debian/patches/cmake.patch/ + +Rabit is now developed as part of xgboost, so we don't build it separately. + + CMakeLists.txt | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6cc19fbd..3b42bc17 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -150,11 +150,9 @@ endif (USE_OPENMP) + + # dmlc-core + msvc_use_static_runtime() +-add_subdirectory(${xgboost_SOURCE_DIR}/dmlc-core) +-set_target_properties(dmlc PROPERTIES +- CXX_STANDARD 14 +- CXX_STANDARD_REQUIRED ON +- POSITION_INDEPENDENT_CODE ON) ++add_library(dmlc SHARED IMPORTED) ++find_library(DMLC_LIBRARY dmlc) ++set_property(TARGET dmlc PROPERTY IMPORTED_LOCATION "${DMLC_LIBRARY}") + if (MSVC) + target_compile_options(dmlc PRIVATE + -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE) +-- +2.31.1 From patchwork Sat Sep 25 19:36:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 33291 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 BDFB727BBE3; Sat, 25 Sep 2021 20:38:36 +0100 (BST) 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 52BDF27BBE1 for ; Sat, 25 Sep 2021 20:38:36 +0100 (BST) Received: from localhost ([::1]:40596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUDVL-0005GE-CQ for patchwork@mira.cbaines.net; Sat, 25 Sep 2021 15:38:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUDUo-0005G0-O4 for guix-patches@gnu.org; Sat, 25 Sep 2021 15:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUDUo-0004NS-GU for guix-patches@gnu.org; Sat, 25 Sep 2021 15:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUDUo-0004Em-Dd for guix-patches@gnu.org; Sat, 25 Sep 2021 15:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48388] [PATCH v5 3/3] gnu: Add python-xgboost. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Sep 2021 19:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48388 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48388@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48388-submit@debbugs.gnu.org id=B48388.163259865716241 (code B ref 48388); Sat, 25 Sep 2021 19:38:02 +0000 Received: (at 48388) by debbugs.gnu.org; 25 Sep 2021 19:37:37 +0000 Received: from localhost ([127.0.0.1]:34814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUDUP-0004Ds-7n for submit@debbugs.gnu.org; Sat, 25 Sep 2021 15:37:37 -0400 Received: from mout01.posteo.de ([185.67.36.65]:33705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUDUM-0004De-Py for 48388@debbugs.gnu.org; Sat, 25 Sep 2021 15:37:36 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 371B324002B for <48388@debbugs.gnu.org>; Sat, 25 Sep 2021 21:37:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1632598649; bh=kyxvv8Pr7r+uYqDvOawQkesQ2kER/FH2DuWhfduva+c=; h=From:To:Cc:Subject:Date:From; b=H0CG86xWm0iFCg58siyXpginLrg0qN3wmjUYEpZEwbDtRHy4W3oX/XcoDZ+vetcvY 0lUxNUhy/RseovarurF1PdgxTXBxrYzInD4WSHbb3+yl5mnEYSq0ylFSDPbfExzr4K /fkAG+wTBR1GBnbt0VUcHOWNo9f+uwjzrgrNA16o/bfLbKXmiSfPdCvBEsIVw945dC Co/ULGp7sBhmZ7tYghs26GWU72gfSeAwvVgpdAG9QvGy9py+pdvb/IO2UMdKS6ETLU vDEHUV5kgAKQCOOmSVlwOOTssDi9z8uPOIMJ1mbRD0rKay0yikRXXJQ4AwNdQXKSuC gPQNnfddLMWTA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HGzgf4nxDz9rxN; Sat, 25 Sep 2021 21:37:18 +0200 (CEST) From: Vinicius Monego Date: Sat, 25 Sep 2021 19:36:51 +0000 Message-Id: <20210925193651.155981-3-monego@posteo.net> In-Reply-To: <20210925193651.155981-1-monego@posteo.net> References: <20210925193651.155981-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 (python-xgboost): New variable. --- Skipped a test that fails in Pandas 1.3.0. gnu/packages/machine-learning.scm | 69 +++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 454088b1a5..5e17b09e89 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -2370,6 +2370,75 @@ tree boosting (also known as GBDT, GBM) that solve many data science problems in a fast and accurate way.") (license license:asl2.0))) +(define-public python-xgboost + (package + (inherit xgboost) + (name "python-xgboost") + (source (package-source xgboost)) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'preparations + (lambda _ + ;; Move python-package content to parent directory to silence + ;; some warnings about files not being found if we chdir. + (rename-file "python-package/xgboost" "xgboost") + (rename-file "python-package/README.rst" "README.rst") + (rename-file "python-package/setup.cfg" "setup.cfg") + (rename-file "python-package/setup.py" "setup.py") + ;; Skip rebuilding libxgboost.so. + (substitute* "setup.py" + (("ext_modules=\\[CMakeExtension\\('libxgboost'\\)\\],") "") + (("'install_lib': InstallLib,") "")))) + (add-after 'install 'install-version-and-libxgboost + (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")) + (xgbdir (string-append pylib "/xgboost")) + (version-file (string-append xgbdir "/VERSION")) + (libxgboost (string-append (assoc-ref inputs "xgboost") + "/lib/libxgboost.so"))) + (with-output-to-file version-file + (lambda () + (display ,(package-version xgboost)))) + (mkdir-p (string-append xgbdir "/lib")) + (symlink libxgboost (string-append xgbdir "/lib" + "/libxgboost.so"))))) + (replace 'check + ;; Python-specific tests are located in tests/python. + (lambda* (#:key inputs outputs tests? #:allow-other-keys) + (when tests? + (add-installed-pythonpath inputs outputs) + (invoke "pytest" "tests/python" + ;; FIXME: CLI tests fail with PermissionError. + "--ignore" "tests/python/test_cli.py" "-k" + (string-append + "not test_cli_regression_demo" + ;; The tests below open a network connection. + " and not test_model_compatibility" + " and not test_get_group" + " and not test_cv_no_shuffle" + " and not test_cv" + " and not test_training" + ;; FIXME: May pass in the next version. + " and not test_pandas" + ;; "'['./runexp.sh']' returned non-zero exit status 1" + " and not test_cli_binary_classification")))))))) + (native-inputs + `(("python-pandas" ,python-pandas) + ("python-pytest" ,python-pytest) + ("python-scikit-learn" ,python-scikit-learn))) + (inputs + `(("xgboost" ,xgboost))) + (propagated-inputs + `(("python-numpy" ,python-numpy) + ("python-scipy" ,python-scipy))) + (synopsis "Python interface for the XGBoost library"))) + (define-public python-iml (package (name "python-iml")