From 220c0d9cfcdf273a8f15daea8eae7541f1a9245f Mon Sep 17 00:00:00 2001 From: lorddavidiii Date: Tue, 30 Mar 2021 16:57:15 +0200 Subject: [PATCH] cuda: add dev variant and ABI variant for ncurses (#22536) * ncurses: add variant +abi5 for version 5 ABI * cuda: add variant dev, which makes cuda-gdb useable - cuda-gdb needs libncurses.so.5, which most distros doesn't have see also https://docs.nvidia.com/cuda/cuda-gdb/index.html#common-issues-oss --- var/spack/repos/builtin/packages/cuda/package.py | 5 +++++ var/spack/repos/builtin/packages/ncurses/package.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py index d09be224ef..330fea78c5 100644 --- a/var/spack/repos/builtin/packages/cuda/package.py +++ b/var/spack/repos/builtin/packages/cuda/package.py @@ -103,7 +103,12 @@ class Cuda(Package): # Mojave support -- only macOS High Sierra 10.13 is supported. conflicts('arch=darwin-mojave-x86_64') + variant('dev', default=False, description='Enable development dependencies, i.e to use cuda-gdb') + depends_on('libxml2', when='@10.1.243:') + # cuda-gdb needs libncurses.so.5 + # see https://docs.nvidia.com/cuda/cuda-gdb/index.html#common-issues-oss + depends_on('ncurses abi=5', type='run', when='+dev') provides('opencl@:1.2', when='@7:') provides('opencl@:1.1', when='@:6') diff --git a/var/spack/repos/builtin/packages/ncurses/package.py b/var/spack/repos/builtin/packages/ncurses/package.py index bc6a97ac4a..1b359ce0e3 100644 --- a/var/spack/repos/builtin/packages/ncurses/package.py +++ b/var/spack/repos/builtin/packages/ncurses/package.py @@ -31,6 +31,10 @@ class Ncurses(AutotoolsPackage, GNUMirrorPackage): variant('termlib', default=True, description='Enables termlib features. This is an extra ' 'lib and optional internal dependency.') + # Build ncurses with ABI compaitibility. + variant('abi', default='none', description='choose abi compatibility', values=('none', '5', '6'), multi=False) + + conflicts('abi=6', when='@:5.9', msg='6 is not compatible with this release') depends_on('pkgconfig', type='build') @@ -108,6 +112,10 @@ def configure(self, spec, prefix): '--enable-tcap-names', '--with-versioned-syms')) + abi = self.spec.variants['abi'].value + if abi != 'none': + opts.append('--with-abi-version=' + abi) + prefix = '--prefix={0}'.format(prefix) configure = Executable('../configure')