Merge pull request #61019 from volth/gcc.arch-amd

platform.gcc.arch: support for AMD CPUs

authored by John Ericson and committed by GitHub 1965a241 54eacc77

+168 -95
+77
lib/systems/architectures.nix
···
··· 1 + { lib }: 2 + 3 + rec { 4 + # platform.gcc.arch to its features (as in /proc/cpuinfo) 5 + features = { 6 + default = [ ]; 7 + # x86_64 Intel 8 + westmere = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" ]; 9 + sandybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ]; 10 + ivybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ]; 11 + haswell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ]; 12 + broadwell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ]; 13 + skylake = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ]; 14 + skylake-avx512 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "avx512" "fma" ]; 15 + # x86_64 AMD 16 + btver1 = [ "sse3" "ssse3" "sse4_1" "sse4_2" ]; 17 + btver2 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ]; 18 + bdver1 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "fma" "fma4" ]; 19 + bdver2 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "fma" "fma4" ]; 20 + bdver3 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "fma" "fma4" ]; 21 + bdver4 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "avx2" "fma" "fma4" ]; 22 + znver1 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "avx2" "fma" ]; 23 + znver2 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "avx2" "fma" ]; 24 + # other 25 + armv5te = [ ]; 26 + armv6 = [ ]; 27 + armv7-a = [ ]; 28 + armv8-a = [ ]; 29 + mips32 = [ ]; 30 + loongson2f = [ ]; 31 + }; 32 + 33 + # a superior CPU has all the features of an inferior and is able to build and test code for it 34 + inferiors = { 35 + # x86_64 Intel 36 + default = [ ]; 37 + westmere = [ ]; 38 + sandybridge = [ "westmere" ] ++ inferiors.westmere; 39 + ivybridge = [ "sandybridge" ] ++ inferiors.sandybridge; 40 + haswell = [ "ivybridge" ] ++ inferiors.ivybridge; 41 + broadwell = [ "haswell" ] ++ inferiors.haswell; 42 + skylake = [ "broadwell" ] ++ inferiors.broadwell; 43 + skylake-avx512 = [ "skylake" ] ++ inferiors.skylake; 44 + # x86_64 AMD 45 + btver1 = [ ]; 46 + btver2 = [ ]; # TODO: fill this (need testing) 47 + bdver1 = [ ]; # TODO: fill this (need testing) 48 + bdver2 = [ ]; # TODO: fill this (need testing) 49 + bdver3 = [ ]; # TODO: fill this (need testing) 50 + bdver4 = [ ]; # TODO: fill this (need testing) 51 + znver1 = [ ]; # TODO: fill this (need testing) 52 + znver2 = [ ]; # TODO: fill this (need testing) 53 + # other 54 + armv5te = [ ]; 55 + armv6 = [ ]; 56 + armv7-a = [ ]; 57 + armv8-a = [ ]; 58 + mips32 = [ ]; 59 + loongson2f = [ ]; 60 + }; 61 + 62 + predicates = let 63 + featureSupport = feature: x: builtins.elem feature features.${x}; 64 + in { 65 + sse3Support = featureSupport "sse3"; 66 + ssse3Support = featureSupport "ssse3"; 67 + sse4_1Support = featureSupport "sse4_1"; 68 + sse4_2Support = featureSupport "sse4_2"; 69 + sse4_aSupport = featureSupport "sse4a"; 70 + avxSupport = featureSupport "avx"; 71 + avx2Support = featureSupport "avx2"; 72 + avx512Support = featureSupport "avx512"; 73 + aesSupport = featureSupport "aes"; 74 + fmaSupport = featureSupport "fma"; 75 + fma4Support = featureSupport "fma4"; 76 + }; 77 + }
+2
lib/systems/default.nix
··· 7 inspect = import ./inspect.nix { inherit lib; }; 8 platforms = import ./platforms.nix { inherit lib; }; 9 examples = import ./examples.nix { inherit lib; }; 10 11 # Elaborate a `localSystem` or `crossSystem` so that it contains everything 12 # necessary. ··· 126 else throw "Don't know how to run ${final.config} executables."; 127 128 } // mapAttrs (n: v: v final.parsed) inspect.predicates 129 // args; 130 in assert final.useAndroidPrebuilt -> final.isAndroid; 131 assert lib.foldl
··· 7 inspect = import ./inspect.nix { inherit lib; }; 8 platforms = import ./platforms.nix { inherit lib; }; 9 examples = import ./examples.nix { inherit lib; }; 10 + architectures = import ./architectures.nix { inherit lib; }; 11 12 # Elaborate a `localSystem` or `crossSystem` so that it contains everything 13 # necessary. ··· 127 else throw "Don't know how to run ${final.config} executables."; 128 129 } // mapAttrs (n: v: v final.parsed) inspect.predicates 130 + // mapAttrs (n: v: v final.platform.gcc.arch or "default") architectures.predicates 131 // args; 132 in assert final.useAndroidPrebuilt -> final.isAndroid; 133 assert lib.foldl
+4 -10
nixos/modules/services/misc/nix-daemon.nix
··· 587 588 nix.systemFeatures = mkDefault ( 589 [ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++ 590 - optionals (pkgs.stdenv.isx86_64 && pkgs.hostPlatform.platform ? gcc.arch) ( 591 - # a x86_64 builder can run code for `platform.gcc.arch` and minor architectures: 592 - [ "gccarch-${pkgs.hostPlatform.platform.gcc.arch}" ] ++ { 593 - sandybridge = [ "gccarch-westmere" ]; 594 - ivybridge = [ "gccarch-westmere" "gccarch-sandybridge" ]; 595 - haswell = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" ]; 596 - broadwell = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" ]; 597 - skylake = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" "gccarch-broadwell" ]; 598 - skylake-avx512 = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" "gccarch-broadwell" "gccarch-skylake" ]; 599 - }.${pkgs.hostPlatform.platform.gcc.arch} or [] 600 ) 601 ); 602
··· 587 588 nix.systemFeatures = mkDefault ( 589 [ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++ 590 + optionals (pkgs.hostPlatform.platform ? gcc.arch) ( 591 + # a builder can run code for `platform.gcc.arch` and inferior architectures 592 + [ "gccarch-${pkgs.hostPlatform.platform.gcc.arch}" ] ++ 593 + map (x: "gccarch-${x}") lib.systems.architectures.inferiors.${pkgs.hostPlatform.platform.gcc.arch} 594 ) 595 ); 596
+4 -6
pkgs/applications/science/math/nauty/default.nix
··· 10 sha256 = "1nym0p2djws8ylkpr0kgpxfa6fxdlh46cmvz0gn5vd02jzgs0aww"; 11 }; 12 outputs = [ "out" "dev" ]; 13 - configureFlags = { 14 # Prevent nauty from sniffing some cpu features. While those are very 15 # widely available, it can lead to nasty bugs when they are not available: 16 # https://groups.google.com/forum/#!topic/sage-packaging/Pe4SRDNYlhA 17 - default = [ "--disable-clz" "--disable-popcnt" ]; 18 - westmere = [ "--disable-clz" ]; 19 - sandybridge = [ "--disable-clz" ]; 20 - ivybridge = [ "--disable-clz" ]; 21 - }.${stdenv.hostPlatform.platform.gcc.arch or "default"} or []; 22 installPhase = '' 23 mkdir -p "$out"/{bin,share/doc/nauty} "$dev"/{lib,include/nauty} 24
··· 10 sha256 = "1nym0p2djws8ylkpr0kgpxfa6fxdlh46cmvz0gn5vd02jzgs0aww"; 11 }; 12 outputs = [ "out" "dev" ]; 13 + configureFlags = [ 14 # Prevent nauty from sniffing some cpu features. While those are very 15 # widely available, it can lead to nasty bugs when they are not available: 16 # https://groups.google.com/forum/#!topic/sage-packaging/Pe4SRDNYlhA 17 + "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-popcnt" 18 + "--${if stdenv.hostPlatform.sse4_aSupport then "enable" else "disable"}-clz" 19 + ]; 20 installPhase = '' 21 mkdir -p "$out"/{bin,share/doc/nauty} "$dev"/{lib,include/nauty} 22
+10 -2
pkgs/build-support/cc-wrapper/default.nix
··· 64 # older compilers (for example bootstrap's GCC 5) fail with -march=too-modern-cpu 65 isGccArchSupported = arch: 66 if isGNU then 67 - { skylake = versionAtLeast ccVersion "6.0"; 68 skylake-avx512 = versionAtLeast ccVersion "6.0"; 69 cannonlake = versionAtLeast ccVersion "8.0"; 70 icelake-client = versionAtLeast ccVersion "8.0"; 71 icelake-server = versionAtLeast ccVersion "8.0"; 72 knm = versionAtLeast ccVersion "8.0"; 73 }.${arch} or true 74 else if isClang then 75 - { cannonlake = versionAtLeast ccVersion "5.0"; 76 icelake-client = versionAtLeast ccVersion "7.0"; 77 icelake-server = versionAtLeast ccVersion "7.0"; 78 knm = versionAtLeast ccVersion "7.0"; 79 }.${arch} or true 80 else 81 false;
··· 64 # older compilers (for example bootstrap's GCC 5) fail with -march=too-modern-cpu 65 isGccArchSupported = arch: 66 if isGNU then 67 + { # Intel 68 + skylake = versionAtLeast ccVersion "6.0"; 69 skylake-avx512 = versionAtLeast ccVersion "6.0"; 70 cannonlake = versionAtLeast ccVersion "8.0"; 71 icelake-client = versionAtLeast ccVersion "8.0"; 72 icelake-server = versionAtLeast ccVersion "8.0"; 73 knm = versionAtLeast ccVersion "8.0"; 74 + # AMD 75 + znver1 = versionAtLeast ccVersion "6.0"; 76 + znver2 = versionAtLeast ccVersion "9.0"; 77 }.${arch} or true 78 else if isClang then 79 + { # Intel 80 + cannonlake = versionAtLeast ccVersion "5.0"; 81 icelake-client = versionAtLeast ccVersion "7.0"; 82 icelake-server = versionAtLeast ccVersion "7.0"; 83 knm = versionAtLeast ccVersion "7.0"; 84 + # AMD 85 + znver1 = versionAtLeast ccVersion "4.0"; 86 + znver2 = versionAtLeast ccVersion "9.0"; 87 }.${arch} or true 88 else 89 false;
+1 -1
pkgs/development/interpreters/j/default.nix
··· 1 { stdenv, fetchFromGitHub, readline, libedit, bc 2 - , avxSupport ? false 3 }: 4 5 stdenv.mkDerivation rec {
··· 1 { stdenv, fetchFromGitHub, readline, libedit, bc 2 + , avxSupport ? stdenv.hostPlatform.avxSupport 3 }: 4 5 stdenv.mkDerivation rec {
+2 -2
pkgs/development/libraries/dlib/default.nix
··· 2 , guiSupport ? false, libX11 3 4 # see http://dlib.net/compile.html 5 - , avxSupport ? true 6 , cudaSupport ? true 7 }: 8 ··· 21 rm -rf dlib/external 22 ''; 23 24 - cmakeFlags = [ 25 "-DUSE_DLIB_USE_CUDA=${if cudaSupport then "1" else "0"}" 26 "-DUSE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}" ]; 27
··· 2 , guiSupport ? false, libX11 3 4 # see http://dlib.net/compile.html 5 + , avxSupport ? stdenv.hostPlatform.avxSupport 6 , cudaSupport ? true 7 }: 8 ··· 21 rm -rf dlib/external 22 ''; 23 24 + cmakeFlags = [ 25 "-DUSE_DLIB_USE_CUDA=${if cudaSupport then "1" else "0"}" 26 "-DUSE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}" ]; 27
+13 -11
pkgs/development/libraries/fflas-ffpack/default.nix
··· 31 configureFlags = [ 32 "--with-blas-libs=-lcblas" 33 "--with-lapack-libs=-llapacke" 34 - ] ++ stdenv.lib.optionals stdenv.isx86_64 { 35 # disable SIMD instructions (which are enabled *when available* by default) 36 # for now we need to be careful to disable *all* relevant versions of an instruction set explicitly (https://github.com/linbox-team/fflas-ffpack/issues/284) 37 - default = [ "--disable-sse3" "--disable-ssse3" "--disable-sse41" "--disable-sse42" "--disable-avx" "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ]; 38 - westmere = [ "--disable-avx" "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ]; 39 - sandybridge = [ "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ]; 40 - ivybridge = [ "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ]; 41 - haswell = [ "--disable-fma4" ]; 42 - broadwell = [ "--disable-fma4" ]; 43 - skylake = [ "--disable-fma4" ]; 44 - skylake-avx512 = [ "--disable-fma4" ]; 45 - }.${stdenv.hostPlatform.platform.gcc.arch or "default"}; 46 - 47 doCheck = true; 48 49 meta = with stdenv.lib; {
··· 31 configureFlags = [ 32 "--with-blas-libs=-lcblas" 33 "--with-lapack-libs=-llapacke" 34 + ] ++ stdenv.lib.optionals stdenv.isx86_64 [ 35 # disable SIMD instructions (which are enabled *when available* by default) 36 # for now we need to be careful to disable *all* relevant versions of an instruction set explicitly (https://github.com/linbox-team/fflas-ffpack/issues/284) 37 + "--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3" 38 + "--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3" 39 + "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41" 40 + "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42" 41 + "--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx" 42 + "--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2" 43 + "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512f" 44 + "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512dq" 45 + "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512vl" 46 + "--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma" 47 + "--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4" 48 + ]; 49 doCheck = true; 50 51 meta = with stdenv.lib; {
+7 -10
pkgs/development/libraries/g2o/default.nix
··· 27 # Detection script is broken 28 "-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer" 29 "-DG2O_BUILD_EXAMPLES=OFF" 30 - ] ++ lib.optionals stdenv.isx86_64 ([ "-DDO_SSE_AUTODETECT=OFF" ] ++ { 31 - default = [ "-DDISABLE_SSE3=ON" "-DDISABLE_SSE4_1=ON" "-DDISABLE_SSE4_2=ON" "-DDISABLE_SSE4_A=ON" ]; 32 - westmere = [ "-DDISABLE_SSE4_A=ON" ]; 33 - sandybridge = [ "-DDISABLE_SSE4_A=ON" ]; 34 - ivybridge = [ "-DDISABLE_SSE4_A=ON" ]; 35 - haswell = [ "-DDISABLE_SSE4_A=ON" ]; 36 - broadwell = [ "-DDISABLE_SSE4_A=ON" ]; 37 - skylake = [ "-DDISABLE_SSE4_A=ON" ]; 38 - skylake-avx512 = [ "-DDISABLE_SSE4_A=ON" ]; 39 - }.${stdenv.hostPlatform.platform.gcc.arch or "default"}); 40 41 meta = with lib; { 42 description = "A General Framework for Graph Optimization";
··· 27 # Detection script is broken 28 "-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer" 29 "-DG2O_BUILD_EXAMPLES=OFF" 30 + ] ++ lib.optionals stdenv.isx86_64 [ 31 + "-DDO_SSE_AUTODETECT=OFF" 32 + "-DDISABLE_SSE3=${ if stdenv.hostPlatform.sse3Support then "OFF" else "ON"}" 33 + "-DDISABLE_SSE4_1=${if stdenv.hostPlatform.sse4_1Support then "OFF" else "ON"}" 34 + "-DDISABLE_SSE4_2=${if stdenv.hostPlatform.sse4_2Support then "OFF" else "ON"}" 35 + "-DDISABLE_SSE4_A=${if stdenv.hostPlatform.sse4_aSupport then "OFF" else "ON"}" 36 + ]; 37 38 meta = with lib; { 39 description = "A General Framework for Graph Optimization";
+10 -10
pkgs/development/libraries/givaro/default.nix
··· 17 18 configureFlags = [ 19 "--disable-optimization" 20 - ] ++ stdenv.lib.optionals stdenv.isx86_64 { 21 # disable SIMD instructions (which are enabled *when available* by default) 22 - default = [ "--disable-sse3" "--disable-ssse3" "--disable-sse41" "--disable-sse42" "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ]; 23 - westmere = [ "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ]; 24 - sandybridge = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ]; 25 - ivybridge = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ]; 26 - haswell = [ "--disable-fma4" ]; 27 - broadwell = [ "--disable-fma4" ]; 28 - skylake = [ "--disable-fma4" ]; 29 - skylake-avx512 = [ "--disable-fma4" ]; 30 - }.${stdenv.hostPlatform.platform.gcc.arch or "default"}; 31 32 # On darwin, tests are linked to dylib in the nix store, so we need to make 33 # sure tests run after installPhase.
··· 17 18 configureFlags = [ 19 "--disable-optimization" 20 + ] ++ stdenv.lib.optionals stdenv.isx86_64 [ 21 # disable SIMD instructions (which are enabled *when available* by default) 22 + "--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3" 23 + "--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3" 24 + "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41" 25 + "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42" 26 + "--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx" 27 + "--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2" 28 + "--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma" 29 + "--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4" 30 + ]; 31 32 # On darwin, tests are linked to dylib in the nix store, so we need to make 33 # sure tests run after installPhase.
+10 -11
pkgs/development/libraries/linbox/default.nix
··· 39 configureFlags = [ 40 "--with-blas-libs=-lblas" 41 "--disable-optimization" 42 - ] ++ stdenv.lib.optionals stdenv.isx86_64 { 43 # disable SIMD instructions (which are enabled *when available* by default) 44 - default = [ "--disable-sse3" "--disable-ssse3" "--disable-sse41" "--disable-sse42" "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ]; 45 - westmere = [ "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ]; 46 - sandybridge = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ]; 47 - ivybridge = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ]; 48 - haswell = [ "--disable-fma4" ]; 49 - broadwell = [ "--disable-fma4" ]; 50 - skylake = [ "--disable-fma4" ]; 51 - skylake-avx512 = [ "--disable-fma4" ]; 52 - }.${stdenv.hostPlatform.platform.gcc.arch or "default"} 53 - ++ stdenv.lib.optionals withSage [ 54 "--enable-sage" 55 ]; 56
··· 39 configureFlags = [ 40 "--with-blas-libs=-lblas" 41 "--disable-optimization" 42 + ] ++ stdenv.lib.optionals stdenv.isx86_64 [ 43 # disable SIMD instructions (which are enabled *when available* by default) 44 + "--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3" 45 + "--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3" 46 + "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41" 47 + "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42" 48 + "--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx" 49 + "--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2" 50 + "--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma" 51 + "--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4" 52 + ] ++ stdenv.lib.optionals withSage [ 53 "--enable-sage" 54 ]; 55
+12 -12
pkgs/development/libraries/qt-5/modules/qtbase.nix
··· 255 "-no-warnings-are-errors" 256 ] 257 ++ ( 258 - if (!stdenv.hostPlatform.isx86_64) 259 - then [ "-no-sse2" ] 260 - else lib.optionals (compareVersion "5.9.0" >= 0) { 261 - default = [ "-sse2" "-no-sse3" "-no-ssse3" "-no-sse4.1" "-no-sse4.2" "-no-avx" "-no-avx2" ]; 262 - westmere = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-no-avx" "-no-avx2" ]; 263 - sandybridge = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ]; 264 - ivybridge = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ]; 265 - haswell = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ]; 266 - broadwell = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ]; 267 - skylake = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ]; 268 - skylake-avx512 = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ]; 269 - }.${stdenv.hostPlatform.platform.gcc.arch or "default"} 270 ) 271 ++ [ 272 "-no-mips_dsp"
··· 255 "-no-warnings-are-errors" 256 ] 257 ++ ( 258 + if (!stdenv.hostPlatform.isx86_64) then [ 259 + "-no-sse2" 260 + ] else if (compareVersion "5.9.0" >= 0) then [ 261 + "-sse2" 262 + "${if stdenv.hostPlatform.sse3Support then "" else "-no"}-sse3" 263 + "${if stdenv.hostPlatform.ssse3Support then "" else "-no"}-ssse3" 264 + "${if stdenv.hostPlatform.sse4_1Support then "" else "-no"}-sse4.1" 265 + "${if stdenv.hostPlatform.sse4_2Support then "" else "-no"}-sse4.2" 266 + "${if stdenv.hostPlatform.avxSupport then "" else "-no"}-avx" 267 + "${if stdenv.hostPlatform.avx2Support then "" else "-no"}-avx2" 268 + ] else [ 269 + ] 270 ) 271 ++ [ 272 "-no-mips_dsp"
+3 -1
pkgs/development/python-modules/dlib/default.nix
··· 1 - { buildPythonPackage, dlib, python, pytest, more-itertools, avxSupport ? true, lib }: 2 3 buildPythonPackage { 4 inherit (dlib) name src nativeBuildInputs buildInputs meta;
··· 1 + { buildPythonPackage, stdenv, lib, dlib, python, pytest, more-itertools 2 + , avxSupport ? stdenv.hostPlatform.avxSupport 3 + }: 4 5 buildPythonPackage { 6 inherit (dlib) name src nativeBuildInputs buildInputs meta;
+3 -3
pkgs/development/python-modules/tensorflow/1/default.nix
··· 23 , xlaSupport ? cudaSupport 24 # Default from ./configure script 25 , cudaCapabilities ? [ "3.5" "5.2" ] 26 - , sse42Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") ["westmere" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512"] 27 - , avx2Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] 28 - , fmaSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] 29 # Darwin deps 30 , Foundation, Security 31 }:
··· 23 , xlaSupport ? cudaSupport 24 # Default from ./configure script 25 , cudaCapabilities ? [ "3.5" "5.2" ] 26 + , sse42Support ? stdenv.hostPlatform.sse4_2Support 27 + , avx2Support ? stdenv.hostPlatform.avx2Support 28 + , fmaSupport ? stdenv.hostPlatform.fmaSupport 29 # Darwin deps 30 , Foundation, Security 31 }:
+3 -3
pkgs/development/python-modules/tensorflow/2/default.nix
··· 23 , xlaSupport ? cudaSupport 24 # Default from ./configure script 25 , cudaCapabilities ? [ "3.5" "5.2" ] 26 - , sse42Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") ["westmere" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512"] 27 - , avx2Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] 28 - , fmaSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] 29 # Darwin deps 30 , Foundation, Security 31 }:
··· 23 , xlaSupport ? cudaSupport 24 # Default from ./configure script 25 , cudaCapabilities ? [ "3.5" "5.2" ] 26 + , sse42Support ? stdenv.hostPlatform.sse4_2Support 27 + , avx2Support ? stdenv.hostPlatform.avx2Support 28 + , fmaSupport ? stdenv.hostPlatform.fmaSupport 29 # Darwin deps 30 , Foundation, Security 31 }:
+3 -9
pkgs/servers/nosql/arangodb/default.nix
··· 32 # do not set GCC's -march=xxx based on builder's /proc/cpuinfo 33 "-DUSE_OPTIMIZE_FOR_ARCHITECTURE=OFF" 34 # also avoid using builder's /proc/cpuinfo 35 - ] ++ 36 - { westmere = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ]; 37 - sandybridge = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ]; 38 - ivybridge = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ]; 39 - haswell = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ]; 40 - broadwell = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ]; 41 - skylake = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ]; 42 - skylake-avx512 = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ]; 43 - }.${stdenv.hostPlatform.platform.gcc.arch or ""} or [ "-DHAVE_SSE42=OFF" "-DASM_OPTIMIZATIONS=OFF" ]; 44 45 enableParallelBuilding = true; 46
··· 32 # do not set GCC's -march=xxx based on builder's /proc/cpuinfo 33 "-DUSE_OPTIMIZE_FOR_ARCHITECTURE=OFF" 34 # also avoid using builder's /proc/cpuinfo 35 + "-DHAVE_SSE42=${if stdenv.hostPlatform.sse4_2Support then "ON" else "OFF"}" 36 + "-DASM_OPTIMIZATIONS=${if stdenv.hostPlatform.sse4_2Support then "ON" else "OFF"}" 37 + ]; 38 39 enableParallelBuilding = true; 40
+2 -2
pkgs/tools/misc/cpuminer-multi/default.nix
··· 1 { stdenv, fetchgit, curl, jansson, autoconf, automake 2 - , aesni ? true }: 3 4 let 5 rev = "8393e03089c0abde61bd5d72aba8f926c3d6eca4"; ··· 28 license = licenses.gpl2; 29 maintainers = [ maintainers.ehmry ]; 30 # does not build on i686 https://github.com/lucasjones/cpuminer-multi/issues/27 31 - platforms = [ "x86_64-linux" ]; 32 }; 33 }
··· 1 { stdenv, fetchgit, curl, jansson, autoconf, automake 2 + , aesni ? stdenv.hostPlatform.aesSupport }: 3 4 let 5 rev = "8393e03089c0abde61bd5d72aba8f926c3d6eca4"; ··· 28 license = licenses.gpl2; 29 maintainers = [ maintainers.ehmry ]; 30 # does not build on i686 https://github.com/lucasjones/cpuminer-multi/issues/27 31 + platforms = [ "x86_64-linux" ]; 32 }; 33 }
+2 -2
pkgs/tools/networking/i2pd/default.nix
··· 1 { stdenv, fetchFromGitHub 2 , boost, zlib, openssl 3 , upnpSupport ? true, miniupnpc ? null 4 - , aesniSupport ? false 5 - , avxSupport ? false 6 }: 7 8 assert upnpSupport -> miniupnpc != null;
··· 1 { stdenv, fetchFromGitHub 2 , boost, zlib, openssl 3 , upnpSupport ? true, miniupnpc ? null 4 + , aesniSupport ? stdenv.hostPlatform.aesSupport 5 + , avxSupport ? stdenv.hostPlatform.avxSupport 6 }: 7 8 assert upnpSupport -> miniupnpc != null;