From e89c699c06268aadca01255a006c6890a933dacf Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 23 May 2017 17:04:23 +0200 Subject: [PATCH 1/3] plumed: fixed compilation on rhel6 (#4318) * plumed: fixed compilation on rhel6 with mvapich2 and gcc@5.4.0 (#77) * plumed: prevent parallel compilation, as it breaks for the newest version --- var/spack/repos/builtin/packages/plumed/package.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py index de59f572086..5b22fdb4ea9 100644 --- a/var/spack/repos/builtin/packages/plumed/package.py +++ b/var/spack/repos/builtin/packages/plumed/package.py @@ -113,6 +113,8 @@ class Plumed(AutotoolsPackage): force_autoreconf = True + parallel = False + def apply_patch(self, other): plumed = subprocess.Popen( [join_path(self.spec.prefix.bin, 'plumed'), 'patch', '-p'], @@ -126,7 +128,7 @@ def apply_patch(self, other): def setup_dependent_package(self, module, dependent_spec): # Make plumed visible from dependent packages - module.plumed = self.spec['plumed'].command + module.plumed = dependent_spec['plumed'].command @run_before('autoreconf') def filter_gslcblas(self): @@ -162,6 +164,14 @@ def configure_args(self): 'STATIC_LIBS=-mt_mpi' ]) + # Set flags to help find gsl + if '+gsl' in self.spec: + gsl_libs = self.spec['gsl'].libs + blas_libs = self.spec['blas'].libs + configure_opts.append('LDFLAGS={0}'.format( + (gsl_libs + blas_libs).ld_flags + )) + # Additional arguments configure_opts.extend([ '--enable-shared={0}'.format('yes' if '+shared' in spec else 'no'), From 1469cfd0e7b470704091ac0848bb8aebd1a23ccb Mon Sep 17 00:00:00 2001 From: Tom Merrick Date: Tue, 23 May 2017 10:05:05 -0500 Subject: [PATCH 2/3] Packages/r ergm (#4314) * Add mpi support to R * Add multiple precision math routines to R * Add packages for r-ergm and it's dependents * Fixed depends-on types * Correct flake8 errors --- .../repos/builtin/packages/r-coda/package.py | 40 ++++++++++++++++ .../builtin/packages/r-deoptimr/package.py | 36 +++++++++++++++ .../repos/builtin/packages/r-ergm/package.py | 46 +++++++++++++++++++ .../packages/r-laplacesdemon/package.py | 37 +++++++++++++++ .../builtin/packages/r-lpsolve/package.py | 40 ++++++++++++++++ .../builtin/packages/r-network/package.py | 37 +++++++++++++++ .../builtin/packages/r-quadprog/package.py | 36 +++++++++++++++ .../builtin/packages/r-robustbase/package.py | 40 ++++++++++++++++ .../packages/r-statnet-common/package.py | 36 +++++++++++++++ .../repos/builtin/packages/r-trust/package.py | 36 +++++++++++++++ 10 files changed, 384 insertions(+) create mode 100644 var/spack/repos/builtin/packages/r-coda/package.py create mode 100644 var/spack/repos/builtin/packages/r-deoptimr/package.py create mode 100644 var/spack/repos/builtin/packages/r-ergm/package.py create mode 100644 var/spack/repos/builtin/packages/r-laplacesdemon/package.py create mode 100644 var/spack/repos/builtin/packages/r-lpsolve/package.py create mode 100644 var/spack/repos/builtin/packages/r-network/package.py create mode 100644 var/spack/repos/builtin/packages/r-quadprog/package.py create mode 100644 var/spack/repos/builtin/packages/r-robustbase/package.py create mode 100644 var/spack/repos/builtin/packages/r-statnet-common/package.py create mode 100644 var/spack/repos/builtin/packages/r-trust/package.py diff --git a/var/spack/repos/builtin/packages/r-coda/package.py b/var/spack/repos/builtin/packages/r-coda/package.py new file mode 100644 index 00000000000..08f0f10bb42 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-coda/package.py @@ -0,0 +1,40 @@ +############################################################################## +# 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 RCoda(RPackage): + """Provides functions for summarizing and plotting the output from + Markov Chain Monte Carlo (MCMC) simulations, as well as + diagnostic tests of convergence to the equilibrium distribution + of the Markov chain.""" + + homepage = "https://cran.r-project.org/web/packages/coda/index.html" + url = "https://cran.r-project.org/src/contrib/coda_0.19-1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/coda" + + version('0.19-1', '0d2aca6a5a3bdae9542708817c1ec001') + + depends_on('r-lattice', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-deoptimr/package.py b/var/spack/repos/builtin/packages/r-deoptimr/package.py new file mode 100644 index 00000000000..758b10f9e40 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-deoptimr/package.py @@ -0,0 +1,36 @@ +############################################################################## +# 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 RDeoptimr(RPackage): + """An implementation of a bespoke jDE variant of the Differential + Evolution stochastic algorithm for global optimization of + nonlinear programming problems.""" + + homepage = "https://cran.r-project.org/web/packages/DEoptimR/index.html" + url = "https://cran.r-project.org/src/contrib/DEoptimR_1.0-8.tar.gz" + + version('1.0-8', 'c85836a504fbe4166e3c8eba0efe705d') diff --git a/var/spack/repos/builtin/packages/r-ergm/package.py b/var/spack/repos/builtin/packages/r-ergm/package.py new file mode 100644 index 00000000000..72663cc1f8e --- /dev/null +++ b/var/spack/repos/builtin/packages/r-ergm/package.py @@ -0,0 +1,46 @@ +############################################################################## +# 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 RErgm(RPackage): + """An integrated set of tools to analyze and simulate networks based + on exponential-family random graph models (ERGM). "ergm" is a + part of the "statnet" suite of packages for network analysis.""" + + homepage = "http://statnet.org" + url = "https://cran.r-project.org/src/contrib/ergm_3.7.1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/ergm" + + version('3.7.1', '431ae430c76b2408988f469831d80126') + + depends_on('r-robustbase@0.9-10:', type=('build', 'run')) + depends_on('r-coda@0.18-1:', type=('build', 'run')) + depends_on('r-trust', type=('build', 'run')) + depends_on('r-matrix', type=('build', 'run')) + depends_on('r-lpsolve', type=('build', 'run')) + depends_on('r-mass', type=('build', 'run')) + depends_on('r-statnet-common@3.3:', type=('build', 'run')) + depends_on('r-network@1.13:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-laplacesdemon/package.py b/var/spack/repos/builtin/packages/r-laplacesdemon/package.py new file mode 100644 index 00000000000..1518b34bea6 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-laplacesdemon/package.py @@ -0,0 +1,37 @@ +############################################################################## +# 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 RLaplacesdemon(RPackage): + """Provides a complete environment for Bayesian inference using a variety + of different samplers (see ?LaplacesDemon for an overview). The README + describes the history of the package development process.""" + + homepage = "https://github.com/LaplacesDemonR/LaplacesDemon" + url = "https://cran.r-project.org/src/contrib/LaplacesDemon_16.0.1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/LaplacesDemon" + + version('16.0.1', '1e4dab2dd0e27251734d68b0bfdbe911') diff --git a/var/spack/repos/builtin/packages/r-lpsolve/package.py b/var/spack/repos/builtin/packages/r-lpsolve/package.py new file mode 100644 index 00000000000..1ef84eb6729 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-lpsolve/package.py @@ -0,0 +1,40 @@ +############################################################################## +# 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 RLpsolve(RPackage): + """Lp_solve is freely available (under LGPL 2) software for solving + linear, integer and mixed integer programs. In this + implementation we supply a "wrapper" function in C and some R + functions that solve general linear/integer problems, assignment + problems, and transportation problems. This version calls + lp_solve""" + + homepage = "https://cran.r-project.org/web/packages/lpSolve/index.html" + url = "https://cran.r-project.org/src/contrib/lpSolve_5.6.13.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/lpSolve" + + version('5.6.13', '8471654d9ae76e0f85ff3449433d4bc1') diff --git a/var/spack/repos/builtin/packages/r-network/package.py b/var/spack/repos/builtin/packages/r-network/package.py new file mode 100644 index 00000000000..9fdc59c02ba --- /dev/null +++ b/var/spack/repos/builtin/packages/r-network/package.py @@ -0,0 +1,37 @@ +############################################################################## +# 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 RNetwork(RPackage): + """Tools to create and modify network objects. The network class can + represent a range of relational data types, and supports + arbitrary vertex/edge/graph attributes.""" + + homepage = "https://statnet.org" + url = "https://cran.r-project.org/src/contrib/network_1.13.0.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/network" + + version('1.13.0', 'd0b967d6f1aad43b6479d72f29b705de') diff --git a/var/spack/repos/builtin/packages/r-quadprog/package.py b/var/spack/repos/builtin/packages/r-quadprog/package.py new file mode 100644 index 00000000000..84e4624e169 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-quadprog/package.py @@ -0,0 +1,36 @@ +############################################################################## +# 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 RQuadprog(RPackage): + """This package contains routines and documentation for solving + quadratic programming problems.""" + + homepage = "https://cran.r-project.org/web/packages/quadprog/index.html" + url = "https://cran.r-project.org/src/contrib/quadprog_1.5-5.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/quadprog" + + version('1.5-5', '8442f37afd8d0b19b12e77d63e6515ad') diff --git a/var/spack/repos/builtin/packages/r-robustbase/package.py b/var/spack/repos/builtin/packages/r-robustbase/package.py new file mode 100644 index 00000000000..1b7db70fbee --- /dev/null +++ b/var/spack/repos/builtin/packages/r-robustbase/package.py @@ -0,0 +1,40 @@ +############################################################################## +# 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 RRobustbase(RPackage): + """"Essential" Robust Statistics. Tools allowing to analyze data + with robust methods. This includes regression methodology + including model selections and multivariate statistics where we + strive to cover the book "Robust Statistics, Theory and Methods" + by 'Maronna, Martin and Yohai'; Wiley 2006.""" + + homepage = "https://robustbase.r-forge.r-project.org" + url = "https://cran.r-project.org/src/contrib/robustbase_0.92-7.tar.gz" + + version('0.92-7', 'db3c8d12f9729b35bad17abf09e80b72') + + depends_on('r-deoptimr', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-statnet-common/package.py b/var/spack/repos/builtin/packages/r-statnet-common/package.py new file mode 100644 index 00000000000..68bf2c4222c --- /dev/null +++ b/var/spack/repos/builtin/packages/r-statnet-common/package.py @@ -0,0 +1,36 @@ +############################################################################## +# 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 RStatnetCommon(RPackage): + """Non-statistical utilities used by the software developed by the + Statnet Project. They may also be of use to others.""" + + homepage = "http://www.statnet.org" + url = "https://cran.r-project.org/src/contrib/statnet.common_3.3.0.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/statnet.common" + + version('3.3.0', '36bc11098dcd3652a4beb05c156ad6c8') diff --git a/var/spack/repos/builtin/packages/r-trust/package.py b/var/spack/repos/builtin/packages/r-trust/package.py new file mode 100644 index 00000000000..622a0325a7e --- /dev/null +++ b/var/spack/repos/builtin/packages/r-trust/package.py @@ -0,0 +1,36 @@ +############################################################################## +# 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 RTrust(RPackage): + """Does local optimization using two derivatives and trust regions. + Guaranteed to converge to local minimum of objective function.""" + + homepage = "http://www.stat.umn.edu/geyer/trust" + url = "https://cran.r-project.org/src/contrib/trust_0.1-7.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/trust" + + version('0.1-7', '7e218b3a6b33bd77bd7e86dc6360418d') From 4553b1400cd6432ecadfb80e3ef6c44f098481b4 Mon Sep 17 00:00:00 2001 From: Milton Woods Date: Wed, 24 May 2017 01:06:59 +1000 Subject: [PATCH 3/3] Magics with eccodes variant (#4320) * magics: use filter_file to avoid using system python in all versions * magics: add eccodes variant to switch between eccodes and grib-api --- .../packages/magics/no_hardcoded_python.patch | 5 ---- .../repos/builtin/packages/magics/package.py | 26 +++++++++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/magics/no_hardcoded_python.patch diff --git a/var/spack/repos/builtin/packages/magics/no_hardcoded_python.patch b/var/spack/repos/builtin/packages/magics/no_hardcoded_python.patch deleted file mode 100644 index e2e2a5d1ba9..00000000000 --- a/var/spack/repos/builtin/packages/magics/no_hardcoded_python.patch +++ /dev/null @@ -1,5 +0,0 @@ ---- 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 diff --git a/var/spack/repos/builtin/packages/magics/package.py b/var/spack/repos/builtin/packages/magics/package.py index fca92d69d44..1b3e3e87bf8 100644 --- a/var/spack/repos/builtin/packages/magics/package.py +++ b/var/spack/repos/builtin/packages/magics/package.py @@ -41,10 +41,6 @@ class Magics(Package): 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', when='@:2.29.6') - # 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 @@ -55,6 +51,7 @@ class Magics(Package): 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') + variant('eccodes', default=False, description='Use eccodes instead of grib-api') depends_on('cmake', type='build') depends_on('pkg-config', type='build') @@ -64,8 +61,8 @@ class Magics(Package): depends_on('python', type='build') depends_on('perl', type='build') depends_on('perl-xml-parser', type='build') - depends_on('eccodes', when='@2.30.0:') - depends_on('grib-api', when='@:2.29.6') + depends_on('eccodes', when='+eccodes') + depends_on('grib-api', when='~eccodes') depends_on('proj') depends_on('boost') depends_on('expat') @@ -74,9 +71,14 @@ class Magics(Package): depends_on('libemos', when='+bufr') depends_on('qt', when='+metview+qt') + conflicts('+eccodes', when='@:2.29.0') + + # Replace system python and perl by spack versions: def patch(self): for plfile in glob.glob('*/*.pl'): filter_file('#!/usr/bin/perl', '#!/usr/bin/env perl', plfile) + for pyfile in glob.glob('*/*.py'): + filter_file('#!/usr/bin/python', '#!/usr/bin/env python', pyfile) def install(self, spec, prefix): options = [] @@ -87,11 +89,6 @@ def install(self, spec, prefix): options.append('-DPROJ4_PATH=%s' % spec['proj'].prefix) options.append('-DENABLE_TESTS=OFF') - if self.version >= Version('2.30.0'): - options.append('-DECCODES_PATH=%s' % spec['eccodes'].prefix) - else: - options.append('-DGRIB_API_PATH=%s' % spec['grib-api'].prefix) - if '+bufr' in spec: options.append('-DENABLE_BUFR=ON') options.append('-DLIBEMOS_PATH=%s' % spec['libemos'].prefix) @@ -119,6 +116,13 @@ def install(self, spec, prefix): else: options.append('-DENABLE_METVIEW=OFF') + if '+eccodes' in spec: + options.append('-DENABLE_ECCODES=ON') + options.append('-DECCODES_PATH=%s' % spec['eccodes'].prefix) + else: + options.append('-DENABLE_ECCODES=OFF') + options.append('-DGRIB_API_PATH=%s' % spec['grib-api'].prefix) + if (self.compiler.f77 is None) or (self.compiler.fc is None): options.append('-DENABLE_FORTRAN=OFF')