From 66dc7d8c53822c9101a216897c55facdf8b64b5b Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Mon, 8 Feb 2021 11:43:46 -0600 Subject: [PATCH] petsc4py: workaround LDSHARED change in 3cc5b7adc7d2167646d6a049d64c710d98e1d6f0 (#21541) --- .../builtin/packages/py-petsc4py/ldshared.patch | 13 +++++++++++++ .../repos/builtin/packages/py-petsc4py/package.py | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-petsc4py/ldshared.patch diff --git a/var/spack/repos/builtin/packages/py-petsc4py/ldshared.patch b/var/spack/repos/builtin/packages/py-petsc4py/ldshared.patch new file mode 100644 index 0000000000..026a48722e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-petsc4py/ldshared.patch @@ -0,0 +1,13 @@ +diff --git a/conf/baseconf.py b/conf/baseconf.py +index 8a2466a5bd..73c08b923a 100644 +--- a/conf/baseconf.py ++++ b/conf/baseconf.py +@@ -211,7 +211,7 @@ class PetscConfig: + ldshared = getenv('LDSHARED', ldshared) + ldflags = getenv('LDFLAGS', cflags + ' ' + (ldflags or '')) + ldcmd = split_quoted(ld) + split_quoted(ldflags) +- ldshared = [flg for flg in split_quoted(ldshared) if flg not in ldcmd] ++ ldshared = [flg for flg in split_quoted(ldshared) if flg not in ldcmd and (flg.find('/lib/spack/env')<0)] + ldshared = str.join(' ', ldshared) + # + def get_flags(cmd): diff --git a/var/spack/repos/builtin/packages/py-petsc4py/package.py b/var/spack/repos/builtin/packages/py-petsc4py/package.py index 1136af6852..d022c64964 100644 --- a/var/spack/repos/builtin/packages/py-petsc4py/package.py +++ b/var/spack/repos/builtin/packages/py-petsc4py/package.py @@ -31,6 +31,8 @@ class PyPetsc4py(PythonPackage): variant('mpi', default=True, description='Activates MPI support') + patch('ldshared.patch') + depends_on('py-cython', type='build', when='@develop') depends_on('python@2.6:2.8,3.3:', type=('build', 'run')) depends_on('py-setuptools', type='build')