summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Payerle <payerle@umd.edu>2021-11-02 12:31:10 -0400
committerGitHub <noreply@github.com>2021-11-02 12:31:10 -0400
commiteee45221039e14545adda6ed55b5bc5fb5fa0949 (patch)
tree47dc9623990281782066f0e2957531092ad53deb
parentb8a44870a46f4c6f51304abb157c2df7fd59c35b (diff)
downloadspack-eee45221039e14545adda6ed55b5bc5fb5fa0949.tar.gz
spack-eee45221039e14545adda6ed55b5bc5fb5fa0949.tar.bz2
spack-eee45221039e14545adda6ed55b5bc5fb5fa0949.tar.xz
spack-eee45221039e14545adda6ed55b5bc5fb5fa0949.zip
trilinos: Additional fix for linking C code when built with PyTrilinos (#19834)
This removes `-lpytrilinos` from Makefile.export.Trilinos so that C code trying to link against a Trilinos built with PyTrilinos does not fail due to undefined references to python routines (libpytrilinos is only used when importing PyTrilinos in python, in which case those references are already defined by Python). There was already a bit of code to do something similar for C codes importing Trilinos via a CMake mechanism, this extends that to a basic Makefile mechanism as well. This patch also updates the comments to remove a stale link discussing this issue, and replacing with links to the some Trilinos issue reports related to the matter.
-rw-r--r--var/spack/repos/builtin/packages/trilinos/package.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py
index d302431d2d..f9365b4e0f 100644
--- a/var/spack/repos/builtin/packages/trilinos/package.py
+++ b/var/spack/repos/builtin/packages/trilinos/package.py
@@ -731,13 +731,18 @@ class Trilinos(CMakePackage, CudaPackage):
# run-time error: Symbol not found: _PyBool_Type and prevents
# Trilinos to be used in any C++ code, which links executable
# against the libraries listed in Trilinos_LIBRARIES. See
- # https://github.com/Homebrew/homebrew-science/issues/2148#issuecomment-103614509
- # A workaround is to remove PyTrilinos from the COMPONENTS_LIST :
+ # https://github.com/trilinos/Trilinos/issues/569 and
+ # https://github.com/trilinos/Trilinos/issues/866
+ # A workaround is to remove PyTrilinos from the COMPONENTS_LIST
+ # and to remove -lpytrilonos from Makefile.export.Trilinos
if '+python' in self.spec:
filter_file(r'(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)',
(r'\1\3'),
'%s/cmake/Trilinos/TrilinosConfig.cmake' %
self.prefix.lib)
+ filter_file(r'-lpytrilinos', '',
+ '%s/Makefile.export.Trilinos' %
+ self.prefix.include)
def setup_run_environment(self, env):
if '+exodus' in self.spec: