From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gejEY-0004KB-Vj for guix-patches@gnu.org; Wed, 02 Jan 2019 11:19:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gejEU-0006hX-Uc for guix-patches@gnu.org; Wed, 02 Jan 2019 11:19:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:44841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gejEU-0006h3-OM for guix-patches@gnu.org; Wed, 02 Jan 2019 11:19:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gejEU-0002A1-IS for guix-patches@gnu.org; Wed, 02 Jan 2019 11:19:02 -0500 Subject: [bug#33952] [PATCH 01/14] gnu: Add gemmlowp-for-tensorflow. References: In-Reply-To: Resent-Message-ID: From: Ricardo Wurmus Date: Wed, 2 Jan 2019 17:17:54 +0100 Message-ID: <20190102161807.28297-1-ricardo.wurmus@mdc-berlin.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33952@debbugs.gnu.org Cc: Ricardo Wurmus * gnu/packages/machine-learning.scm (gemmlowp-for-tensorflow): New variable. --- gnu/packages/machine-learning.scm | 60 ++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 084e62cca..f4e66b9a3 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -58,7 +58,8 @@ #:use-module (gnu packages statistics) #:use-module (gnu packages swig) #:use-module (gnu packages xml) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:use-module (ice-9 match)) (define-public fann ;; The last release is >100 commits behind, so we package from git. @@ -621,6 +622,63 @@ Support Vector Machines, Spectral Clustering, Kernel PCA, Gaussian Processes and a QP solver.") (license license:gpl2))) +(define-public gemmlowp-for-tensorflow + ;; The commit hash is taken from "tensorflow/workspace.bzl". + (let ((commit "38ebac7b059e84692f53e5938f97a9943c120d98") + (revision "2")) + (package + (name "gemmlowp") + (version (git-version "0" revision commit)) + (source (origin + (method url-fetch) + (uri (string-append "https://mirror.bazel.build/" + "github.com/google/gemmlowp/archive/" + commit ".zip")) + (file-name (string-append "gemmlowp-" version ".zip")) + (sha256 + (base32 + "0n56s2g8hrssm4w8qj1v58gfm56a04n9v992ixkmvk6zjiralzxq")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (list ,@(match (%current-system) + ((or "x86_64-linux" "i686-linux") + '("-DCMAKE_CXX_FLAGS=-msse4.1")) + (_ '()))) + #:phases + (modify-phases %standard-phases + ;; This directory contains the CMakeLists.txt. + (add-after 'unpack 'chdir + (lambda _ (chdir "contrib") #t)) + ;; There is no install target + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib/")) + (inc (string-append out "/include/"))) + (install-file "../build/libeight_bit_int_gemm.so" lib) + (for-each (lambda (dir) + (let ((target (string-append inc "/" dir))) + (mkdir-p target) + (for-each (lambda (h) + (install-file h target)) + (find-files (string-append "../" dir) + "\\.h$")))) + '("meta" "profiling" "public" "fixedpoint" + "eight_bit_int_gemm" "internal")) + #t)))))) + (native-inputs + `(("unzip" ,unzip))) + (home-page "https://github.com/google/gemmlowp") + (synopsis "Small self-contained low-precision GEMM library") + (description + "This is a small self-contained low-precision @dfn{general matrix +multiplication} (GEMM) library. It is not a full linear algebra library. +Low-precision means that the input and output matrix entries are integers on +at most 8 bits. To avoid overflow, results are internally accumulated on more +than 8 bits, and at the end only some significant 8 bits are kept.") + (license license:asl2.0)))) + (define-public dlib (package (name "dlib") -- 2.19.1