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):
|
def flag_handler(self, name, flags):
|
||||||
is_cce = self.spec.satisfies('%cce')
|
is_cce = self.spec.satisfies('%cce')
|
||||||
|
spec = self.spec
|
||||||
|
|
||||||
if name == 'cxxflags':
|
if name == 'cxxflags':
|
||||||
spec = self.spec
|
|
||||||
if '+mumps' in spec:
|
if '+mumps' in spec:
|
||||||
# see https://github.com/trilinos/Trilinos/blob/master/packages/amesos/README-MUMPS
|
# see https://github.com/trilinos/Trilinos/blob/master/packages/amesos/README-MUMPS
|
||||||
flags.append('-DMUMPS_5_0')
|
flags.append('-DMUMPS_5_0')
|
||||||
|
@ -418,8 +418,17 @@ def flag_handler(self, name, flags):
|
||||||
flags.append('-no-ipo')
|
flags.append('-no-ipo')
|
||||||
if '+wrapper' in spec:
|
if '+wrapper' in spec:
|
||||||
flags.append('--expt-extended-lambda')
|
flags.append('--expt-extended-lambda')
|
||||||
elif name == 'ldflags' and is_cce:
|
elif name == 'ldflags':
|
||||||
flags.append('-fuse-ld=gold')
|
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:
|
if is_cce:
|
||||||
return (None, None, flags)
|
return (None, None, flags)
|
||||||
|
|
Loading…
Reference in a new issue