diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 6f90b3e162..b54a8abb74 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -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))