From 5f74f22dc6eb9a337a881fc7550bd2e320406f00 Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Mon, 15 Apr 2019 17:41:15 -0700 Subject: Bugfix: Install missing compilers for dependency packages (#11175) 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. --- lib/spack/spack/package.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'lib') 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 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)): 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)) -- cgit v1.2.3-60-g2f50