From c84c0187eafef812fb1316c4da9bcf1096d26a02 Mon Sep 17 00:00:00 2001 From: Martin Pokorny Date: Sat, 20 Mar 2021 07:58:56 -0600 Subject: [PATCH] casacore: fft implementation default (#22226) * Change default FFT implementation to FFTW To account for the default changing with casacore v3.4.0, as well as the CMake logic for getting the FFTPack implementation. * Switch to using spec.satisfies() for Python CMake values --- .../repos/builtin/packages/casacore/package.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/casacore/package.py b/var/spack/repos/builtin/packages/casacore/package.py index 65f7e056d97..b11a0dc6062 100644 --- a/var/spack/repos/builtin/packages/casacore/package.py +++ b/var/spack/repos/builtin/packages/casacore/package.py @@ -31,7 +31,7 @@ class Casacore(CMakePackage): variant('readline', default=True, description='Build readline support') # see note below about the reason for disabling the "sofa" variant # variant('sofa', default=False, description='Build SOFA support') - variant('fftw', default=False, description='Build FFTW3 support') + variant('fftw', default=True, description='Build FFTW3 support') variant('hdf5', default=False, description='Build HDF5 support') variant('python', default=False, description='Build python support') @@ -65,12 +65,20 @@ def cmake_args(self): args.append(self.define_from_variant('USE_OPENMP', 'openmp')) args.append(self.define_from_variant('USE_READLINE', 'readline')) args.append(self.define_from_variant('USE_HDF5', 'hdf5')) - args.append(self.define_from_variant('USE_FFTW3', 'fftw')) + + # fftw3 is used by casacore as the default starting with + # v3.4.0 (although we use fftw3 by default in this Spack + # package), but the old fftpack is still available + if spec.satisfies('@3.4.0:'): + if spec.satisfies('~fftw'): + args.append('-DBUILD_FFTPACK_DEPRECATED=YES') + else: + args.append(self.define_from_variant('USE_FFTW3', 'fftw')) # Python2 and Python3 binding - if '+python' not in spec: + if spec.satisfies('~python'): args.extend(['-DBUILD_PYTHON=NO', '-DBUILD_PYTHON3=NO']) - elif spec['python'].version >= Version('3.0.0'): + elif spec.satisfies('^python@3.0.0:'): args.extend(['-DBUILD_PYTHON=NO', '-DBUILD_PYTHON3=YES']) else: args.extend(['-DBUILD_PYTHON=YES', '-DBUILD_PYTHON3=NO'])