From 92ec732f9a321b24ed3f6ceb541cc2051d0c1166 Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Wed, 7 Aug 2019 14:43:25 -0700 Subject: compiler bootstrapping: enable both single-node and multi-node DAGS(#12310) 5f74f22 enabled installing compilers for dependencies but not for the root package (and in particular not for DAGs which consist of one package) this enables bootstrapping compilers for both types of DAGs --- lib/spack/spack/package.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 742d83cb72..58f6c3b2e9 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1534,15 +1534,13 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)): 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) + Package._install_bootstrap_compiler(dep.package, **kwargs) dep.package.do_install(**dep_kwargs) + # Then, install the compiler if it is not already installed. + if install_deps: + Package._install_bootstrap_compiler(self, **kwargs) + # Then, install the package proper tty.msg(colorize('@*{Installing} @*g{%s}' % self.name)) @@ -1705,6 +1703,16 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)): # check the filesystem for it. self.stage.created = False + @staticmethod + def _install_bootstrap_compiler(pkg, **install_kwargs): + tty.debug('Bootstrapping {0} compiler for {1}'.format( + pkg.spec.compiler, pkg.name + )) + comp_kwargs = install_kwargs.copy() + comp_kwargs['explicit'] = False + comp_kwargs['install_deps'] = True + pkg.bootstrap_compiler(**comp_kwargs) + def unit_test_check(self): """Hook for unit tests to assert things about package internals. -- cgit v1.2.3-60-g2f50