A set of tools used in climate modeling and numerical weather prediction. (#1317)

* Update grib-api: switched to cmake building system.

* Update harfbuzz: added pkg-config dependency.

* Update pango: added pkg-config dependency.

* Add libemos package.

* Add Magics (from ECMWF) package.

* Revert "Variant for building cdo without mpi (#1638)":
CDO does not use MPI.

This reverts commit 079d063c6d.

* Update CDO package: full featured implementation.

* Update magics: added python as build dependency.

* Update cdo: added disabling configuration options.
This commit is contained in:
Sergey Kosukhin 2016-10-04 17:29:22 +01:00 committed by Todd Gamblin
parent 36c79e9df6
commit 1d981ebd50
8 changed files with 366 additions and 18 deletions

View file

@ -34,13 +34,84 @@ class Cdo(Package):
version('1.7.2', 'f08e4ce8739a4f2b63fc81a24db3ee31', url='https://code.zmaw.de/attachments/download/12760/cdo-1.7.2.tar.gz')
version('1.6.9', 'bf0997bf20e812f35e10188a930e24e2', url='https://code.zmaw.de/attachments/download/10198/cdo-1.6.9.tar.gz')
variant('mpi', default=True)
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('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('curl', default=True, description='Enable curl support')
variant('fftw', default=True, description='Enable support for fftw3')
variant('magics', default=True, description='Enable Magics library support')
depends_on('netcdf')
depends_on('netcdf+mpi', when='+mpi')
depends_on('netcdf~mpi', when='~mpi')
depends_on('szip', when='+szip')
depends_on('netcdf', when='+netcdf')
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('magics', when='+magics')
def install(self, spec, prefix):
configure('--prefix={0}'.format(prefix))
config_args = ["--prefix=" + prefix,
"--enable-shared",
"--enable-static"]
if '+szip' in spec:
config_args.append('--with-szlib=' + spec['szip'].prefix)
else:
config_args.append('--without-szlib')
if '+hdf5' in spec:
config_args.append('--with-hdf5=' + spec['hdf5'].prefix)
else:
config_args.append('--without-hdf5')
if '+netcdf' in spec:
config_args.append('--with-netcdf=' + spec['netcdf'].prefix)
else:
config_args.append('--without-netcdf')
if '+udunits2' in spec:
config_args.append('--with-udunits2=' + spec['udunits2'].prefix)
else:
config_args.append('--without-udunits2')
if '+grib' in spec:
config_args.append('--with-grib_api=' + spec['grib-api'].prefix)
else:
config_args.append('--without-grib_api')
if '+libxml2' in spec:
config_args.append('--with-libxml2=' + spec['libxml2'].prefix)
else:
config_args.append('--without-libxml2')
if '+proj' in spec:
config_args.append('--with-proj=' + spec['proj'].prefix)
else:
config_args.append('--without-proj')
if '+curl' in spec:
config_args.append('--with-curl=' + spec['curl'].prefix)
else:
config_args.append('--without-curl')
if '+fftw' in spec:
config_args.append('--with-fftw3')
else:
config_args.append('--without-fftw3')
if '+magics' in spec:
config_args.append('--with-magics=' + spec['magics'].prefix)
else:
config_args.append('--without-magics')
configure(*config_args)
make()
make('install')

View file

@ -26,25 +26,55 @@
class GribApi(Package):
"""The ECMWF GRIB API is an application program interface accessible from C,
FORTRAN and Python programs developed for encoding and decoding WMO
"""The ECMWF GRIB API is an application program interface accessible from
C, FORTRAN and Python programs developed for encoding and decoding WMO
FM-92 GRIB edition 1 and edition 2 messages."""
homepage = "https://software.ecmwf.int/wiki/display/GRIB/Home"
url = "https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.17.0-Source.tar.gz?api=v2"
url = "https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.17.0-Source.tar.gz"
version('1.17.0', 'bca7114d2c3100501a08190a146818d2')
version('1.16.0', '8c7fdee03344e4379d400ae20976a460')
depends_on('netcdf')
depends_on('jasper')
variant('netcdf', default=False, description='Enable netcdf encoding/decoding using netcdf library')
variant('jpeg', default=True, description='Enable jpeg 2000 for grib 2 decoding/encoding')
variant('png', default=False, description='Enable png for decoding/encoding')
depends_on('cmake', type='build')
depends_on('libpng', when='+png')
depends_on('netcdf', when='+netcdf')
depends_on('jasper', when='+jpeg')
def install(self, spec, prefix):
configure_options = [
'--prefix={0}'.format(prefix),
'--with-netcdf={0}'.format(spec['netcdf'].prefix),
'--with-jasper={0}'.format(spec['jasper'].prefix)
]
configure(*configure_options)
options = []
options.extend(std_cmake_args)
options.append('-DBUILD_SHARED_LIBS=BOTH')
make()
make('install')
# We will add python support later.
options.append('-DENABLE_PYTHON=OFF')
# Disable FORTRAN interface if we don't have it.
if (self.compiler.f77 is None) or (self.compiler.fc is None):
options.append('-DENABLE_FORTRAN=OFF')
if '+netcdf' in spec:
options.append('-DENABLE_NETCDF=ON')
options.append('-DNETCDF_PATH=%s' % spec['netcdf'].prefix)
else:
options.append('-DENABLE_NETCDF=OFF')
if '+jpeg' in spec:
options.append('-DENABLE_JPG=ON')
options.append('-DJASPER_PATH=%s' % spec['jasper'].prefix)
else:
options.append('-DENABLE_JPG=OFF')
if '+png' in spec:
options.append('-DENABLE_PNG=ON')
else:
options.append('-DENABLE_PNG=OFF')
with working_dir('spack-build', create=True):
cmake('..', *options)
make()
make('install')

View file

@ -32,6 +32,7 @@ class Harfbuzz(Package):
version('0.9.37', 'bfe733250e34629a188d82e3b971bc1e')
depends_on("pkg-config", type="build")
depends_on("glib")
depends_on("icu4c")
depends_on("freetype")

View file

@ -0,0 +1,52 @@
##############################################################################
# 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 Libemos(Package):
"""The Interpolation library (EMOSLIB) includes Interpolation software and
BUFR & CREX encoding/decoding routines."""
homepage = "https://software.ecmwf.int/wiki/display/EMOS/Emoslib"
url = "https://software.ecmwf.int/wiki/download/attachments/3473472/libemos-4.4.2-Source.tar.gz"
version('4.4.2', 'f15a9aff0f40861f3f046c9088197376')
depends_on('cmake', type='build')
depends_on('grib-api')
def install(self, spec, prefix):
options = []
options.extend(std_cmake_args)
options.append('-DGRIB_API_PATH=%s' % spec['grib_api'].prefix)
# To support long pathnames that spack generates
options.append('-DCMAKE_Fortran_FLAGS=-ffree-line-length-none')
with working_dir('spack-build', create=True):
cmake('..', *options)
make()
make('install')

View file

@ -0,0 +1,5 @@
--- a/tools/xml2mv.py 2016-06-27 17:49:27.000000000 +0200
+++ a/tools/xml2mv.py 2016-09-13 16:25:17.246960456 +0200
@@ -1 +1 @@
-#!/usr/bin/python
+#!/usr/bin/env python

View file

@ -0,0 +1,115 @@
##############################################################################
# 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 Magics(Package):
"""Magics is the latest generation of the ECMWF's Meteorological plotting
software MAGICS. Although completely redesigned in C++, it is intended
to be as backwards-compatible as possible with the Fortran interface."""
homepage = "https://software.ecmwf.int/wiki/display/MAGP/Magics"
url = "https://software.ecmwf.int/wiki/download/attachments/3473464/Magics-2.29.0-Source.tar.gz"
# Maintainers of Magics do not keep tarballs of minor releases. Once the
# next minor released is published the previous one becomes unavailable.
# That is why the preferred version is the latest stable one.
version('2.29.4', '91c561f413316fb665b3bb563f3878d1')
version('2.29.0', 'db20a4d3c51a2da5657c31ae3de59709', preferred=True)
# The patch changes the hardcoded path to python in shebang to enable the
# usage of the first python installation that appears in $PATH
patch('no_hardcoded_python.patch')
# The patch reorders includes and adds namespaces where necessary to
# resolve ambiguity of invocations of isnan and isinf functions. The
# patch is not needed since the version 2.29.1
patch('resolve_isnan_ambiguity.patch', when='@2.29.0')
variant('bufr', default=False, description='Enable BUFR support')
variant('netcdf', default=False, description='Enable NetCDF support')
variant('cairo', default=True, description='Enable cairo support[png/jpeg]')
variant('metview', default=False, description='Enable metview support')
variant('qt', default=False, description='Enable metview support with qt')
depends_on('cmake', type='build')
depends_on('pkg-config', type='build')
# Currently python is only necessary to run
# building preprocessing scripts.
depends_on('python', type='build')
depends_on('grib-api')
depends_on('proj')
depends_on('boost')
depends_on('expat')
depends_on('pango', when='+cairo')
depends_on('netcdf-cxx', when='+netcdf')
depends_on('libemos', when='+bufr')
depends_on('qt', when='+metview+qt')
def install(self, spec, prefix):
options = []
options.extend(std_cmake_args)
options.append('-DENABLE_ODB=OFF')
options.append('-DENABLE_PYTHON=OFF')
options.append('-DBOOST_ROOT=%s' % spec['boost'].prefix)
options.append('-DPROJ4_PATH=%s' % spec['proj'].prefix)
options.append('-DGRIB_API_PATH=%s' % spec['grib-api'].prefix)
options.append('-DENABLE_TESTS=OFF')
if '+bufr' in spec:
options.append('-DENABLE_BUFR=ON')
options.append('-DLIBEMOS_PATH=%s' % spec['libemos'].prefix)
else:
options.append('-DENABLE_BUFR=OFF')
if '+netcdf' in spec:
options.append('-DENABLE_NETCDF=ON')
options.append('-DNETCDF_PATH=%s' % spec['netcdf-cxx'].prefix)
else:
options.append('-DENABLE_NETCDF=OFF')
if '+cairo' in spec:
options.append('-DENABLE_CAIRO=ON')
else:
options.append('-DENABLE_CAIRO=OFF')
if '+metview' in spec:
if '+qt' in spec:
options.append('-DENABLE_METVIEW=ON')
if spec['qt'].version.up_to(1) == '5':
options.append('-DENABLE_QT5=ON')
else:
options.append('-DENABLE_METVIEW_NO_QT=ON')
else:
options.append('-DENABLE_METVIEW=OFF')
if (self.compiler.f77 is None) or (self.compiler.fc is None):
options.append('-DENABLE_FORTRAN=OFF')
with working_dir('spack-build', create=True):
cmake('..', *options)
make()
make('install')

View file

@ -0,0 +1,73 @@
--- a/src/common/Polyline.cc 2016-04-28 14:38:09.000000000 +0200
+++ b/src/common/Polyline.cc 2016-09-14 13:31:35.784617803 +0200
@@ -31,2 +30,0 @@
-#include "TeCoord2D.h"
-#include "TeGeometryAlgorithms.h"
--- a/src/decoders/GribRegularInterpretor.cc 2016-04-28 14:38:09.000000000 +0200
+++ b/src/decoders/GribRegularInterpretor.cc 2016-09-14 13:43:41.673614590 +0200
@@ -2083,2 +2083,2 @@
- if (isnan(val1)) {
- if (isnan(val2)) {
+ if (std::isnan(val1)) {
+ if (std::isnan(val2)) {
@@ -2090 +2090 @@
- if (isnan(val2)) {
+ if (std::isnan(val2)) {
@@ -2101 +2101 @@
- if (isnan(val) || isinf(val) || isinf(-val)) {
+ if (std::isnan(val) || std::isinf(val) || std::isinf(-val)) {
@@ -2105 +2105 @@
- if (isnan(val))
+ if (std::isnan(val))
--- a/src/decoders/GribSatelliteInterpretor.cc 2016-04-28 14:38:09.000000000 +0200
+++ b/src/decoders/GribSatelliteInterpretor.cc 2016-09-14 13:48:55.243699910 +0200
@@ -33,5 +32,0 @@
-#include "TeProjection.h"
-#include "TeDataTypes.h"
-#include "TeRasterParams.h"
-#include "TeDecoderMemory.h"
-#include "TeRasterRemap.h"
--- a/src/decoders/NetcdfGeoMatrixInterpretor.cc 2016-04-28 14:38:09.000000000 +0200
+++ b/src/decoders/NetcdfGeoMatrixInterpretor.cc 2016-09-14 13:52:37.481201085 +0200
@@ -93 +93 @@
- if ( !isnan(*d) ) {
+ if ( !std::isnan(*d) ) {
--- a/src/decoders/NetcdfOrcaInterpretor.cc 2016-04-28 14:38:09.000000000 +0200
+++ b/src/decoders/NetcdfOrcaInterpretor.cc 2016-09-14 13:51:16.248650570 +0200
@@ -210,2 +210,2 @@
- if ( isnan(val1) ) {
- if ( isnan(val2) ) {
+ if ( std::isnan(val1) ) {
+ if ( std::isnan(val2) ) {
@@ -218 +218 @@
- if ( isnan(val2) ) {
+ if ( std::isnan(val2) ) {
@@ -226 +226 @@
- if (isnan(val) || isinf(val) || isinf(-val) ) {
+ if (std::isnan(val) || std::isinf(val) || std::isinf(-val) ) {
@@ -230 +230 @@
- if (isnan(val) ) val = missing;
+ if (std::isnan(val) ) val = missing;
@@ -296 +296 @@
- if (isnan(value) )
+ if (std::isnan(value) )
--- a/src/terralib/kernel/TeCentroid.cpp 2016-04-28 14:38:09.000000000 +0200
+++ b/src/terralib/kernel/TeCentroid.cpp 2016-09-14 14:17:31.675996554 +0200
@@ -23,0 +24,2 @@
+#include "TeGeometryAlgorithms.h"
+
@@ -30 +31,0 @@
-#include "TeGeometryAlgorithms.h"
--- a/src/terralib/kernel/TeDatabase.h 2014-11-07 17:39:24.000000000 +0100
+++ b/src/terralib/kernel/TeDatabase.h 2016-09-14 14:20:01.041100590 +0200
@@ -33,0 +34 @@
+#include "TeGeometry.h"
@@ -38 +38,0 @@
-#include "TeGeometry.h"
--- a/src/terralib/kernel/TeOverlayUtils.h 2014-11-07 17:39:24.000000000 +0100
+++ b/src/terralib/kernel/TeOverlayUtils.h 2016-09-14 14:21:51.649920405 +0200
@@ -37,0 +38,2 @@
+#include "TeGeometry.h"
+
@@ -44 +45,0 @@
-#include "TeGeometry.h"

View file

@ -38,6 +38,7 @@ class Pango(Package):
version('1.36.8', '217a9a753006275215fa9fa127760ece')
version('1.40.1', '6fc88c6529890d6c8e03074d57a3eceb')
depends_on("pkg-config", type="build")
depends_on("harfbuzz")
depends_on("cairo")