From ffef681377a2140040b4d65a991b9f75e56f9252 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Sun, 2 Apr 2017 20:40:09 +0200 Subject: new directive: conflicts() (#3125) * Add conflicts() directive * openblas: added conflicts for intel@16 refs #3119 * added brief docs and unit tests --- .../packages/conflict-parent/package.py | 46 ++++++++++++++++++++++ .../builtin.mock/packages/conflict/package.py | 46 ++++++++++++++++++++++ .../repos/builtin/packages/openblas/package.py | 2 + 3 files changed, 94 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/conflict-parent/package.py create mode 100644 var/spack/repos/builtin.mock/packages/conflict/package.py (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/conflict-parent/package.py b/var/spack/repos/builtin.mock/packages/conflict-parent/package.py new file mode 100644 index 0000000000..37805537a2 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/conflict-parent/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 ConflictParent(Package): + homepage = 'https://github.com/tgamblin/callpath' + url = 'http://github.com/tgamblin/callpath-1.0.tar.gz' + + version(0.8, 'foobarbaz') + version(0.9, 'foobarbaz') + version(1.0, 'foobarbaz') + + depends_on('conflict') + + conflicts('^conflict~foo', when='@0.9') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") + + def setup_environment(self, senv, renv): + renv.set('FOOBAR', self.name) diff --git a/var/spack/repos/builtin.mock/packages/conflict/package.py b/var/spack/repos/builtin.mock/packages/conflict/package.py new file mode 100644 index 0000000000..a6ba4b5c58 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/conflict/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 Conflict(Package): + homepage = 'https://github.com/tgamblin/callpath' + url = 'http://github.com/tgamblin/callpath-1.0.tar.gz' + + version(0.8, 'foobarbaz') + version(0.9, 'foobarbaz') + version(1.0, 'foobarbaz') + + variant('foo', default=True, description='') + + conflicts('%clang', when='+foo') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") + + def setup_environment(self, senv, renv): + renv.set('FOOBAR', self.name) diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index bfa5a16b42..6e16174563 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -59,6 +59,8 @@ class Openblas(MakefilePackage): parallel = False + conflicts('%intel@16', when='@0.2.15:0.2.19') + @run_before('edit') def check_compilers(self): # As of 06/2016 there is no mechanism to specify that packages which -- cgit v1.2.3-70-g09d2