diff options
author | John Ericson <git@JohnEricson.me> | 2020-09-01 22:31:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 22:31:16 -0400 |
commit | 1965a241fc2476ff63e8b97019a3db58707a8325 (patch) | |
tree | 7e5efc37712cd6e72c85ee08a5b2a6965c3b4f6a /pkgs/development | |
parent | 54eacc77f7e8fd20db467f1363fee937ca8f5fa1 (diff) | |
parent | c5fe132b3c5da5044c01a9bd4aa4ab45795cb9e6 (diff) |
Merge pull request #61019 from volth/gcc.arch-amd
platform.gcc.arch: support for AMD CPUs
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/interpreters/j/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/libraries/dlib/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/libraries/fflas-ffpack/default.nix | 24 | ||||
-rw-r--r-- | pkgs/development/libraries/g2o/default.nix | 17 | ||||
-rw-r--r-- | pkgs/development/libraries/givaro/default.nix | 20 | ||||
-rw-r--r-- | pkgs/development/libraries/linbox/default.nix | 21 | ||||
-rw-r--r-- | pkgs/development/libraries/qt-5/modules/qtbase.nix | 24 | ||||
-rw-r--r-- | pkgs/development/python-modules/dlib/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/python-modules/tensorflow/1/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/python-modules/tensorflow/2/default.nix | 6 |
10 files changed, 64 insertions, 64 deletions
diff --git a/pkgs/development/interpreters/j/default.nix b/pkgs/development/interpreters/j/default.nix index 8e6b434281eb1..e2bf921f882a0 100644 --- a/pkgs/development/interpreters/j/default.nix +++ b/pkgs/development/interpreters/j/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchFromGitHub, readline, libedit, bc -, avxSupport ? false +, avxSupport ? stdenv.hostPlatform.avxSupport }: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/dlib/default.nix b/pkgs/development/libraries/dlib/default.nix index 3f59368c278bb..43ac2530cc131 100644 --- a/pkgs/development/libraries/dlib/default.nix +++ b/pkgs/development/libraries/dlib/default.nix @@ -2,7 +2,7 @@ , guiSupport ? false, libX11 # see http://dlib.net/compile.html -, avxSupport ? true +, avxSupport ? stdenv.hostPlatform.avxSupport , cudaSupport ? true }: @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { rm -rf dlib/external ''; - cmakeFlags = [ + cmakeFlags = [ "-DUSE_DLIB_USE_CUDA=${if cudaSupport then "1" else "0"}" "-DUSE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}" ]; diff --git a/pkgs/development/libraries/fflas-ffpack/default.nix b/pkgs/development/libraries/fflas-ffpack/default.nix index bc84039a9aa2c..23b31fe439fdc 100644 --- a/pkgs/development/libraries/fflas-ffpack/default.nix +++ b/pkgs/development/libraries/fflas-ffpack/default.nix @@ -31,19 +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" ]; - 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" ]; - }.${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; { diff --git a/pkgs/development/libraries/g2o/default.nix b/pkgs/development/libraries/g2o/default.nix index 7167112b6bd19..675d994cf0e6b 100644 --- a/pkgs/development/libraries/g2o/default.nix +++ b/pkgs/development/libraries/g2o/default.nix @@ -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"; diff --git a/pkgs/development/libraries/givaro/default.nix b/pkgs/development/libraries/givaro/default.nix index fdaf518c6114f..78b6b08827077 100644 --- a/pkgs/development/libraries/givaro/default.nix +++ b/pkgs/development/libraries/givaro/default.nix @@ -17,17 +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" ]; - 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" ]; - }.${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. diff --git a/pkgs/development/libraries/linbox/default.nix b/pkgs/development/libraries/linbox/default.nix index 2217996acdbce..09bd7e1209110 100644 --- a/pkgs/development/libraries/linbox/default.nix +++ b/pkgs/development/libraries/linbox/default.nix @@ -39,18 +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" ]; - 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" ]; - }.${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" ]; diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index 4d7507220b563..3cbcaaacefb81 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -255,18 +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" ]; - 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" ]; - }.${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" diff --git a/pkgs/development/python-modules/dlib/default.nix b/pkgs/development/python-modules/dlib/default.nix index a57d830755138..027500ff2abfa 100644 --- a/pkgs/development/python-modules/dlib/default.nix +++ b/pkgs/development/python-modules/dlib/default.nix @@ -1,4 +1,6 @@ -{ buildPythonPackage, dlib, python, pytest, more-itertools, avxSupport ? true, lib }: +{ buildPythonPackage, stdenv, lib, dlib, python, pytest, more-itertools +, avxSupport ? stdenv.hostPlatform.avxSupport +}: buildPythonPackage { inherit (dlib) name src nativeBuildInputs buildInputs meta; diff --git a/pkgs/development/python-modules/tensorflow/1/default.nix b/pkgs/development/python-modules/tensorflow/1/default.nix index 4dc5c57070d18..5f65004b3d686 100644 --- a/pkgs/development/python-modules/tensorflow/1/default.nix +++ b/pkgs/development/python-modules/tensorflow/1/default.nix @@ -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"] -, avx2Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] -, fmaSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] +, sse42Support ? stdenv.hostPlatform.sse4_2Support +, avx2Support ? stdenv.hostPlatform.avx2Support +, fmaSupport ? stdenv.hostPlatform.fmaSupport # Darwin deps , Foundation, Security }: diff --git a/pkgs/development/python-modules/tensorflow/2/default.nix b/pkgs/development/python-modules/tensorflow/2/default.nix index 4dd378d1410bd..eedd6e6d0dfb9 100644 --- a/pkgs/development/python-modules/tensorflow/2/default.nix +++ b/pkgs/development/python-modules/tensorflow/2/default.nix @@ -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"] -, avx2Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] -, fmaSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] +, sse42Support ? stdenv.hostPlatform.sse4_2Support +, avx2Support ? stdenv.hostPlatform.avx2Support +, fmaSupport ? stdenv.hostPlatform.fmaSupport # Darwin deps , Foundation, Security }: |