From patchwork Thu Dec 16 17:58:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35282 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 D115A27BBEA; Thu, 16 Dec 2021 17:59:19 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 2EF9D27BBE9 for ; Thu, 16 Dec 2021 17:59:19 +0000 (GMT) Received: from localhost ([::1]:41986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv2E-0007sA-By for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 12:59:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1y-0007cT-KL for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1y-0007yJ-Bz for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv1y-0006kE-BA for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 01/12] Add (guix cpu). Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753525862 (code B ref 52283); Thu, 16 Dec 2021 17:59:02 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:55 +0000 Received: from localhost ([127.0.0.1]:36676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1q-0006j2-DW for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1k-0006hj-61 for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:48 -0500 Received: from [2001:470:142:3::e] (port=44358 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1e-0007sS-Sf; Thu, 16 Dec 2021 12:58:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ba7OP6KtI+Mn55bAvnu/eUqr9RZOEwtUj+RZ4ZQqTAk=; b=g2QNUCk3oGMYlm/QcjeR uTYjYz9dFzUb8oOrYFEDh1Xf5WnPgVDwOd+CHl79Ez3gS4gzoS5ZXTLFIGpzQHhEwFreMIgKx659k pvpYryKY7vWfIw/W2KN/dGJMZDvT1S7LbdYQrrQBI3G0daJNx8OXpk799/Z8NI48QzLVq+eyNgu4c zqXlrfa/07IjKjYvHltHV9hkIjvrCgq+vUBrmxsFga4XAtyvk3hTa/5wfs3fXq6DuEezRkflLvSvg KF8U5UssPBdnGbcxyvGsAVSqNjq43gZhUOip7tD4eAklTHji0BA3vyt2bY04cy5SBaVJ3JoJb73sa gFr31f35GKEFQg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1d-0000YX-JR; Thu, 16 Dec 2021 12:58:42 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:16 +0100 Message-Id: <20211216175827.2077-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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 * guix/cpu.scm: New file. * Makefile.am (MODULES): Add it. --- Makefile.am | 1 + guix/cpu.scm | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 guix/cpu.scm diff --git a/Makefile.am b/Makefile.am index c4ccee65f1..dba9f4da82 100644 --- a/Makefile.am +++ b/Makefile.am @@ -81,6 +81,7 @@ MODULES = \ guix/base64.scm \ guix/ci.scm \ guix/cpio.scm \ + guix/cpu.scm \ guix/deprecation.scm \ guix/docker.scm \ guix/records.scm \ diff --git a/guix/cpu.scm b/guix/cpu.scm new file mode 100644 index 0000000000..e1911f52a8 --- /dev/null +++ b/guix/cpu.scm @@ -0,0 +1,143 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix cpu) + #:use-module (guix sets) + #:use-module (guix memoization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (ice-9 match) + #:use-module (ice-9 rdelim) + #:export (current-cpu + cpu? + cpu-architecture + cpu-family + cpu-model + cpu-flags + + cpu->gcc-architecture)) + +;;; Commentary: +;;; +;;; This module provides tools to determine the micro-architecture supported +;;; by the CPU and to map it to a name known to GCC's '-march'. +;;; +;;; Code: + +;; CPU description. +(define-record-type + (cpu architecture family model flags) + cpu? + (architecture cpu-architecture) ;string, from 'uname' + (family cpu-family) ;integer + (model cpu-model) ;integer + (flags cpu-flags)) ;set of strings + +(define current-cpu + (mlambda () + "Return a record representing the host CPU." + (define (prefix? prefix) + (lambda (str) + (string-prefix? prefix str))) + + (call-with-input-file "/proc/cpuinfo" + (lambda (port) + (let loop ((family #f) + (model #f)) + (match (read-line port) + ((? eof-object?) + #f) + ((? (prefix? "cpu family") str) + (match (string-tokenize str) + (("cpu" "family" ":" family) + (loop (string->number family) model)))) + ((? (prefix? "model") str) + (match (string-tokenize str) + (("model" ":" model) + (loop family (string->number model))) + (_ + (loop family model)))) + ((? (prefix? "flags") str) + (match (string-tokenize str) + (("flags" ":" flags ...) + (cpu (utsname:machine (uname)) + family model (list->set flags))))) + (_ + (loop family model)))))))) + +(define (cpu->gcc-architecture cpu) + "Return the architecture name, suitable for GCC's '-march' flag, that +corresponds to CPU, a record as returned by 'current-cpu'." + (match (cpu-architecture cpu) + ("x86_64" + ;; Transcribed from GCC's 'host_detect_local_cpu' in driver-i386.c. + (or (and (= 6 (cpu-family cpu)) ;the "Pentium Pro" family + (letrec-syntax ((model (syntax-rules (=>) + ((_) #f) + ((_ (candidate => integers ...) rest + ...) + (or (and (= (cpu-model cpu) integers) + candidate) + ... + (model rest ...)))))) + (model ("bonnel" => #x1c #x26) + ("silvermont" => #x37 #x4a #x4d #x5a #x5d) + ("core2" => #x0f #x17 #x1d) + ("nehalem" => #x1a #x1e #x1f #x2e) + ("westmere" => #x25 #x2c #x2f) + ("sandybridge" => #x2a #x2d) + ("ivybridge" => #x3a #x3e) + ("haswell" => #x3c #x3f #x45 #x46) + ("broadwell" => #x3d #x47 #x4f #x56) + ("skylake" => #x4e #x5e #x8e #x9e) + ("skylake-avx512" => #x55) ;TODO: cascadelake + ("knl" => #x57) + ("cannonlake" => #x66) + ("knm" => #x85)))) + + ;; Fallback case for non-Intel processors or for Intel processors not + ;; recognized above. + (letrec-syntax ((if-flags (syntax-rules (=>) + ((_) + #f) + ((_ (flags ... => name) rest ...) + (if (every (lambda (flag) + (set-contains? (cpu-flags cpu) + flag)) + '(flags ...)) + name + (if-flags rest ...)))))) + (if-flags ("avx512" => "knl") + ("adx" => "broadwell") + ("avx2" => "haswell") + ;; TODO: tigerlake, cooperlake, etc. + ("avx" => "sandybridge") + ("sse4_2" "gfni" => "tremont") + ("sse4_2" "sgx" => "goldmont-plus") + ("sse4_2" "xsave" => "goldmont") + ("sse4_2" "movbe" => "silvermont") + ("sse4_2" => "nehalem") + ("ssse3" "movbe" => "bonnell") + ("ssse3" => "core2"))) + + ;; TODO: Recognize AMD models (bdver*, znver*, etc.)? + + "x86_64")) + (architecture + ;; TODO: AArch64. + architecture))) From patchwork Thu Dec 16 17:58:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35283 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 B47F427BBEA; Thu, 16 Dec 2021 17:59:25 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 664AE27BBE9 for ; Thu, 16 Dec 2021 17:59:25 +0000 (GMT) Received: from localhost ([::1]:42302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv2K-00085v-Jj for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 12:59:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1z-0007dO-0b for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1y-0007yd-No for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv1y-0006kM-NW for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 02/12] gnu: gcc: Add 'compiler-cpu-architectures' property. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753525869 (code B ref 52283); Thu, 16 Dec 2021 17:59:02 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:55 +0000 Received: from localhost ([127.0.0.1]:36678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1q-0006j5-Sh for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1k-0006hl-Ot for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:49 -0500 Received: from [2001:470:142:3::e] (port=44360 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1f-0007sv-FB; Thu, 16 Dec 2021 12:58:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=k2rQJtIYycTod0yeCRhkKH1YPtWMY1s9DumhSBbuXKE=; b=NW8OmCMCo69U7b3vy5T/ +FYprNpKfnf7Uwu1gzSVb1Sy/nShCfHcTbr5nMnPvrS82dH2pMvcD/iWDM0LOoJweyMiQDxMBBjG3 aFohyvKmPfStlQQz9jkRcy8ZNQNCKq4glLVrY2uNk9MW70t3uctcnjHSJPMIAKzN7vfspTy5Qvapo HjNZkilD/GAmrATK+02iG5G4g2MfDdIS+WZCoibE/o8GuCGJvbZc8cMcNBUMqfJnWnw9BK1l4pTPu Ms34qCcI5Nu8kBRJOdh24BNvWLfiD1lgL+NJuhnkxMh7Uh1IJJUaZ1SiBJbj158INNoK4rRb2MSqq rebhaK3rjIqgcQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1f-0000YX-ES; Thu, 16 Dec 2021 12:58:43 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:17 +0100 Message-Id: <20211216175827.2077-3-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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/gcc.scm (%gcc-7.5-x86_64-micro-architectures) (%gcc-10-x86_64-micro-architectures): New variables. (gcc-7, gcc-10): Add 'properties' field. * gnu/packages/commencement.scm (make-gcc-toolchain): Likewise. --- gnu/packages/commencement.scm | 1 + gnu/packages/gcc.scm | 31 +++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index e570a95b04..8c81098bc0 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3768,6 +3768,7 @@ (define* (make-gcc-toolchain gcc (append (package-search-paths gcc) (package-search-paths libc))) + (properties (package-properties gcc)) ;for 'compiler-cpu-architectures' (license (package-license gcc)) (synopsis "Complete GCC tool chain for C/C++ development") (description diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index f526680f56..efa0baeaa1 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -525,6 +525,27 @@ (define-public gcc-6 ,@(package-inputs gcc-4.7))))) +(define %gcc-7.5-x86_64-micro-architectures + ;; Suitable '-march' values for GCC 7.5 (info "(gcc) x86 Options"). + '("core2" "nehalem" "westmere" "sandybridge" "ivybridge" + "haswell" "broadwell" "skylake" "bonnell" "silvermont" + "knl" "skylake-avx512" + + "k8" "k8-sse3" "barcelona" + "bdver1" "bdver2" "bdver3" "bdver4" + "znver1" + "btver1" "btver2" "geode")) + +(define %gcc-10-x86_64-micro-architectures + ;; Suitable '-march' values for GCC 10. + (append %gcc-7.5-x86_64-micro-architectures + '("goldmont" "goldmont-plus" "tremont" + "knm" "cannonlake" "icelake-client" "icelake-server" + "cascadelake" "cooperlake" "tigerlake" + + "znver2" "znver3"))) + + (define-public gcc-7 (package (inherit gcc-6) @@ -542,7 +563,10 @@ (define-public gcc-7 (description "GCC is the GNU Compiler Collection. It provides compiler front-ends for several languages, including C, C++, Objective-C, Fortran, Ada, and Go. -It also includes runtime support libraries for these languages."))) +It also includes runtime support libraries for these languages.") + (properties + `((compiler-cpu-architectures + ("x86_64" ,@%gcc-7.5-x86_64-micro-architectures)))))) (define-public gcc-8 (package @@ -592,7 +616,10 @@ (define-public gcc-10 (patches (search-patches "gcc-9-strmov-store-file-names.patch" "gcc-5.0-libvtv-runpath.patch")) (modules '((guix build utils))) - (snippet gcc-canadian-cross-objdump-snippet))))) + (snippet gcc-canadian-cross-objdump-snippet))) + (properties + `((compiler-cpu-architectures + ("x86_64" ,@%gcc-10-x86_64-micro-architectures)))))) (define-public gcc-11 (package From patchwork Thu Dec 16 17:58:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35284 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 DBA9E27BBEA; Thu, 16 Dec 2021 17:59:30 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 265DB27BBE9 for ; Thu, 16 Dec 2021 17:59:30 +0000 (GMT) Received: from localhost ([::1]:42640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv2P-0008Kh-B6 for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 12:59:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1z-0007ea-DQ for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1z-0007yx-4x for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv1z-0006kT-4P for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 03/12] gnu: clang: Add 'compiler-cpu-architectures' property. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753525876 (code B ref 52283); Thu, 16 Dec 2021 17:59:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:55 +0000 Received: from localhost ([127.0.0.1]:36680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1r-0006jC-7v for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1l-0006hm-CN for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:49 -0500 Received: from [2001:470:142:3::e] (port=44364 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0007tB-2K; Thu, 16 Dec 2021 12:58:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=akp4J/T/ngJSGbARlTwRHi1VKqG5dsx9Z4tiXpIvQ04=; b=RnSyYadA6ypm4+a+Iujf b7Wwmkgq+/PMwgIZ50DCDuhJ8FDFFpZ/9CwrPS1cgxL1KXvqzxRfnHs+7sYmYx8HQ2nUVrj5aueAM JJSBvQWvpNhQYh173qvDLuVp8B/sm3oCDSg8+KW+Ux/2Cyjo4Duyxq0sqT0mGpRsAqInB8N856kb0 BF0CbFD2LUKHB5KtI19y+PGE3OuFC84mdZBgtxJ+xFl6hro9uzSYwt15XVN9UofKZuxbyfdX8tsPr uY2WEx7rIhMqcHRqmLQWe9NJkcuF8SEoGhsn1meNajTccg+4J9ih1TseK62y2PaD5awpOy2HpIHpm YeqEbcG085HO3A==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0000YX-1i; Thu, 16 Dec 2021 12:58:44 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:18 +0100 Message-Id: <20211216175827.2077-4-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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/llvm.scm (clang-from-llvm): Add #:properties and honor it. (clang-properties): New procedures. (make-clang-toolchain): Set 'properties' field. --- gnu/packages/llvm.scm | 71 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 051bbfeab5..d87ab570ff 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -155,7 +155,9 @@ (define* (clang-runtime-from-llvm llvm hash (supported-systems (delete "mips64el-linux" %supported-systems)))) (define* (clang-from-llvm llvm clang-runtime hash - #:key (patches '()) tools-extra) + #:key (patches '()) tools-extra + (properties + (clang-properties (package-version llvm)))) "Produce Clang with dependencies on LLVM and CLANG-RUNTIME, and applying the given PATCHES. When TOOLS-EXTRA is given, it must point to the 'clang-tools-extra' tarball, which contains code for 'clang-tidy', 'pp-trace', @@ -426,10 +428,76 @@ (define (move program) Objective-C++ programming languages. It uses LLVM as its back end. The Clang project includes the Clang front end, the Clang static analyzer, and several code analysis tools.") + (properties properties) (license (if (version>=? version "9.0") license:asl2.0 ;with LLVM exceptions license:ncsa)))) +(define (clang-properties version) + "Return package properties for Clang VERSION." + `((compiler-cpu-architectures + ("x86_64" + ;; This list was obtained by running: + ;; + ;; guix shell clang -- llc -march=x86-64 -mattr=help + ;; + ;; filtered from uninteresting entries such as "i686" and "pentium". + ,@(if (version>=? version "10.0") ;TODO: refine + '("atom" + "barcelona" + "bdver1" + "bdver2" + "bdver3" + "bdver4" + "bonnell" + "broadwell" + "btver1" + "btver2" + "c3" + "c3-2" + "cannonlake" + "cascadelake" + "cooperlake" + "core-avx-i" + "core-avx2" + "core2" + "corei7" + "corei7-avx" + "generic" + "geode" + "goldmont" + "goldmont-plus" + "haswell" + "icelake-client" + "icelake-server" + "ivybridge" + "k8" + "k8-sse3" + "knl" + "knm" + "lakemont" + "nehalem" + "nocona" + "opteron" + "opteron-sse3" + "sandybridge" + "silvermont" + "skx" + "skylake" + "skylake-avx512" + "slm" + "tigerlake" + "tremont" + "westmere" + "x86-64" + "x86-64-v2" + "x86-64-v3" + "x86-64-v4" + "znver1" + "znver2" + "znver3") + '()))))) + (define (make-clang-toolchain clang) (package (name (string-append (package-name clang) "-toolchain")) @@ -471,6 +539,7 @@ (define (make-clang-toolchain clang) (search-paths (package-search-paths clang)) (license (package-license clang)) + (properties (package-properties clang)) ;for 'compiler-cpu-architectures' (home-page "https://clang.llvm.org") (synopsis "Complete Clang toolchain for C/C++ development") (description "This package provides a complete Clang toolchain for C/C++ From patchwork Thu Dec 16 17:58:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35281 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 E3D9227BBEA; Thu, 16 Dec 2021 17:59:18 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 3C13727BBE9 for ; Thu, 16 Dec 2021 17:59:17 +0000 (GMT) Received: from localhost ([::1]:41824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv2B-0007kb-5G for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 12:59:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv20-0007hm-8q for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1z-0007ze-Vl for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv1z-0006ki-VF for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 04/12] transformations: Add '--tune'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753725898 (code B ref 52283); Thu, 16 Dec 2021 17:59:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:57 +0000 Received: from localhost ([127.0.0.1]:36686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1s-0006jR-3W for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1m-0006ho-Ml for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:51 -0500 Received: from [2001:470:142:3::e] (port=44366 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0007tO-MM; Thu, 16 Dec 2021 12:58:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=axS1J317GZlt1ub+4jg7w5vcZplZal22jFm/vGHwbWk=; b=TPm4oRWBN6c4PQlob7aA gvFRaVof0SVcB8Fyc2JzZwUAUHkM4urBMkpPS0YaJGhbY0G/hNtOT7Nb41nOjVVb2y/mdCPkM7Hkk 3xLo0tuYKLwj1X1XGwKdbdt1f6PDEjGRzBCYWfwM0G0LiehvPsPmHyKvPo3NvFcXwIP5Hln15LHvH pu5P+nk91z/+V0krwsX5RRmu0laDGR8gM9QrpfxnFqwRmc+Hc1GEctr7+AB7drNG0oK4Y0uXW7fO2 01ex3Wd4ImuSS5/zVYLN3K8FVhyRjzerm1KUVtJZtRym86jZuHLXdPIw6JPAiIoU38+XikOnKxGMg fCbKQQOPGApnlw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0000YX-LQ; Thu, 16 Dec 2021 12:58:44 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:19 +0100 Message-Id: <20211216175827.2077-5-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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 From: Ludovic Courtès * guix/transformations.scm (tuning-compiler) (tuned-package, tunable-package?, package-tuning) (transform-package-tuning) (build-system-with-tuning-compiler): New procedures. (%transformations): Add 'tune'. (%transformation-options): Add "--tune". * tests/transformations.scm ("options->transformation, tune") ("options->transformations, tune, wrong micro-architecture"): New tests. * doc/guix.texi (Package Transformation Options): Document '--tune'. --- doc/guix.texi | 61 ++++++++++++ guix/transformations.scm | 204 ++++++++++++++++++++++++++++++++++++++ tests/transformations.scm | 35 +++++++ 3 files changed, 300 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 7b1a64deb9..b3207e125a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11014,6 +11014,67 @@ available options and a synopsis (these options are not shown in the @table @code +@cindex performance, tuning code +@cindex optimization, of package code +@cindex tuning, of package code +@cindex SIMD support +@cindex tunable packages +@cindex package multi-versioning +@item --tune[=@var{cpu}] +Use versions of the packages marked as ``tunable'' optimized for +@var{cpu}. When @var{cpu} is @code{native}, or when it is omitted, tune +for the CPU on which the @command{guix} command is running. + +Valid @var{cpu} names are those recognized by the underlying compiler, +by default the GNU Compiler Collection. On x86_64 processors, this +includes CPU names such as @code{nehalem}, @code{haswell}, and +@code{skylake} (@pxref{x86 Options, @code{-march},, gcc, Using the GNU +Compiler Collection (GCC)}). + +As new generations of CPUs come out, they augment the standard +instruction set architecture (ISA) with additional instructions, in +particular instructions for single-instruction/multiple-data (SIMD) +parallel processing. For example, while Core2 and Skylake CPUs both +implement the x86_64 ISA, only the latter supports AVX2 SIMD +instructions. + +The primary gain one can expect from @option{--tune} is for programs +that can make use of those SIMD capabilities @emph{and} that do not +already have a mechanism to select the right optimized code at run time. +Packages that have the @code{tunable?} property set are considered +@dfn{tunable packages} by the @option{--tune} option; a package +definition with the property set looks like this: + +@lisp +(package + (name "hello-simd") + ;; ... + + ;; This package may benefit from SIMD extensions so + ;; mark it as "tunable". + (properties '((tunable? . #t)))) +@end lisp + +Other packages are not considered tunable. This allows Guix to use +generic binaries in the cases where tuning for a specific CPU is +unlikely to provide any gain. + +Tuned packages are built with @code{-march=@var{CPU}}; under the hood, +the @option{-march} option is passed to the actual wrapper by a compiler +wrapper. Since the build machine may not be able to run code for the +target CPU micro-architecture, the test suite is not run when building a +tuned package. + +To reduce rebuilds to the minimum, tuned packages are @emph{grafted} +onto packages that depend on them (@pxref{Security Updates, grafts}). +Thus, using @option{--no-grafts} cancels the effect of @option{--tune}. + +We call this technique @dfn{package multi-versioning}: several variants +of tunable packages may be built, one for each CPU variant. It is the +coarse-grain counterpart of @dfn{function multi-versioning} as +implemented by the GNU tool chain (@pxref{Function Multiversioning,,, +gcc, Using the GNU Compiler Collection (GCC)}). + @item --with-source=@var{source} @itemx --with-source=@var{package}=@var{source} @itemx --with-source=@var{package}@@@var{version}=@var{source} diff --git a/guix/transformations.scm b/guix/transformations.scm index 5ae1977cb2..c43c00cdd3 100644 --- a/guix/transformations.scm +++ b/guix/transformations.scm @@ -18,9 +18,11 @@ ;;; along with GNU Guix. If not, see . (define-module (guix transformations) + #:use-module ((guix config) #:select (%system)) #:use-module (guix i18n) #:use-module (guix store) #:use-module (guix packages) + #:use-module (guix build-system) #:use-module (guix profiles) #:use-module (guix diagnostics) #:autoload (guix download) (download-to-store) @@ -29,6 +31,7 @@ (define-module (guix transformations) #:autoload (guix upstream) (package-latest-release upstream-source-version upstream-source-signature-urls) + #:autoload (guix cpu) (current-cpu cpu->gcc-architecture) #:use-module (guix utils) #:use-module (guix memoization) #:use-module (guix gexp) @@ -49,6 +52,9 @@ (define-module (guix transformations) #:export (options->transformation manifest-entry-with-transformations + tunable-package? + tuned-package + show-transformation-options-help %transformation-options)) @@ -419,6 +425,181 @@ (define replacements obj) obj))) +(define tuning-compiler + (mlambda (micro-architecture) + "Return a compiler wrapper that passes '-march=MICRO-ARCHITECTURE' to the +actual compiler." + (define wrapper + #~(begin + (use-modules (ice-9 match)) + + (define* (search-next command + #:optional + (path (string-split (getenv "PATH") + #\:))) + ;; Search the next COMMAND on PATH, a list of + ;; directories representing the executable search path. + (define this + (stat (car (command-line)))) + + (let loop ((path path)) + (match path + (() + (match command + ("cc" (search-next "gcc")) + (_ #f))) + ((directory rest ...) + (let* ((file (string-append + directory "/" command)) + (st (stat file #f))) + (if (and st (not (equal? this st))) + file + (loop rest))))))) + + (match (command-line) + ((command arguments ...) + (match (search-next (basename command)) + (#f (exit 127)) + (next + (apply execl next + (append (cons next arguments) + (list (string-append "-march=" + #$micro-architecture)))))))))) + + (define program + (program-file (string-append "tuning-compiler-wrapper-" micro-architecture) + wrapper)) + + (computed-file (string-append "tuning-compiler-" micro-architecture) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (define bin (string-append #$output "/bin")) + (mkdir-p bin) + + (for-each (lambda (program) + (symlink #$program + (string-append bin "/" program))) + '("cc" "gcc" "clang" "g++" "c++" "clang++"))))))) + +(define (build-system-with-tuning-compiler bs micro-architecture) + "Return a variant of BS, a build system, that ensures that the compiler that +BS uses (usually an implicit input) can generate code for MICRO-ARCHITECTURE, +which names a specific CPU of the target architecture--e.g., when targeting +86_64 MICRO-ARCHITECTURE might be \"skylake\". If it does, return a build +system that builds code for MICRO-ARCHITECTURE; otherwise raise an error." + (define %not-hyphen + (char-set-complement (char-set #\-))) + + (define lower + (build-system-lower bs)) + + (define (lower* . args) + ;; The list of CPU names supported by the '-march' option of C/C++ + ;; compilers is specific to each compiler and version thereof. Rather + ;; than pass '-march=MICRO-ARCHITECTURE' as is to the compiler, possibly + ;; leading to an obscure build error, check whether the compiler is known + ;; to support MICRO-ARCHITECTURE. If not, bail out. + (let* ((lowered (apply lower args)) + (architecture (match (string-tokenize (bag-system lowered) + %not-hyphen) + ((arch _ ...) arch))) + (compiler (any (match-lambda + ((label (? package? p) . _) + (and (assoc-ref (package-properties p) + 'compiler-cpu-architectures) + p)) + (_ #f)) + (bag-build-inputs lowered)))) + (unless compiler + (raise (formatted-message + (G_ "failed to determine which compiler is used")))) + + (let ((lst (assoc-ref (package-properties compiler) + 'compiler-cpu-architectures))) + (unless lst + (raise (formatted-message + (G_ "failed to determine whether ~a supports ~a") + (package-full-name compiler) + micro-architecture))) + (unless (member micro-architecture + (or (assoc-ref lst architecture) '())) + (raise (formatted-message + (G_ "compiler ~a does not support micro-architecture ~a") + (package-full-name compiler) + micro-architecture)))) + + (bag + (inherit lowered) + (build-inputs + ;; Arrange so that the compiler wrapper comes first in $PATH. + `(("tuning-compiler" ,(tuning-compiler micro-architecture)) + ,@(bag-build-inputs lowered)))))) + + (build-system + (inherit bs) + (lower lower*))) + +(define (tuned-package p micro-architecture) + "Return package P tuned for MICRO-ARCHITECTURE." + (package + (inherit p) + (build-system + (build-system-with-tuning-compiler (package-build-system p) + micro-architecture)) + (arguments + ;; The machine building this package may or may not be able to run code + ;; for MICRO-ARCHITECTURE. Because of that, skip tests; they are run for + ;; the "baseline" variant anyway. + (substitute-keyword-arguments (package-arguments p) + ((#:tests? _ #f) #f))) + + (properties + `((cpu-tuning . ,micro-architecture) + + ;; Remove the 'tunable?' property so that 'package-tuning' does not + ;; call 'tuned-package' again on this one. + ,@(alist-delete 'tunable? (package-properties p)))))) + +(define (tunable-package? package) + "Return true if package PACKAGE is \"tunable\"--i.e., if tuning it for the +host CPU is worthwhile." + (assq 'tunable? (package-properties package))) + +(define package-tuning + (mlambda (micro-architecture) + "Return a procedure that maps the given package to its counterpart tuned +for MICRO-ARCHITECTURE, a string suitable for GCC's '-march'." + (define rewriting-property + (gensym " package-tuning")) + + (package-mapping (lambda (p) + (cond ((assq rewriting-property (package-properties p)) + p) + ((assq 'tunable? (package-properties p)) + (info (G_ "tuning ~a for CPU ~a~%") + (package-full-name p) micro-architecture) + (package/inherit p + (replacement (tuned-package p micro-architecture)) + (properties `((,rewriting-property . #t) + ,@(package-properties p))))) + (else + p))) + (lambda (p) + (assq rewriting-property (package-properties p))) + #:deep? #t))) + +(define (transform-package-tuning micro-architectures) + "Return a procedure that, when " + (match micro-architectures + ((micro-architecture _ ...) + (let ((rewrite (package-tuning micro-architecture))) + (lambda (obj) + (if (package? obj) + (rewrite obj) + obj)))))) + (define (transform-package-with-debug-info specs) "Return a procedure that, when passed a package, set its 'replacement' field to the same package but with #:strip-binaries? #f in its 'arguments' field." @@ -601,6 +782,7 @@ (define %transformations (with-commit . ,transform-package-source-commit) (with-git-url . ,transform-package-source-git-url) (with-c-toolchain . ,transform-package-toolchain) + (tune . ,transform-package-tuning) (with-debug-info . ,transform-package-with-debug-info) (without-tests . ,transform-package-tests) (with-patch . ,transform-package-patches) @@ -640,6 +822,28 @@ (define %transformation-options (parser 'with-git-url)) (option '("with-c-toolchain") #t #f (parser 'with-c-toolchain)) + (option '("tune") #f #t + (lambda (opt name arg result . rest) + (define micro-architecture + (match arg + ((or #f "native") + (unless (string=? (or (assoc-ref result 'system) + (%current-system)) + %system) + (leave (G_ "\ +building for ~a instead of ~a, so tuning cannot be guessed~%") + (assoc-ref result 'system) %system)) + + (cpu->gcc-architecture (current-cpu))) + ("generic" #f) + (_ arg))) + + (apply values + (if micro-architecture + (alist-cons 'tune micro-architecture + result) + (alist-delete 'tune result)) + rest))) (option '("with-debug-info") #t #f (parser 'with-debug-info)) (option '("without-tests") #t #f diff --git a/tests/transformations.scm b/tests/transformations.scm index 09839dc1c5..8db85b4305 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -38,12 +38,14 @@ (define-module (test-transformations) #:use-module (guix utils) #:use-module (guix git) #:use-module (guix upstream) + #:use-module (guix diagnostics) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages busybox) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) #:use-module (srfi srfi-64)) @@ -465,6 +467,39 @@ (define (package-name* obj) `((with-latest . "foo"))))) (package-version (t p))))) +(test-equal "options->transformation, tune" + '(cpu-tuning . "superfast") + (let* ((p0 (dummy-package "p0")) + (p1 (dummy-package "p1" + (inputs `(("p0" ,p0))) + (properties '((tunable? . #t))))) + (p2 (dummy-package "p2" + (inputs `(("p1" ,p1))))) + (t (options->transformation '((tune . "superfast")))) + (p3 (t p2))) + (and (not (package-replacement p3)) + (match (package-inputs p3) + ((("p1" tuned)) + (match (package-inputs tuned) + ((("p0" p0)) + (and (not (package-replacement p0)) + (assq 'cpu-tuning + (package-properties + (package-replacement tuned))))))))))) + +(test-assert "options->transformations, tune, wrong micro-architecture" + (let ((p (dummy-package "tunable" + (properties '((tunable? . #t))))) + (t (options->transformation '((tune . "nonexistent-superfast"))))) + ;; Because GCC used by P's build system does not support + ;; '-march=nonexistent-superfast', we should see an error when lowering + ;; the tuned package. + (guard (c ((formatted-message? c) + (member "nonexistent-superfast" + (formatted-message-arguments c)))) + (package->bag (t p)) + #f))) + (test-equal "options->transformation + package->manifest-entry" '((transformations . ((without-tests . "foo")))) (let* ((p (dummy-package "foo")) From patchwork Thu Dec 16 17:58:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35285 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 4E2A927BBEA; Thu, 16 Dec 2021 17:59:33 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 C48DC27BBE9 for ; Thu, 16 Dec 2021 17:59:32 +0000 (GMT) Received: from localhost ([::1]:42816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv2S-0008Sg-07 for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 12:59:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1z-0007g7-R7 for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53381) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1z-0007zG-IG for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv1z-0006ka-Hw for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 05/12] ci: Add extra jobs for tunable packages. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753625884 (code B ref 52283); Thu, 16 Dec 2021 17:59:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:56 +0000 Received: from localhost ([127.0.0.1]:36682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1r-0006jJ-KB for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1m-0006hq-WD for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:51 -0500 Received: from [2001:470:142:3::e] (port=44368 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1h-0007tb-9Z; Thu, 16 Dec 2021 12:58:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=KkmRNdObKbMR8mxqnuQObOQAbzMbid4vqB6zPpNAsqY=; b=N3mi0GJ+hOegqmg37KaB /r274tIWOeHAw4lB3wGzyXqGgeRKLS7Y0pW2PbT3EE8VWR8K4sGcyDxaC+owYy7FrcV5v/xQZIFJS iAWKxskTUD77DMbbVmS8CDQC8qX7ft7LgNOFSZTLG+OGB04O2JvKXcHAb5ZY6SH3quURIqLCmYesx Ag8oL8vydtHn20pwEQ7PWBBoBc3AuUZBkd2vCHSC8IBw5K8ACQyUw5o/p45voHgTbkg2BLSHIPfJK AQYSSRho2vaNsGu+gu00DSCAX48tTfb13Bv0oZ6CJ02wYODOIW3GTIIlV+PlvwGYTRvP3hMHwVQPP ZxDTOgCN4xH3ow==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1h-0000YX-8y; Thu, 16 Dec 2021 12:58:45 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:20 +0100 Message-Id: <20211216175827.2077-6-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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 This allows us to provide substitutes for tuned package variants. * gnu/ci.scm (package-job): Add #:suffix and honor it. (package->job): Add #:suffix and honor it. (%x86-64-micro-architectures): New variable. (tuned-package-jobs): New procedure. (cuirass-jobs): Add jobs for tunable packages. --- gnu/ci.scm | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/gnu/ci.scm b/gnu/ci.scm index 6039af8f07..35fd583f75 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -28,6 +28,7 @@ (define-module (gnu ci) #:use-module (guix grafts) #:use-module (guix profiles) #:use-module (guix packages) + #:autoload (guix transformations) (tunable-package? tuned-package) #:use-module (guix channels) #:use-module (guix config) #:use-module (guix derivations) @@ -107,9 +108,9 @@ (define* (derivation->job name drv (#:timeout . ,timeout))) (define* (package-job store job-name package system - #:key cross? target) + #:key cross? target (suffix "")) "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." - (let ((job-name (string-append job-name "." system))) + (let ((job-name (string-append job-name "." system suffix))) (parameterize ((%graft? #f)) (let* ((drv (if cross? (package-cross-derivation store package target system @@ -395,21 +396,39 @@ (define package->job (((_ inputs _ ...) ...) inputs)))) (%final-inputs))))) - (lambda (store package system) + (lambda* (store package system #:key (suffix "")) "Return a job for PACKAGE on SYSTEM, or #f if this combination is not -valid." +valid. Append SUFFIX to the job name." (cond ((member package base-packages) (package-job store (string-append "base." (job-name package)) - package system)) + package system #:suffix suffix)) ((supported-package? package system) (let ((drv (package-derivation store package system #:graft? #f))) (and (substitutable-derivation? drv) (package-job store (job-name package) - package system)))) + package system #:suffix suffix)))) (else #f))))) +(define %x86-64-micro-architectures + ;; Micro-architectures for which we build tuned variants. + '("westmere" "ivybridge" "haswell" "skylake" "skylake-avx512")) + +(define (tuned-package-jobs store package system) + "Return a list of jobs for PACKAGE tuned for SYSTEM's micro-architectures." + (filter-map (lambda (micro-architecture) + (define suffix + (string-append "." micro-architecture)) + + (package->job store + (tuned-package package micro-architecture) + system + #:suffix suffix)) + (match system + ("x86_64-linux" %x86-64-micro-architectures) + (_ '())))) + (define (all-packages) "Return the list of packages to build." (define (adjust package result) @@ -527,10 +546,16 @@ (define source ('all ;; Build everything, including replacements. (let ((all (all-packages)) - (job (lambda (package) - (package->job store package system)))) + (jobs (lambda (package) + (match (package->job store package system) + (#f '()) + (main-job + (cons main-job + (if (tunable-package? package) + (tuned-package-jobs store package system) + '()))))))) (append - (filter-map job all) + (append-map jobs all) (cross-jobs store system)))) ('core ;; Build core packages only. From patchwork Thu Dec 16 17:58:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35286 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 6CD0B27BBEA; Thu, 16 Dec 2021 18:00:15 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 30EB627BBE9 for ; Thu, 16 Dec 2021 18:00:15 +0000 (GMT) Received: from localhost ([::1]:43236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv38-0000M1-7V for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 13:00:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv2x-0000Ko-Px for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv2x-0008Dt-GQ for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv2x-0006oJ-FW for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 06/12] gnu: Add eigen-benchmarks. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967756926030 (code B ref 52283); Thu, 16 Dec 2021 18:00:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:29 +0000 Received: from localhost ([127.0.0.1]:36700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2B-0006lI-7Y for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1n-0006hs-Tc for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:52 -0500 Received: from [2001:470:142:3::e] (port=44370 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1i-0007tl-Jd; Thu, 16 Dec 2021 12:58:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=a/87rTX3i21SX5TarF3RqNqUIj/uyM5qeiQOTlxu2AI=; b=M6xu06Boof8Ma4i0xPvQ crN9lsppx69Y44/XllLDxBpEKQ2xYr6J/GgZaoRTeJiIDVMXxL0ZGDMFaI8ABJVKgAVJHdpYvePir h7RSsnDU5mqHZQ0xnbDp0lQ6SkDc9cIxN7AJ2+nejOpycWo2Sz1i8T1yq1pYRytVVQmFAN4yTYT2i aab4CagjLXixO7hmQYD6jJyyY8YBzV17aRy6v0UuCgWc33IQRzTQZ15gr+9R820Z8Cl+tzLbabT06 n3ZuvMT5SnfKzpv4LjSZM05WsUq4UTEEJlx9PzfkwoURmEzWw1EwRMOED5G+ocmihkhtd3w1ZipZm e8t+KzwysVxSDQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1h-0000YX-SZ; Thu, 16 Dec 2021 12:58:46 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:21 +0100 Message-Id: <20211216175827.2077-7-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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/algebra.scm (eigen-benchmarks): New variable. --- gnu/packages/algebra.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 79785bd463..e92ef4bf3f 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1044,6 +1044,44 @@ (define-public eigen ;; See 'COPYING.README' for details. (license license:mpl2.0))) +(define-public eigen-benchmarks + (package + (inherit eigen) + (name "eigen-benchmarks") + (arguments + '(#:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (define (compile file) + (format #t "compiling '~a'...~%" file) + (let ((target + (string-append bin "/" + (basename file ".cpp")))) + (invoke "c++" "-o" target file + "-I" ".." "-O2" "-g" + "-lopenblas" "-Wl,--as-needed"))) + + (mkdir-p bin) + (with-directory-excursion "bench" + ;; There are more benchmarks, of varying quality. + ;; Here we pick some that appear to be useful. + (for-each compile + '("benchBlasGemm.cpp" + "benchCholesky.cpp" + ;;"benchEigenSolver.cpp" + "benchFFT.cpp" + "benchmark-blocking-sizes.cpp")))))) + (delete 'install)))) + (inputs (list boost openblas)) + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties '((tunable? . #t))) + + (synopsis "Micro-benchmarks of the Eigen linear algebra library"))) + (define-public eigen-for-tensorflow (let ((changeset "fd6845384b86") (revision "1")) From patchwork Thu Dec 16 17:58:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35287 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 3E67627BBEA; Thu, 16 Dec 2021 18:01:15 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 0D2D627BBE9 for ; Thu, 16 Dec 2021 18:01:15 +0000 (GMT) Received: from localhost ([::1]:43932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv46-0000tm-3N for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 13:01:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv2y-0000LN-8l for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv2x-0008E9-Ve for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv2x-0006oR-Su for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 07/12] gnu: Add xsimd-benchmark. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757026037 (code B ref 52283); Thu, 16 Dec 2021 18:00:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:30 +0000 Received: from localhost ([127.0.0.1]:36706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2P-0006ln-Tc for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1o-0006ht-Gy for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:52 -0500 Received: from [2001:470:142:3::e] (port=44372 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1j-0007ty-6w; Thu, 16 Dec 2021 12:58:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=yMSFjWt0a17tktaO/Ghg6EPyWlrK/ME/DmoWyiVf4Zg=; b=ftIgDnawoPyjjRA2wX80 EwrAoX3nSq+kLGtYKV68alOc9F4yGmQ3bOpvE4dpUQKDvQ156TIxcfZKVZ8OxNc22yKua7PeGP4pZ l6XnjVLQbmExqRVGL4CrtcX8kLR4V6LAwdOQYm51Tlu1ySkDrFqoZXBUUIyDAaDgLcfjfC8JjCcEx oGy8S2hBQ5GX2d6MHC9+dr4u8LcKmOyN2R6ozH8n2EiMj3yt6Arfd3sHgTAveGh67cj/bievwNro5 KuoYSxDkGdw1AsYZqE9Q4oDheKCNo0gt7Ffqkit9ieTx9ZQob/ldytFaGXm1ON0HOzQHrqSEFuEQd JfX4JQKUnPXRsg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1j-0000YX-6I; Thu, 16 Dec 2021 12:58:47 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:22 +0100 Message-Id: <20211216175827.2077-8-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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/cpp.scm (xsmimd-benchmark): New variable. --- gnu/packages/cpp.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 718fb20652..da26a4e346 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -300,6 +300,29 @@ (define-public xsimd operating on batches.") (license license:bsd-3))) +(define-public xsmimd-benchmark + (package + (inherit xsimd) + (name "xsimd-benchmark") + (arguments + `(#:configure-flags (list "-DBUILD_BENCHMARK=ON") + #:tests? #f + #:phases (modify-phases %standard-phases + (add-after 'unpack 'remove-march=native + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("-march=native") "")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Install nothing but the executable. + (let ((out (assoc-ref outputs "out"))) + (install-file "benchmark/benchmark_xsimd" + (string-append out "/bin")))))))) + (synopsis "Benchmark of the xsimd library") + + ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor. + (properties '((tunable? . #t))))) + (define-public chaiscript (package (name "chaiscript") From patchwork Thu Dec 16 17:58:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35288 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 27C7D27BBEA; Thu, 16 Dec 2021 18:01:18 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 DEDF727BBE9 for ; Thu, 16 Dec 2021 18:01:17 +0000 (GMT) Received: from localhost ([::1]:44088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv49-0000zx-3d for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 13:01:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv2y-0000Ly-Jy for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv2y-0008EP-BC for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv2y-0006oY-AH for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 08/12] gnu: Add xtensor-benchmark. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757026046 (code B ref 52283); Thu, 16 Dec 2021 18:00:04 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:30 +0000 Received: from localhost ([127.0.0.1]:36708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2Q-0006lu-5e for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1p-0006i0-Ac for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:53 -0500 Received: from [2001:470:142:3::e] (port=44374 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1k-0007uC-10; Thu, 16 Dec 2021 12:58:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=IbTzhDpHN0QtO7GQyDgmET4uA6RPaTiu8j267LQhM5Y=; b=VNNGnlPdtxQHTqp2M671 6OCK6hcNU8YCrTtl5g2FeGY+N+A4XQq0Oazjk/YrCrFHQxT5LYPk4CJnL4kBV9Y1imQivL2F6gEaB Rn8hwsyN0uZZjtZxMydtUX3XAu/RUucnP/MxttrlrYOF3fm04cMry1eOl6Lb5pLvFTgm42rsF77Bu qe96iqJ6v3Y9fbS7msWFQRxLvvu371Xjv5WUHZzfkxRbPyMOSBhg1lERBPucRLGW+sKnbtil4w/iL tPQ1zb5DFPebK9rB3YGDNJIGJqzHnxZT1ymfDc1zYRwhlzBvCyHlhJGdK2CQcCkQvTXK7z9lOhzG0 ogzCvA7KGXIpZA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1j-0000YX-Pd; Thu, 16 Dec 2021 12:58:47 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:23 +0100 Message-Id: <20211216175827.2077-9-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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/algebra.scm (xtensor-benchmark): New variable. --- gnu/packages/algebra.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index e92ef4bf3f..c129e0f4e0 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1169,6 +1169,45 @@ (define-public xtensor @end itemize") (license license:bsd-3))) +(define-public xtensor-benchmark + (package + (inherit xtensor) + (name "xtensor-benchmark") + (arguments + `(#:configure-flags (list "-DBUILD_BENCHMARK=ON" + "-DDOWNLOAD_GBENCHMARK=OFF") + #:tests? #f + #:phases (modify-phases %standard-phases + (add-after 'unpack 'remove-march=native + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("-march=native") "")))) + (add-after 'unpack 'link-with-googlebenchmark + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("find_package\\(benchmark.*" all) + (string-append + all "\n" + "set(GBENCHMARK_LIBRARIES benchmark)\n"))))) + (replace 'build + (lambda _ + (invoke "make" "benchmark_xtensor" "-j" + (number->string (parallel-job-count))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Install nothing but the executable. + (let ((out (assoc-ref outputs "out"))) + (install-file "benchmark/benchmark_xtensor" + (string-append out "/bin")))))))) + (synopsis "Benchmarks of the xtensor library") + (native-inputs '()) + (inputs + (modify-inputs (package-native-inputs xtensor) + (prepend googlebenchmark xsimd))) + + ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor. + (properties '((tunable? . #t))))) + (define-public gap (package (name "gap") From patchwork Thu Dec 16 17:58:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35290 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 7876A27BBEA; Thu, 16 Dec 2021 18:03:27 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 49C0027BBE9 for ; Thu, 16 Dec 2021 18:03:27 +0000 (GMT) Received: from localhost ([::1]:49904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv6E-000533-GA for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 13:03:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv2z-0000NP-3d for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv2y-0008Eg-Pf for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv2y-0006of-OG for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 09/12] gnu: ceres-solver: Mark as tunable. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757026053 (code B ref 52283); Thu, 16 Dec 2021 18:00:04 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:30 +0000 Received: from localhost ([127.0.0.1]:36710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2Q-0006m3-GY for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1p-0006i7-W8 for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:54 -0500 Received: from [2001:470:142:3::e] (port=44376 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1k-0007uQ-M5; Thu, 16 Dec 2021 12:58:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=B/W211dW7rCm6lGJbZmiPoHJ/59ZvQYvGBzYbB2CDFs=; b=Q7lwcuErgp3aEwEgaVVs NcFjsVClGA6nUdzf9F4XflK0h+94Y9aPHC5q7Mcst7CguTJjESxc+W6f2a3kTZl1jDWPTWlBoqLGJ 9YaXP/zROcYlZ93ORuv24g2xvmeJo+MADOiOWlvnGibr7ZX4t+FV75DCzW88r1u0xj0Q+GX1qGMdu Bbkip7uqF6yv3uQXalwI6jn/pu8hMOztgIk6gdLX7HZklZORXM9prNv+Xzx0FNP6FhHJ7rFhgY3E2 404smzvp8za62rlcHXcqb3906yjPjBxz09tDu/94S52Ei/30AA0ZZa6gNUWfsVEDAOJxB5a/Gt4U+ heRq2aeZlpj3JA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1k-0000YX-Jz; Thu, 16 Dec 2021 12:58:48 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:24 +0100 Message-Id: <20211216175827.2077-10-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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/maths.scm (ceres)[properties]: New field. --- gnu/packages/maths.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 3bac086666..256b1c4421 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2411,7 +2411,10 @@ (define-public ceres @item non-linear least squares problems with bounds constraints; @item general unconstrained optimization problems. @end enumerate\n") - (license license:bsd-3))) + (license license:bsd-3) + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties `((tunable? . #t))))) ;; For a fully featured Octave, users are strongly recommended also to install ;; the following packages: less, ghostscript, gnuplot. From patchwork Thu Dec 16 17:58:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35289 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 190E927BBEA; Thu, 16 Dec 2021 18:01:26 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 C9CC527BBE9 for ; Thu, 16 Dec 2021 18:01:25 +0000 (GMT) Received: from localhost ([::1]:44824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv4G-0001cU-VP for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 13:01:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv2z-0000P7-KW for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv2z-0008En-7l for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv2z-0006op-4x for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 10/12] gnu: Add ceres-solver-benchmarks. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757126060 (code B ref 52283); Thu, 16 Dec 2021 18:00:05 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:31 +0000 Received: from localhost ([127.0.0.1]:36712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2Q-0006mA-PW for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1r-0006iQ-RZ for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:56 -0500 Received: from [2001:470:142:3::e] (port=44378 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1m-0007ui-IC; Thu, 16 Dec 2021 12:58:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=PNyHqzixGiqZL1t497RfTSgAB8s4ZvZXWuIcVJSLi0s=; b=BaMTjbz9nHHcPd97D4NP Ouen7lOcPBGlqgP58xbTaw8UeY9gSghr6/fCJ6BQSlpBehyB+cvdZQWQfBMBEPRIrtPyfiNfFU+9J XS0yXEnvOy137KpCmGs/5yWj7k9TD/mELPes37696fI9cgpXgMNfq0tr0JMEtWfhb4Kh63am7FMA4 Jc1/FDeJ9t0ZpX1sUkdJfPOe40LhS756OXwqNHKSILLFgJoa1GPKuIs0qCEUETQA3j0Op7yKuPnE6 e4jZXXkQgKTRbL25ixOs8uMPQ0Q7H9CoVDzrNZ+3M4zO+L/IeM52COH9KA05qbacsEz6dGg4/yV6Q hps6y2UrOBH9ng==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1l-0000YX-7F; Thu, 16 Dec 2021 12:58:50 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:25 +0100 Message-Id: <20211216175827.2077-11-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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/maths.scm (ceres-solver-benchmarks): New variable. --- gnu/packages/maths.scm | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 256b1c4421..7f2994d10b 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2416,6 +2416,49 @@ (define-public ceres ;; Mark as tunable to take advantage of SIMD code in Eigen. (properties `((tunable? . #t))))) +(define-public ceres-solver-benchmarks + (package + (inherit ceres) + (name "ceres-solver-benchmarks") + (arguments + '(#:modules ((ice-9 popen) + (ice-9 rdelim) + (guix build utils) + (guix build cmake-build-system)) + + #:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (define flags + (string-tokenize + (read-line (open-pipe* OPEN_READ + "pkg-config" "eigen3" + "--cflags")))) + + (define (compile-file file) + (let ((source (string-append file ".cc"))) + (format #t "building '~a'...~%" file) + (apply invoke "c++" "-fopenmp" "-O2" "-g" "-DNDEBUG" + source "-lceres" "-lbenchmark" "-lglog" + "-pthread" + "-o" (string-append bin "/" file) + "-I" ".." flags))) + + (mkdir-p bin) + (with-directory-excursion "internal/ceres" + (for-each compile-file + '("small_blas_gemm_benchmark" + "small_blas_gemv_benchmark" + "autodiff_cost_function_benchmark")))))) + (delete 'check) + (delete 'install)))) + (inputs (modify-inputs (package-inputs ceres) + (prepend googlebenchmark ceres))) + (synopsis "Benchmarks of the Ceres optimization problem solver"))) + ;; For a fully featured Octave, users are strongly recommended also to install ;; the following packages: less, ghostscript, gnuplot. (define-public octave-cli From patchwork Thu Dec 16 17:58:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35291 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 32A4027BBEA; Thu, 16 Dec 2021 18:03:34 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 EE80727BBE9 for ; Thu, 16 Dec 2021 18:03:33 +0000 (GMT) Received: from localhost ([::1]:50328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv6L-0005Jz-5m for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 13:03:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv2z-0000QR-U8 for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv2z-0008F5-K9 for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv2z-0006ow-K9 for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 11/12] gnu: libfive: Mark as tunable. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757126068 (code B ref 52283); Thu, 16 Dec 2021 18:00:05 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:31 +0000 Received: from localhost ([127.0.0.1]:36714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2R-0006mH-4U for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1t-0006ij-Pj for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:57 -0500 Received: from [2001:470:142:3::e] (port=44380 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1o-0007v9-Fc; Thu, 16 Dec 2021 12:58:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ha9K5tW7mbDgE/AeWFkG3tkTh0+53WG5lIHz2X9B7FM=; b=KXgeHNCwJvl9n6vr7RAx wjrpJIKgb7+U8+V0+DsTdHNPtkq6++gF8KdMk1AAnurIipuyPlKZWxyxikjNFw5c9bijs2Y/RqL2s zRqF7i1CCdBoic3Xjmzdcw+bMWoFa3DLLqRmDyHNpiLi7OU00l4wvFX+pUDErmKAdTY2pUZU7/6uy JNS33QrsNEe6g0F97At7oso1jfbT3vryZ9W/Q2dJI4FT+HmW7sJUzSoeHgb7q8hdX/I8Aabslv6A4 ubA9erIMcbFVI69OXXao6QaY66TB+2HVK1WKq+PsD9JYgD5mCHTO7CoCMK3ExmW9bJx9Pw4QlDxwA yl6i0XNlXA+OLQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1n-0000YX-4e; Thu, 16 Dec 2021 12:58:52 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:26 +0100 Message-Id: <20211216175827.2077-12-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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/engineering.scm (libfive)[properties]: New field. --- gnu/packages/engineering.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index edc0f51d8d..709b6d2864 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -829,7 +829,10 @@ (define-public libfive Even fundamental, primitive shapes are represented as code in the user-level language.") (license (list license:mpl2.0 ;library - license:gpl2+))))) ;Guile bindings and GUI + license:gpl2+)) ;Guile bindings and GUI + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties '((tunable? . #t)))))) (define-public inspekt3d (let ((commit "703f52ccbfedad2bf5240bf8183d1b573c9d54ef") From patchwork Thu Dec 16 17:58:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 35292 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 BF1CA27BBEA; Thu, 16 Dec 2021 18:03:43 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 854C627BBE9 for ; Thu, 16 Dec 2021 18:03:43 +0000 (GMT) Received: from localhost ([::1]:50754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv6U-0005bC-Om for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 13:03:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv31-0000WG-Cg for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv30-0008FH-1d for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv30-0006p4-1J for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 12/12] gnu: prusa-slicer: Mark as tunable. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757126075 (code B ref 52283); Thu, 16 Dec 2021 18:00:05 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:31 +0000 Received: from localhost ([127.0.0.1]:36716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2R-0006mO-EQ for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1u-0006io-CE for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:58 -0500 Received: from [2001:470:142:3::e] (port=44382 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1p-0007vP-2g; Thu, 16 Dec 2021 12:58:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Kt3Ts0RyVfB58IBBqLsj5KrIJ6RpBbr6wviibgKvjOo=; b=HVf1355bmgq8febnqzaP JSbfVTr11BzjViAmHfn6FlZKp2oLNmTz/9tHO+h+00aRfMbkFwtVrfQu/tSv9sA+0DJtZy2tZwW0l +kAnqH8I2jEL5EROJjqRDiYy8u0fCworOadSI05ZJPRZjSkfdL5VbdjgmGiz6IQiRoqGeHzdctzwj wLG5FEo/AU6YaMJ1jRDUGO1zpgGoawIyHDQSvC7LdyGupWHMeYGpJ9fg1gY776uU3usFJ6UUGJ/l2 IAIwnxSy4p6+WZMiG8fFGzsc/1mbQt2bZYJUkbvTE9IL8JcuR5WPhzzn7xREx2D6JCFKQ8KjEI45W iuKNfSELrENNtQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1p-0000YX-2P; Thu, 16 Dec 2021 12:58:53 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:27 +0100 Message-Id: <20211216175827.2077-13-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> 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/engineering.scm (prusa-slicer)[properties]: New field. --- gnu/packages/engineering.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 709b6d2864..fa82448736 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -3121,4 +3121,7 @@ (define-public prusa-slicer (synopsis "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)") (description "PrusaSlicer takes 3D models (STL, OBJ, AMF) and converts them into G-code instructions for FFF printers or PNG layers for mSLA 3D printers.") - (license license:agpl3))) + (license license:agpl3) + + ;; Mark as tunable to take advantage of SIMD code in Eigen and in libigl. + (properties '((tunable? . #t)))))