From da79f3acaea105b7735dac29e518d080e2d8b5a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20L=C3=B6nnemark?= Date: Mon, 19 Dec 2016 11:52:06 +0100 Subject: [PATCH] Make the Rosetta EasyBlock work in --module-only mode Previously the sanity check would fail since None was inserted into the paths of the files to be checked (rather than the actual compiler name). Fixes #1072. --- easybuild/easyblocks/r/rosetta.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/easybuild/easyblocks/r/rosetta.py b/easybuild/easyblocks/r/rosetta.py index 562a0fc995..ba14c24cec 100644 --- a/easybuild/easyblocks/r/rosetta.py +++ b/easybuild/easyblocks/r/rosetta.py @@ -81,6 +81,12 @@ def extract_step(self): except OSError, err: raise EasyBuildError("Getting Rosetta sources dir ready failed: %s", err) + def detect_cxx(self): + """Detect compiler name""" + self.cxx = os.getenv('CC_SEQ') + if self.cxx is None: + self.cxx = os.getenv('CC') + def configure_step(self): """ Configure build by creating tools/build/user.settings from configure options. @@ -89,9 +95,7 @@ def configure_step(self): defines = ['NDEBUG'] self.cfg.update('buildopts', "mode=release") - self.cxx = os.getenv('CC_SEQ') - if self.cxx is None: - self.cxx = os.getenv('CC') + self.detect_cxx() cxx_ver = None if self.toolchain.comp_family() in [toolchain.GCC]: #@UndefinedVariable cxx_ver = '.'.join(get_software_version('GCC').split('.')[:2]) @@ -258,6 +262,11 @@ def extract_and_copy(dirname_tmpl, optional=False): def sanity_check_step(self): """Custom sanity check for Rosetta.""" + # self.cxx is usually set by the configure step, but if configure is + # not executed (e.g. with --module-only), we need to set it here. + if self.cxx is None: + self.detect_cxx() + infix = '' if self.toolchain.options.get('usempi', None): infix = 'mpi.'