From f4b3a6365bcdf9397e7025b8ba96b04a919d7ba3 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Mon, 25 Mar 2019 18:36:30 +0100 Subject: [PATCH] cleanup sanity_check_paths in numpy & scipy easyblocks --- easybuild/easyblocks/n/numpy.py | 21 ++++++--------------- easybuild/easyblocks/s/scipy.py | 10 ---------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/easybuild/easyblocks/n/numpy.py b/easybuild/easyblocks/n/numpy.py index 7056a01395b..ab8aae4afd1 100644 --- a/easybuild/easyblocks/n/numpy.py +++ b/easybuild/easyblocks/n/numpy.py @@ -167,7 +167,7 @@ def get_libs_for_mkl(varname): lapack = ', '.join([lapack, "cblas"]) cblaslib = os.path.join(cblasroot, 'lib') # with numpy as extension, CBLAS might not be included in LDFLAGS because it's not part of a toolchain - if not cblaslib in libs: + if cblaslib not in libs: libs = ':'.join([libs, cblaslib]) else: raise EasyBuildError("CBLAS is required next to ACML to provide a C interface to BLAS, " @@ -297,13 +297,8 @@ def run(self): def sanity_check_step(self, *args, **kwargs): """Custom sanity check for numpy.""" - custom_paths = { - 'files': [], - 'dirs': [self.pylibdir], - } - custom_commands = [ - ('python', '-c "import numpy"'), - ] + custom_commands = [] + if LooseVersion(self.version) >= LooseVersion("1.10"): # generic check to see whether numpy v1.10.x and up was built against a CBLAS-enabled library # cfr. https://github.com/numpy/numpy/issues/6675#issuecomment-162601149 @@ -313,16 +308,12 @@ def sanity_check_step(self, *args, **kwargs): "blas_ok = 'HAVE_CBLAS' in dict(numpy.__config__.blas_opt_info['define_macros'])", "sys.exit((1, 0)[blas_ok])", ]) - custom_commands.append(('python', '-c "%s"' % blas_check_pytxt)) + custom_commands.append('python -c "%s"' % blas_check_pytxt) else: # _dotblas is required for decent performance of numpy.dot(), but only there in numpy 1.9.x and older - custom_commands.append (('python', '-c "import numpy.core._dotblas"')) - - # make sure the installation path is in $PYTHONPATH so the sanity check commands can work - pythonpath = os.environ.get('PYTHONPATH', '') - os.environ['PYTHONPATH'] = ':'.join([self.pylibdir, pythonpath]) + custom_commands.append("python -c 'import numpy.core._dotblas'") - return super(EB_numpy, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) + return super(EB_numpy, self).sanity_check_step(custom_commands=custom_commands) def make_module_extra_numpy_include(self): """ diff --git a/easybuild/easyblocks/s/scipy.py b/easybuild/easyblocks/s/scipy.py index 81273b05459..1ea7bad50b1 100644 --- a/easybuild/easyblocks/s/scipy.py +++ b/easybuild/easyblocks/s/scipy.py @@ -31,7 +31,6 @@ @author: Pieter De Baets (Ghent University) @author: Jens Timmerman (Ghent University) """ -import os from distutils.version import LooseVersion from easybuild.easyblocks.generic.fortranpythonpackage import FortranPythonPackage @@ -57,12 +56,3 @@ def configure_step(self): # which requires unsetting $LDFLAGS if self.toolchain.comp_family() in [toolchain.GCC, toolchain.CLANGGCC]: # @UndefinedVariable self.cfg.update('preinstallopts', "unset LDFLAGS && ") - - def sanity_check_step(self, *args, **kwargs): - """Custom sanity check for scipy.""" - custom_paths = { - 'files': [], - 'dirs': [self.pylibdir], - } - custom_commands = [(self.python_cmd, '-c "import scipy"')] - return super(EB_scipy, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)