From 3776dc094cdcf3836501ac8c783092461e7f1e66 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Fri, 29 Mar 2019 17:06:00 +0300 Subject: 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(-) (limited to 'gnu/packages/graph.scm') diff --git a/gnu/packages/graph.scm b/gnu/packages/graph.scm index 2e8f7c1331..216b48195d 100644 --- a/gnu/packages/graph.scm +++ b/gnu/packages/graph.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus ;;; Copyright © 2018 Joshua Sierles, Nextjournal ;;; Copyright © 2018 Tobias Geerinckx-Rice +;;; Copyright © 2019 Efraim Flashner ;;; ;;; 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 ") + "#ifdef __SSE__\n#include \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) -- cgit v1.2.3