diff --git a/var/spack/repos/builtin/packages/amdfftw/package.py b/var/spack/repos/builtin/packages/amdfftw/package.py index 9e4cd107c8f..39b6b479889 100644 --- a/var/spack/repos/builtin/packages/amdfftw/package.py +++ b/var/spack/repos/builtin/packages/amdfftw/package.py @@ -4,7 +4,6 @@ import os -from spack.build_environment import optimization_flags from spack.package import * from spack.pkg.builtin.fftw import FftwBase @@ -95,14 +94,14 @@ class Amdfftw(FftwBase): ) variant( "amd-dynamic-dispatcher", - default=True, + default=False, when="@4.1: %aocc@4.1.0:", description="Single portable optimized library" " to execute on different x86 CPU architectures", ) variant( "amd-dynamic-dispatcher", - default=True, + default=False, when="@3.2: %gcc", description="Single portable optimized library" " to execute on different x86 CPU architectures", @@ -203,11 +202,10 @@ def configure(self, spec, prefix): if not self.compiler.f77 or not self.compiler.fc: options.append("--disable-fortran") - # Cross compilation is supported in amd-fftw by making use of target - # variable to set AMD_ARCH configure option. - # Spack user can not directly use AMD_ARCH for this purpose but should - # use target variable to set appropriate -march option in AMD_ARCH. - options.append(f"AMD_ARCH={optimization_flags(self.compiler, spec.target)}") + if "avx512" in spec.target: + options.append("CFLAGS=-mprefer-vector-width=512") + else: + options.append("CFLAGS=-mprefer-vector-width=256") # Specific SIMD support. # float and double precisions are supported