Compare commits

...

1 Commits

Author SHA1 Message Date
Gregory Becker
55ac6fb542 prepend compiler bindir to PATH lower priority than wrapper 2023-03-23 14:04:05 -07:00

View File

@ -423,6 +423,14 @@ def set_wrapper_variables(pkg, env):
compiler = pkg.compiler compiler = pkg.compiler
env.extend(spack.schema.environment.parse(compiler.environment)) env.extend(spack.schema.environment.parse(compiler.environment))
# Before setting up PATH to Spack compiler wrappers, make sure compiler is in PATH
# This ensures that non-wrapped executables from the compiler bin directory are available
bindirs = dedupe(
[os.path.dirname(c) for c in [compiler.cc, compiler.cxx, compiler.fc, compiler.f77]]
)
for bindir in bindirs:
env.prepend_path("PATH", bindir)
if compiler.extra_rpaths: if compiler.extra_rpaths:
extra_rpaths = ":".join(compiler.extra_rpaths) extra_rpaths = ":".join(compiler.extra_rpaths)
env.set("SPACK_COMPILER_EXTRA_RPATHS", extra_rpaths) env.set("SPACK_COMPILER_EXTRA_RPATHS", extra_rpaths)