diff options
author | Sergey Kosukhin <skosukhin@gmail.com> | 2017-10-25 13:24:19 +0200 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2017-10-25 13:24:19 +0200 |
commit | b92ddd72dd0370613e4bac81cc47e890a99a3d65 (patch) | |
tree | b2979d788bb7bc0a3c9c0839554f3c0d37a70657 | |
parent | e2ef033855118561c625fd63091dbeee064e38c8 (diff) | |
download | spack-b92ddd72dd0370613e4bac81cc47e890a99a3d65.tar.gz spack-b92ddd72dd0370613e4bac81cc47e890a99a3d65.tar.bz2 spack-b92ddd72dd0370613e4bac81cc47e890a99a3d65.tar.xz spack-b92ddd72dd0370613e4bac81cc47e890a99a3d65.zip |
Update for 'cdo'. (#5947)
-rw-r--r-- | var/spack/repos/builtin/packages/cdo/package.py | 121 |
1 files changed, 68 insertions, 53 deletions
diff --git a/var/spack/repos/builtin/packages/cdo/package.py b/var/spack/repos/builtin/packages/cdo/package.py index d8fb99d620..7218364779 100644 --- a/var/spack/repos/builtin/packages/cdo/package.py +++ b/var/spack/repos/builtin/packages/cdo/package.py @@ -34,91 +34,106 @@ class Cdo(AutotoolsPackage): url = 'https://code.mpimet.mpg.de/attachments/download/12760/cdo-1.7.2.tar.gz' list_url = 'https://code.mpimet.mpg.de/projects/cdo/files' + version('1.9.1', 'e60a89f268ba24cee5c461f2c217829e') version('1.9.0', '2d88561b3b4a880df0422a62e5027e40') version('1.8.2', '6a2e2f99b7c67ee9a512c40a8d4a7121') version('1.7.2', 'f08e4ce8739a4f2b63fc81a24db3ee31') - variant('szip', default=True, description='Enable szip compression for GRIB1') - variant('hdf5', default=False, description='Enable HDF5 support') variant('netcdf', default=True, description='Enable NetCDF support') + variant('grib2', default='eccodes', values=('eccodes', 'grib-api', 'none'), + description='Specify GRIB2 backend') + variant('external-grib1', default=False, + description='Ignore the built-in support and use the external ' + 'GRIB2 backend for GRIB1 files') + variant('szip', default=True, + description='Enable szip compression for GRIB1') + variant('hdf5', default=True, description='Enable HDF5 support') + variant('udunits2', default=True, description='Enable UDUNITS2 support') - variant('grib', default=True, description='Enable GRIB_API support') variant('libxml2', default=True, description='Enable libxml2 support') - variant('proj', default=True, description='Enable PROJ library for cartographic projections') + variant('proj', default=True, + description='Enable PROJ library for cartographic projections') variant('curl', default=False, description='Enable curl support') - variant('fftw', default=True, description='Enable support for fftw3') - variant('magics', default=False, description='Enable Magics library support') + variant('fftw3', default=True, description='Enable support for fftw3') + variant('magics', default=False, + description='Enable Magics library support') variant('openmp', default=True, description='Enable OpenMP support') - depends_on('szip', when='+szip') depends_on('netcdf', when='+netcdf') + # In this case CDO does not depend on hdf5 directly but we need the backend + # of netcdf to be thread safe. + depends_on('hdf5+threadsafe', when='+netcdf') + + depends_on('grib-api', when='grib2=grib-api') + depends_on('eccodes', when='grib2=eccodes') + + depends_on('szip', when='+szip') + depends_on('hdf5+threadsafe', when='+hdf5') + depends_on('udunits2', when='+udunits2') - depends_on('grib-api', when='+grib') depends_on('libxml2', when='+libxml2') depends_on('proj', when='+proj') depends_on('curl', when='+curl') - depends_on('fftw', when='+fftw') + depends_on('fftw@3:', when='+fftw3') depends_on('magics', when='+magics') + conflicts('grib2=eccodes', when='@:1.8', + msg='Eccodes is supported starting version 1.9.0') + conflicts('+szip', when='+external-grib1 grib2=none', + msg='The configuration does not support GRIB1') + def configure_args(self): - config_args = ['--enable-shared', '--enable-static'] + config_args = self.with_or_without('netcdf', activation_value='prefix') - if '+szip' in self.spec: - config_args.append('--with-szlib=' + self.spec['szip'].prefix) + if self.spec.variants['grib2'].value == 'eccodes': + config_args.append('--with-eccodes=' + + self.spec['eccodes'].prefix) + config_args.append('--without-grib_api') + elif self.spec.variants['grib2'].value == 'grib-api': + config_args.append('--with-grib_api=' + + self.spec['grib-api'].prefix) + if self.spec.satisfies('@1.9:'): + config_args.append('--without-eccodes') else: - config_args.append('--without-szlib') + config_args.append('--without-grib_api') + if self.spec.satisfies('@1.9:'): + config_args.append('--without-eccodes') - if '+hdf5' in self.spec: - config_args.append('--with-hdf5=' + self.spec['hdf5'].prefix) + if '+external-grib1' in self.spec: + config_args.append('--disable-cgribex') else: - config_args.append('--without-hdf5') + config_args.append('--enable-cgribex') - if '+netcdf' in self.spec: - config_args.append('--with-netcdf=' + self.spec['netcdf'].prefix) + if '+szip' in self.spec: + config_args.append('--with-szlib=' + self.spec['szip'].prefix) else: - config_args.append('--without-netcdf') + config_args.append('--without-szlib') - if '+udunits2' in self.spec: - config_args.append('--with-udunits2=' + - self.spec['udunits2'].prefix) - else: - config_args.append('--without-udunits2') + config_args += self.with_or_without('hdf5', + activation_value='prefix') - if '+grib' in self.spec: - config_args.append('--with-grib_api=' + - self.spec['grib-api'].prefix) - else: - config_args.append('--without-grib_api') + config_args += self.with_or_without('udunits2', + activation_value='prefix') - if '+libxml2' in self.spec: - config_args.append('--with-libxml2=' + self.spec['libxml2'].prefix) - else: - config_args.append('--without-libxml2') + config_args += self.with_or_without('libxml2', + activation_value='prefix') - if '+proj' in self.spec: - config_args.append('--with-proj=' + self.spec['proj'].prefix) - else: - config_args.append('--without-proj') + config_args += self.with_or_without('proj', + activation_value='prefix') - if '+curl' in self.spec: - config_args.append('--with-curl=' + self.spec['curl'].prefix) - else: - config_args.append('--without-curl') + config_args += self.with_or_without('curl', + activation_value='prefix') - if '+fftw' in self.spec: - config_args.append('--with-fftw3') - else: - config_args.append('--without-fftw3') + config_args += self.with_or_without('magics', + activation_value='prefix') - if '+magics' in self.spec: - config_args.append('--with-magics=' + self.spec['magics'].prefix) - else: - config_args.append('--without-magics') + config_args += self.with_or_without('fftw3') - if '+openmp' in self.spec: - config_args.append('--enable-openmp') - else: - config_args.append('--disable-openmp') + config_args += self.enable_or_disable('openmp') + + # Workaround for a problem in CDO + if self.spec.satisfies('@1.9:+hdf5^hdf5+mpi'): + config_args.append('CXX=' + self.spec['mpi'].mpicxx) return config_args |