Skip to content

Commit

Permalink
Bugfix: Install missing compilers for dependency packages (#11175)
Browse files Browse the repository at this point in the history
Compilers are treated separately from other dependencies in Spack.
#10761 added the option to automatically install compilers when a
package specifies using a compiler that is not available in Spack.
However, this did not work correctly for dependency packages (it
would only build a compiler for the root of an install DAG). This
commit enables the building of compilers for dependency packages.
  • Loading branch information
becker33 authored and scheibelp committed Apr 16, 2019
1 parent a49de9e commit 5f74f22
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/spack/spack/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,17 +1441,16 @@ def do_install(self, **kwargs):
dep_kwargs['explicit'] = False
dep_kwargs['install_deps'] = False
for dep in self.spec.traverse(order='post', root=False):
if spack.config.get('config:install_missing_compilers', False):
tty.debug('Bootstrapping {0} compiler for {1}'.format(
self.spec.compiler, self.name
))
comp_kwargs = kwargs.copy()
comp_kwargs['explicit'] = False
comp_kwargs['install_deps'] = True
dep.package.bootstrap_compiler(**comp_kwargs)
dep.package.do_install(**dep_kwargs)

# Then, install the compiler if it is not already installed.
if install_deps:
tty.debug('Boostrapping {0} compiler for {1}'.format(
self.spec.compiler, self.name
))
comp_kwargs = kwargs.copy()
comp_kwargs['explicit'] = False
self.bootstrap_compiler(**comp_kwargs)

# Then, install the package proper
tty.msg(colorize('@*{Installing} @*g{%s}' % self.name))

Expand Down

0 comments on commit 5f74f22

Please sign in to comment.