Trilinos: add linker flags to improve behavior (#29492)
This commit is contained in:
parent
f66e7aea94
commit
0367b73ed5
1 changed files with 12 additions and 3 deletions
|
@ -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 @@ def flag_handler(self, name, flags):
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue