From 1f17f44def381affc9cf14d46a13435e0863e9a3 Mon Sep 17 00:00:00 2001 From: Carlos Bederián Date: Wed, 19 Jul 2023 03:23:40 -0300 Subject: amdfftw: turn conflicts into conditional variants (#38221) --- .../repos/builtin/packages/amdfftw/package.py | 127 +++++++++------------ 1 file changed, 51 insertions(+), 76 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/amdfftw/package.py b/var/spack/repos/builtin/packages/amdfftw/package.py index 61752783a5..06efab157a 100644 --- a/var/spack/repos/builtin/packages/amdfftw/package.py +++ b/var/spack/repos/builtin/packages/amdfftw/package.py @@ -51,17 +51,36 @@ class Amdfftw(FftwBase): variant( "amd-fast-planner", default=False, + when="@3.0:", description="Option to reduce the planning time without much " "tradeoff in the performance. It is supported for " "float and double precisions only.", ) - variant("amd-top-n-planner", default=False, description="Build with amd-top-n-planner support") variant( - "amd-mpi-vader-limit", default=False, description="Build with amd-mpi-vader-limit support" + "amd-top-n-planner", + default=False, + when="@3.0.1: ~amd-fast-planner ~mpi ~openmp ~threads", + description="Build with amd-top-n-planner support", + ) + variant( + "amd-mpi-vader-limit", + default=False, + when="@3.0.1:", + description="Build with amd-mpi-vader-limit support", ) variant("static", default=False, description="Build with static suppport") - variant("amd-trans", default=False, description="Build with amd-trans suppport") - variant("amd-app-opt", default=False, description="Build with amd-app-opt suppport") + variant( + "amd-trans", + default=False, + when="~mpi ~openmp ~threads", + description="Build with amd-trans suppport", + ) + variant( + "amd-app-opt", + default=False, + when="@3.1: ~mpi", + description="Build with amd-app-opt suppport", + ) variant( "amd-dynamic-dispatcher", default=False, @@ -83,83 +102,39 @@ class Amdfftw(FftwBase): "+debug", when="@2.2 %aocc", msg="debug mode is not supported by AOCC clang version 2.2" ) conflicts("%gcc@:7.2", when="@2.2:", msg="GCC version above 7.2 is required for AMDFFTW") - conflicts( - "+amd-fast-planner", when="@2.2", msg="amd-fast-planner is supported from 3.0 onwards" - ) - conflicts( - "+amd-fast-planner", - when="precision=quad", - msg="Quad precision is not supported with amd-fast-planner", - ) - conflicts( - "+amd-fast-planner", - when="precision=long_double", - msg="long_double precision is not supported with amd-fast-planner", - ) - conflicts( - "+amd-top-n-planner", - when="@:3.0.0", - msg="amd-top-n-planner is supported from 3.0.1 onwards", - ) - conflicts( - "+amd-top-n-planner", - when="precision=long_double", - msg="long_double precision is not supported with amd-top-n-planner", - ) - conflicts( - "+amd-top-n-planner", - when="precision=quad", - msg="Quad precision is not supported with amd-top-n-planner", - ) - conflicts( - "+amd-top-n-planner", - when="+amd-fast-planner", - msg="amd-top-n-planner cannot be used with amd-fast-planner", - ) - conflicts( - "+amd-top-n-planner", when="+threads", msg="amd-top-n-planner works only for single thread" - ) - conflicts( - "+amd-top-n-planner", when="+mpi", msg="mpi thread is not supported with amd-top-n-planner" - ) - conflicts( - "+amd-top-n-planner", - when="+openmp", - msg="openmp thread is not supported with amd-top-n-planner", - ) - conflicts( - "+amd-mpi-vader-limit", - when="@:3.0.0", - msg="amd-mpi-vader-limit is supported from 3.0.1 onwards", - ) + + with when("+amd-fast-planner"): + conflicts("precision=quad", msg="Quad precision is not supported with amd-fast-planner") + conflicts( + "precision=long_double", + msg="long_double precision is not supported with amd-fast-planner", + ) + + with when("+amd-top-n-planner"): + conflicts("precision=quad", msg="Quad precision is not supported with amd-top-n-planner") + conflicts( + "precision=long_double", + msg="long_double precision is not supported with amd-top-n-planner", + ) + conflicts( "+amd-mpi-vader-limit", when="precision=quad", msg="Quad precision is not supported with amd-mpi-vader-limit", ) - conflicts("+amd-trans", when="+threads", msg="amd-trans works only for single thread") - conflicts("+amd-trans", when="+mpi", msg="mpi thread is not supported with amd-trans") - conflicts("+amd-trans", when="+openmp", msg="openmp thread is not supported with amd-trans") - conflicts( - "+amd-trans", - when="precision=long_double", - msg="long_double precision is not supported with amd-trans", - ) - conflicts( - "+amd-trans", when="precision=quad", msg="Quad precision is not supported with amd-trans" - ) - conflicts("+amd-app-opt", when="@:3.0.1", msg="amd-app-opt is supported from 3.1 onwards") - conflicts("+amd-app-opt", when="+mpi", msg="mpi thread is not supported with amd-app-opt") - conflicts( - "+amd-app-opt", - when="precision=long_double", - msg="long_double precision is not supported with amd-app-opt", - ) - conflicts( - "+amd-app-opt", - when="precision=quad", - msg="Quad precision is not supported with amd-app-opt", - ) + + with when("+amd-trans"): + conflicts( + "precision=long_double", msg="long_double precision is not supported with amd-trans" + ) + conflicts("precision=quad", msg="Quad precision is not supported with amd-trans") + + with when("+amd-app-opt"): + conflicts( + "precision=long_double", msg="long_double precision is not supported with amd-app-opt" + ) + conflicts("precision=quad", msg="Quad precision is not supported with amd-app-opt") + conflicts( "+amd-dynamic-dispatcher", when="%aocc", -- cgit v1.2.3-60-g2f50