3
0
Fork 0
forked from mirrors/nixpkgs

gcc.arch: refactor, move tables under lib/

This commit is contained in:
volth 2020-08-05 02:32:41 +00:00
parent 463db72e63
commit cf7b63df5b
18 changed files with 154 additions and 128 deletions

View file

@ -0,0 +1,75 @@
{ lib }:
rec {
# platform.gcc.arch to its features (as in /proc/cpuinfo)
features = {
default = [ ];
# x86_64 Intel
westmere = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" ];
sandybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ];
ivybridge = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ];
haswell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ];
broadwell = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ];
skylake = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "fma" ];
skylake-avx512 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" "avx2" "avx512" "fma" ];
# x86_64 AMD
btver1 = [ "sse3" "ssse3" "sse4_1" "sse4_2" ];
btver2 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "aes" "avx" ];
bdver1 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "fma" "fma4" ];
bdver2 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "fma" "fma4" ];
bdver3 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "fma" "fma4" ];
bdver4 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "avx2" "fma" "fma4" ];
znver1 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "avx2" "fma" ];
znver2 = [ "sse3" "ssse3" "sse4_1" "sse4_2" "sse4a" "aes" "avx" "avx2" "fma" ];
# other
armv5te = [ ];
armv6 = [ ];
armv7-a = [ ];
armv8-a = [ ];
mips32 = [ ];
loongson2f = [ ];
};
# a superior CPU has all the features of an inferior and is able to build and test code for it
inferiors = {
# x86_64 Intel
default = [ ];
westmere = [ ];
sandybridge = [ "westmere" ];
ivybridge = [ "westmere" "sandybridge" ];
haswell = [ "westmere" "sandybridge" "ivybridge" ];
broadwell = [ "westmere" "sandybridge" "ivybridge" "haswell" ];
skylake = [ "westmere" "sandybridge" "ivybridge" "haswell" "broadwell" ];
skylake-avx512 = [ "westmere" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" ];
# x86_64 AMD
btver1 = [ ];
btver2 = [ ];
bdver1 = [ ];
bdver2 = [ ];
bdver3 = [ ];
bdver4 = [ ];
znver1 = [ ];
znver2 = [ ];
# other
armv5te = [ ];
armv6 = [ ];
armv7-a = [ ];
armv8-a = [ ];
mips32 = [ ];
loongson2f = [ ];
};
predicates = {
sse3Support = x: builtins.elem "sse3" features.${x};
ssse3Support = x: builtins.elem "ssse3" features.${x};
sse4_1Support = x: builtins.elem "sse4_1" features.${x};
sse4_2Support = x: builtins.elem "sse4_2" features.${x};
sse4_aSupport = x: builtins.elem "sse4a" features.${x};
avxSupport = x: builtins.elem "avx" features.${x};
avx2Support = x: builtins.elem "avx2" features.${x};
avx512Support = x: builtins.elem "avx512" features.${x};
aesSupport = x: builtins.elem "aes" features.${x};
fmaSupport = x: builtins.elem "fma" features.${x};
fma4Support = x: builtins.elem "fma4" features.${x};
};
}

View file

@ -7,6 +7,7 @@ rec {
inspect = import ./inspect.nix { inherit lib; };
platforms = import ./platforms.nix { inherit lib; };
examples = import ./examples.nix { inherit lib; };
architectures = import ./architectures.nix { inherit lib; };
# Elaborate a `localSystem` or `crossSystem` so that it contains everything
# necessary.
@ -125,6 +126,7 @@ rec {
else throw "Don't know how to run ${final.config} executables.";
} // mapAttrs (n: v: v final.parsed) inspect.predicates
// mapAttrs (n: v: v final.platform.gcc.arch or "default") architectures.predicates
// args;
in assert final.useAndroidPrebuilt -> final.isAndroid;
assert lib.foldl

View file

@ -595,15 +595,8 @@ in
nix.systemFeatures = mkDefault (
[ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++
optionals (pkgs.stdenv.isx86_64 && pkgs.hostPlatform.platform ? gcc.arch) (
# a x86_64 builder can run code for `platform.gcc.arch` and minor architectures:
[ "gccarch-${pkgs.hostPlatform.platform.gcc.arch}" ] ++ {
sandybridge = [ "gccarch-westmere" ];
ivybridge = [ "gccarch-westmere" "gccarch-sandybridge" ];
haswell = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" ];
broadwell = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" ];
skylake = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" "gccarch-broadwell" ];
skylake-avx512 = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" "gccarch-broadwell" "gccarch-skylake" ];
}.${pkgs.hostPlatform.platform.gcc.arch} or []
# a x86_64 builder can run code for `platform.gcc.arch` and inferior architectures:
[ "gccarch-${pkgs.hostPlatform.platform.gcc.arch}" ] ++ map (x: "gccarch-${x}") lib.systems.architectures.inferiors.${pkgs.hostPlatform.platform.gcc.arch}
)
);

View file

@ -10,15 +10,13 @@ stdenv.mkDerivation rec {
sha256 = "1nym0p2djws8ylkpr0kgpxfa6fxdlh46cmvz0gn5vd02jzgs0aww";
};
outputs = [ "out" "dev" ];
configureFlags = {
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
default = [ "--disable-clz" "--disable-popcnt" ];
westmere = [ "--disable-clz" ];
sandybridge = [ "--disable-clz" ];
ivybridge = [ "--disable-clz" ];
}.${stdenv.hostPlatform.platform.gcc.arch or "default"} or [];
"--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-popcnt"
"--${if stdenv.hostPlatform.sse4_aSupport then "enable" else "disable"}-clz"
];
installPhase = ''
mkdir -p "$out"/{bin,share/doc/nauty} "$dev"/{lib,include/nauty}

View file

@ -72,6 +72,7 @@ let
knm = versionAtLeast ccVersion "8.0";
# AMD
znver1 = versionAtLeast ccVersion "6.0";
znver2 = versionAtLeast ccVersion "9.0";
}.${arch} or true
else if isClang then
{ # Intel
@ -81,6 +82,7 @@ let
knm = versionAtLeast ccVersion "7.0";
# AMD
znver1 = versionAtLeast ccVersion "4.0";
znver2 = versionAtLeast ccVersion "9.0";
}.${arch} or true
else
false;

View file

@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub, readline, libedit, bc
, avxSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512" "btver2" "bdver1" "bdver2" "bdver3" "bdver4" "znver1"]
, avxSupport ? stdenv.hostPlatform.avxSupport
}:
stdenv.mkDerivation rec {

View file

@ -2,7 +2,7 @@
, guiSupport ? false, libX11
# see http://dlib.net/compile.html
, avxSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512" "btver2" "bdver1" "bdver2" "bdver3" "bdver4" "znver1"]
, avxSupport ? stdenv.hostPlatform.avxSupport
, cudaSupport ? true
}:

View file

@ -31,28 +31,21 @@ stdenv.mkDerivation rec {
configureFlags = [
"--with-blas-libs=-lcblas"
"--with-lapack-libs=-llapacke"
] ++ stdenv.lib.optionals stdenv.isx86_64 {
] ++ stdenv.lib.optionals stdenv.isx86_64 [
# disable SIMD instructions (which are enabled *when available* by default)
# 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)
default = [ "--disable-sse3" "--disable-ssse3" "--disable-sse41" "--disable-sse42" "--disable-avx" "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ];
# Intel
westmere = [ "--disable-avx" "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ];
sandybridge = [ "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ];
ivybridge = [ "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ];
haswell = [ "--disable-fma4" ];
broadwell = [ "--disable-fma4" ];
skylake = [ "--disable-fma4" ];
skylake-avx512 = [ "--disable-fma4" ];
# AMD
btver1 = [ "--disable-avx" "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ];
btver2 = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ];
bdver1 = [ "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" ];
bdver2 = [ "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" ];
bdver3 = [ "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" ];
bdver4 = [ ];
znver1 = [ "--disable-fma4" ];
}.${stdenv.hostPlatform.platform.gcc.arch or "default"};
"--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3"
"--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3"
"--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
"--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
"--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx"
"--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2"
"--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512f"
"--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512dq"
"--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512vl"
"--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma"
"--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4"
];
doCheck = true;
meta = with stdenv.lib; {

View file

@ -27,16 +27,13 @@ mkDerivation rec {
# Detection script is broken
"-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer"
"-DG2O_BUILD_EXAMPLES=OFF"
] ++ lib.optionals stdenv.isx86_64 ([ "-DDO_SSE_AUTODETECT=OFF" ] ++ {
default = [ "-DDISABLE_SSE3=ON" "-DDISABLE_SSE4_1=ON" "-DDISABLE_SSE4_2=ON" "-DDISABLE_SSE4_A=ON" ];
westmere = [ "-DDISABLE_SSE4_A=ON" ];
sandybridge = [ "-DDISABLE_SSE4_A=ON" ];
ivybridge = [ "-DDISABLE_SSE4_A=ON" ];
haswell = [ "-DDISABLE_SSE4_A=ON" ];
broadwell = [ "-DDISABLE_SSE4_A=ON" ];
skylake = [ "-DDISABLE_SSE4_A=ON" ];
skylake-avx512 = [ "-DDISABLE_SSE4_A=ON" ];
}.${stdenv.hostPlatform.platform.gcc.arch or "default"});
] ++ lib.optionals stdenv.isx86_64 [
"-DDO_SSE_AUTODETECT=OFF"
"-DDISABLE_SSE3=${ if stdenv.hostPlatform.sse3Support then "OFF" else "ON"}"
"-DDISABLE_SSE4_1=${if stdenv.hostPlatform.sse4_1Support then "OFF" else "ON"}"
"-DDISABLE_SSE4_2=${if stdenv.hostPlatform.sse4_2Support then "OFF" else "ON"}"
"-DDISABLE_SSE4_A=${if stdenv.hostPlatform.sse4_aSupport then "OFF" else "ON"}"
];
meta = with lib; {
description = "A General Framework for Graph Optimization";

View file

@ -17,26 +17,17 @@ stdenv.mkDerivation rec {
configureFlags = [
"--disable-optimization"
] ++ stdenv.lib.optionals stdenv.isx86_64 {
] ++ stdenv.lib.optionals stdenv.isx86_64 [
# disable SIMD instructions (which are enabled *when available* by default)
default = [ "--disable-sse3" "--disable-ssse3" "--disable-sse41" "--disable-sse42" "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ];
# Intel
westmere = [ "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ];
sandybridge = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ];
ivybridge = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ];
haswell = [ "--disable-fma4" ];
broadwell = [ "--disable-fma4" ];
skylake = [ "--disable-fma4" ];
skylake-avx512 = [ "--disable-fma4" ];
# AMD
btver1 = [ "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ];
btver2 = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ];
bdver1 = [ "--disable-avx2" ];
bdver2 = [ "--disable-avx2" ];
bdver3 = [ "--disable-avx2" ];
bdver4 = [ ];
znver1 = [ "--disable-fma4" ];
}.${stdenv.hostPlatform.platform.gcc.arch or "default"};
"--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3"
"--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3"
"--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
"--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
"--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx"
"--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2"
"--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma"
"--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4"
];
# On darwin, tests are linked to dylib in the nix store, so we need to make
# sure tests run after installPhase.

View file

@ -39,27 +39,17 @@ stdenv.mkDerivation rec {
configureFlags = [
"--with-blas-libs=-lblas"
"--disable-optimization"
] ++ stdenv.lib.optionals stdenv.isx86_64 {
] ++ stdenv.lib.optionals stdenv.isx86_64 [
# disable SIMD instructions (which are enabled *when available* by default)
default = [ "--disable-sse3" "--disable-ssse3" "--disable-sse41" "--disable-sse42" "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ];
# Intel
westmere = [ "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ];
sandybridge = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ];
ivybridge = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ];
haswell = [ "--disable-fma4" ];
broadwell = [ "--disable-fma4" ];
skylake = [ "--disable-fma4" ];
skylake-avx512 = [ "--disable-fma4" ];
# AMD
btver1 = [ "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ];
btver2 = [ "--disable-avx2" "--disable-fma" "--disable-fma4" ];
bdver1 = [ "--disable-avx2" ];
bdver2 = [ "--disable-avx2" ];
bdver3 = [ "--disable-avx2" ];
bdver4 = [ ];
znver1 = [ "--disable-fma4" ];
}.${stdenv.hostPlatform.platform.gcc.arch or "default"}
++ stdenv.lib.optionals withSage [
"--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3"
"--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3"
"--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
"--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
"--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx"
"--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2"
"--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma"
"--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4"
] ++ stdenv.lib.optionals withSage [
"--enable-sage"
];

View file

@ -255,27 +255,18 @@ stdenv.mkDerivation {
"-no-warnings-are-errors"
]
++ (
if (!stdenv.hostPlatform.isx86_64)
then [ "-no-sse2" ]
else lib.optionals (compareVersion "5.9.0" >= 0) {
default = [ "-sse2" "-no-sse3" "-no-ssse3" "-no-sse4.1" "-no-sse4.2" "-no-avx" "-no-avx2" ];
# Intel
westmere = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-no-avx" "-no-avx2" ];
sandybridge = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ];
ivybridge = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ];
haswell = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ];
broadwell = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ];
skylake = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ];
skylake-avx512 = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ];
# AMD
btver1 = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-no-avx" "-no-avx2" ];
btver2 = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ];
bdver1 = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ];
bdver2 = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ];
bdver3 = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-no-avx2" ];
bdver4 = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ];
znver1 = [ "-sse2" "-sse3" "-ssse3" "-sse4.1" "-sse4.2" "-avx" "-avx2" ];
}.${stdenv.hostPlatform.platform.gcc.arch or "default"}
if (!stdenv.hostPlatform.isx86_64) then [
"-no-sse2"
] else if (compareVersion "5.9.0" >= 0) then [
"-sse2"
"${if stdenv.hostPlatform.sse3Support then "" else "-no"}-sse3"
"${if stdenv.hostPlatform.ssse3Support then "" else "-no"}-ssse3"
"${if stdenv.hostPlatform.sse4_1Support then "" else "-no"}-sse4.1"
"${if stdenv.hostPlatform.sse4_2Support then "" else "-no"}-sse4.2"
"${if stdenv.hostPlatform.avxSupport then "" else "-no"}-avx"
"${if stdenv.hostPlatform.avx2Support then "" else "-no"}-avx2"
] else [
]
)
++ [
"-no-mips_dsp"

View file

@ -1,5 +1,5 @@
{ buildPythonPackage, lib, dlib, python, pytest, more-itertools,
avxSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512" "btver2" "bdver1" "bdver2" "bdver3" "bdver4" "znver1"]
{ buildPythonPackage, stdenv, lib, dlib, python, pytest, more-itertools
, avxSupport ? stdenv.hostPlatform.avxSupport
}:
buildPythonPackage {

View file

@ -23,9 +23,9 @@
, xlaSupport ? cudaSupport
# Default from ./configure script
, cudaCapabilities ? [ "3.5" "5.2" ]
, sse42Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") ["westmere" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512" "btver2" "bdver1" "bdver2" "bdver3" "bdver4" "znver1"]
, avx2Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512" "bdver4" "znver1"]
, fmaSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512" "bdver2" "bdver3" "bdver4" "znver1"]
, sse42Support ? stdenv.hostPlatform.sse4_2Support
, avx2Support ? stdenv.hostPlatform.avx2Support
, fmaSupport ? stdenv.hostPlatform.fmaSupport
# Darwin deps
, Foundation, Security
}:

View file

@ -23,9 +23,9 @@
, xlaSupport ? cudaSupport
# Default from ./configure script
, cudaCapabilities ? [ "3.5" "5.2" ]
, sse42Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") ["westmere" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512" "btver2" "bdver1" "bdver2" "bdver3" "bdver4" "znver1"]
, avx2Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512" "bdver4" "znver1"]
, fmaSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512" "bdver2" "bdver3" "bdver4" "znver1"]
, sse42Support ? stdenv.hostPlatform.sse4_2Support
, avx2Support ? stdenv.hostPlatform.avx2Support
, fmaSupport ? stdenv.hostPlatform.fmaSupport
# Darwin deps
, Foundation, Security
}:

View file

@ -32,15 +32,9 @@ let
# do not set GCC's -march=xxx based on builder's /proc/cpuinfo
"-DUSE_OPTIMIZE_FOR_ARCHITECTURE=OFF"
# also avoid using builder's /proc/cpuinfo
] ++
{ westmere = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ];
sandybridge = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ];
ivybridge = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ];
haswell = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ];
broadwell = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ];
skylake = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ];
skylake-avx512 = [ "-DHAVE_SSE42=ON" "-DASM_OPTIMIZATIONS=ON" ];
}.${stdenv.hostPlatform.platform.gcc.arch or ""} or [ "-DHAVE_SSE42=OFF" "-DASM_OPTIMIZATIONS=OFF" ];
"-DHAVE_SSE42=${if stdenv.hostPlatform.sse4_2Support then "ON" else "OFF"}"
"-DASM_OPTIMIZATIONS=${if stdenv.hostPlatform.sse4_2Support then "ON" else "OFF"}"
];
enableParallelBuilding = true;

View file

@ -1,5 +1,5 @@
{ stdenv, fetchgit, curl, jansson, autoconf, automake
, aesni ? true }:
, aesni ? stdenv.hostPlatform.aesSupport }:
let
rev = "8393e03089c0abde61bd5d72aba8f926c3d6eca4";
@ -28,6 +28,6 @@ stdenv.mkDerivation {
license = licenses.gpl2;
maintainers = [ maintainers.ehmry ];
# does not build on i686 https://github.com/lucasjones/cpuminer-multi/issues/27
platforms = [ "x86_64-linux" ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -1,8 +1,8 @@
{ stdenv, fetchFromGitHub
, boost, zlib, openssl
, upnpSupport ? true, miniupnpc ? null
, aesniSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512" "btver2" "bdver1" "bdver2" "bdver3" "bdver4" "znver1"]
, avxSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512" "btver2" "bdver1" "bdver2" "bdver3" "bdver4" "znver1"]
, aesniSupport ? stdenv.hostPlatform.aesSupport
, avxSupport ? stdenv.hostPlatform.avxSupport
}:
assert upnpSupport -> miniupnpc != null;