summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMilton Woods <miltonjwoods@gmail.com>2017-04-23 22:55:51 +1000
committerAdam J. Stewart <ajstewart426@gmail.com>2017-04-23 07:55:51 -0500
commit980ffcdcec3c8e8b5d3ec546aae2fcac4b5cff9f (patch)
treec4a451fac119704571e5046956114830717bdea8 /var
parent3b52d0a8833bd577e63bbf3a9b97559f5a39b7f4 (diff)
downloadspack-980ffcdcec3c8e8b5d3ec546aae2fcac4b5cff9f.tar.gz
spack-980ffcdcec3c8e8b5d3ec546aae2fcac4b5cff9f.tar.bz2
spack-980ffcdcec3c8e8b5d3ec546aae2fcac4b5cff9f.tar.xz
spack-980ffcdcec3c8e8b5d3ec546aae2fcac4b5cff9f.zip
eccodes: new package for encoding and decoding meteorological data (#3900)
* eccodes: new package for encoding and decoding meteorological data * eccodes: remove line breaks from package docstring * eccodes: simplify names of variants * eccodes: give a description for each variant * eccodes: use succinct code for cmake_args * eccodes: found extra dependency for python variant * eccodes: add URL for a list of available releases
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/eccodes/package.py67
1 files changed, 67 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/eccodes/package.py b/var/spack/repos/builtin/packages/eccodes/package.py
new file mode 100644
index 0000000000..709315e4b4
--- /dev/null
+++ b/var/spack/repos/builtin/packages/eccodes/package.py
@@ -0,0 +1,67 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+#
+from spack import *
+
+
+class Eccodes(CMakePackage):
+ """ecCodes is a package developed by ECMWF for processing meteorological
+ data in GRIB (1/2), BUFR (3/4) and GTS header formats."""
+
+ homepage = "https://software.ecmwf.int/wiki/display/ECC/ecCodes+Home"
+ url = "https://software.ecmwf.int/wiki/download/attachments/45757960/eccodes-2.2.0-Source.tar.gz?api=v2"
+ list_url = "https://software.ecmwf.int/wiki/display/ECC/Releases"
+
+ version('2.2.0', 'b27e6f0a3eea5b92dac37372e4c45a62')
+
+ variant('netcdf', default=True,
+ description="Support GRIB to NetCDF conversion")
+ variant('jpeg', default=True,
+ description="Support JPEG2000 encoding/decoding")
+ variant('png', default=True,
+ description="Support PNG encoding/decoding")
+ variant('python', default=False,
+ description="Build the eccodes Python interface")
+ variant('pthreads', default=False,
+ description="Enable POSIX threads")
+ variant('openmp', default=False,
+ description="Enable OpenMP threads")
+ variant('memfs', default=False,
+ description="Memory based access to definitions/samples")
+
+ depends_on('netcdf', when='+netcdf')
+ depends_on('openjpeg', when='+jpeg')
+ depends_on('libpng', when='+png')
+ depends_on('py-numpy', when='+python')
+ extends('python', when='+python')
+
+ def cmake_args(self):
+ variants = ['+netcdf', '+jpeg', '+png', '+python',
+ '+pthreads', '+openmp', '+memfs']
+ options = ['NETCDF', 'JPG', 'PNG', 'PYTHON',
+ 'ECCODES_THREADS', 'ECCODES_OMP_THREADS', 'MEMFS']
+ return map(lambda variant, option: "-DENABLE_%s=%s" %
+ (option, 'YES' if variant in self.spec else 'NO'),
+ variants, options)