From 5ad79dc4bb22326e5a98db7bf2b69a76a2e6f01e Mon Sep 17 00:00:00 2001 From: volth Date: Sun, 21 Apr 2019 17:06:50 +0000 Subject: compilation for particular x86_64 architecture --- pkgs/applications/science/math/nauty/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'pkgs/applications/science/math/nauty/default.nix') diff --git a/pkgs/applications/science/math/nauty/default.nix b/pkgs/applications/science/math/nauty/default.nix index 7351de53cfc..226e13c004d 100644 --- a/pkgs/applications/science/math/nauty/default.nix +++ b/pkgs/applications/science/math/nauty/default.nix @@ -1,7 +1,6 @@ { stdenv , lib , fetchurl -, optimize ? false # impure }: stdenv.mkDerivation rec { name = "nauty-${version}"; @@ -11,13 +10,15 @@ stdenv.mkDerivation rec { sha256 = "05z6mk7c31j70md83396cdjmvzzip1hqb88pfszzc6k4gy8h3m2y"; }; outputs = [ "out" "dev" ]; - configureFlags = lib.optionals (!optimize) [ + configureFlags = { # Prevent nauty from sniffing some cpu features. While those are very # widely available, it can lead to nasty bugs when they are not available: # https://groups.google.com/forum/#!topic/sage-packaging/Pe4SRDNYlhA - "--disable-popcnt" - "--disable-clz" - ]; + "default" = [ "--disable-clz" "--disable-popcnt" ]; + "westmere" = [ "--disable-clz" ]; + "sandybridge" = [ "--disable-clz" ]; + "ivybridge" = [ "--disable-clz" ]; + }.${stdenv.hostPlatform.platform.gcc.arch or "default"} or []; buildInputs = []; installPhase = '' mkdir -p "$out"/{bin,share/doc/nauty} "$dev"/{lib,include/nauty} -- cgit 1.4.1