diff options
author | Seth R. Johnson <johnsonsr@ornl.gov> | 2022-03-29 18:13:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 18:13:09 -0400 |
commit | 0367b73ed5bc1b854cf728b8727d9025a579b83a (patch) | |
tree | 7211273475fdc4dabee76a43357e379e0279a9c6 | |
parent | f66e7aea940cdb100a1db9e5701c6241021b43cb (diff) | |
download | spack-0367b73ed5bc1b854cf728b8727d9025a579b83a.tar.gz spack-0367b73ed5bc1b854cf728b8727d9025a579b83a.tar.bz2 spack-0367b73ed5bc1b854cf728b8727d9025a579b83a.tar.xz spack-0367b73ed5bc1b854cf728b8727d9025a579b83a.zip |
Trilinos: add linker flags to improve behavior (#29492)
-rw-r--r-- | var/spack/repos/builtin/packages/trilinos/package.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index bf7c0c8519..c57d444217 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -405,9 +405,9 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage): def flag_handler(self, name, flags): is_cce = self.spec.satisfies('%cce') + spec = self.spec if name == 'cxxflags': - spec = self.spec if '+mumps' in spec: # see https://github.com/trilinos/Trilinos/blob/master/packages/amesos/README-MUMPS flags.append('-DMUMPS_5_0') @@ -418,8 +418,17 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage): flags.append('-no-ipo') if '+wrapper' in spec: flags.append('--expt-extended-lambda') - elif name == 'ldflags' and is_cce: - flags.append('-fuse-ld=gold') + elif name == 'ldflags': + if is_cce: + flags.append('-fuse-ld=gold') + if spec.satisfies('platform=linux ~cuda'): + # TriBITS explicitly links libraries against all transitive + # dependencies, leading to O(N^2) library resolution. When + # CUDA is enabled (possibly only with MPI as well) the linker + # flag does not propagate correctly. + flags.append('-Wl,--as-needed') + elif spec.satisfies('+stk +shared platform=darwin'): + flags.append('-Wl,-undefined,dynamic_lookup') if is_cce: return (None, None, flags) |