guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: gnu: faiss: Fix building on non-Intel architectures.


From: guix-commits
Subject: 01/02: gnu: faiss: Fix building on non-Intel architectures.
Date: Fri, 29 Mar 2019 10:08:24 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit 3776dc094cdcf3836501ac8c783092461e7f1e66
Author: Efraim Flashner <address@hidden>
Date:   Fri Mar 29 17:06:00 2019 +0300

    gnu: faiss: Fix building on non-Intel architectures.
    
    * gnu/packages/graph.scm (faiss)[source]: Add snippet to wrap Intel
    specific headers.
    [arguments]: Adjust custom 'prepare-build phase to adjust compile flags
    for different architectures.
---
 gnu/packages/graph.scm | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/graph.scm b/gnu/packages/graph.scm
index 2e8f7c1..216b481 100644
--- a/gnu/packages/graph.scm
+++ b/gnu/packages/graph.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <address@hidden>
 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <address@hidden>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <address@hidden>
+;;; Copyright © 2019 Efraim Flashner <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -256,7 +257,14 @@ subplots, multiple-axes, polar charts, and bubble charts. 
")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0pk15jfa775cy2pqmzq62nhd6zfjxmpvz5h731197c28aq3zw39w"))))
+                "0pk15jfa775cy2pqmzq62nhd6zfjxmpvz5h731197c28aq3zw39w"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (substitute* "utils.cpp"
+                    (("#include <immintrin.h>")
+                     "#ifdef __SSE__\n#include <immintrin.h>\n#endif"))
+                  #t))))
     (build-system cmake-build-system)
     (arguments
      `(#:configure-flags
@@ -270,12 +278,14 @@ subplots, multiple-axes, polar charts, and bubble charts. 
")
                                                        (%current-system))))
                                        (cond
                                         ((string-prefix? "x86_64" system)
-                                         '("-mavx" "-msse2"))
+                                         '("-mavx" "-msse2" "-mpopcnt"))
                                         ((string-prefix? "i686" system)
-                                         '("-msse2"))
+                                         '("-msse2" "-mpopcnt"))
                                         (else
                                          '()))))))
                (substitute* "CMakeLists.txt"
+                 (("-m64") "")
+                 (("-mpopcnt") "") ; only some architectures
                  (("-msse4")
                   (string-append
                    (string-join features)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]