diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 5d363eb4e06c..cadcc1ddef62 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -401,7 +401,7 @@ def check_compiler_gcc4(self): def get_output(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, - lang="c"): + lang="c", use_tee=None): """Try to compile, link to an executable, and run a program built from 'body' and 'headers'. Returns the exit status code of the program and its output. @@ -426,7 +426,8 @@ def get_output(self, body, headers=None, include_dirs=None, grabber.restore() raise exe = os.path.join('.', exe) - exitstatus, output = exec_command(exe, execute_in='.') + exitstatus, output = exec_command(exe, execute_in='.', + use_tee=use_tee) if hasattr(os, 'WEXITSTATUS'): exitcode = os.WEXITSTATUS(exitstatus) if os.WIFSIGNALED(exitstatus): diff --git a/numpy/distutils/exec_command.py b/numpy/distutils/exec_command.py index 648a98efb6d5..baf81f337aa2 100644 --- a/numpy/distutils/exec_command.py +++ b/numpy/distutils/exec_command.py @@ -120,7 +120,7 @@ def find_executable(exe, path=None, _cache={}): if not os.path.islink(f_ext): f_ext = realpath(f_ext) if os.path.isfile(f_ext) and os.access(f_ext, os.X_OK): - log.good('Found executable %s' % f_ext) + log.info('Found executable %s' % f_ext) _cache[key] = f_ext return f_ext diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 5ed12db6e60a..b24ab2ae3f26 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -286,7 +286,7 @@ def get_standard_file(fname): return filenames -def get_info(name, notfound_action=0): +def get_info(name, notfound_action=0, verbosity=None): """ notfound_action: 0 - do nothing @@ -347,7 +347,7 @@ def get_info(name, notfound_action=0): 'umfpack': umfpack_info, 'amd': amd_info, }.get(name.lower(), system_info) - return cl().get_info(notfound_action) + return cl(verbosity=verbosity).get_info(notfound_action) class NotFoundError(DistutilsError): @@ -444,7 +444,7 @@ class system_info: def __init__(self, default_lib_dirs=default_lib_dirs, default_include_dirs=default_include_dirs, - verbosity=1, + verbosity=None, ): self.__class__.info = {} self.local_prefixes = [] @@ -463,6 +463,8 @@ def __init__(self, self.search_static_first = self.cp.getboolean( self.section, 'search_static_first') assert isinstance(self.search_static_first, int) + if verbosity is not None: + self.verbosity = verbosity def parse_config_files(self): self.cp.read(self.files) @@ -756,9 +758,6 @@ class fftw_info(system_info): 'includes':['fftw.h', 'rfftw.h'], 'macros':[('SCIPY_FFTW_H', None)]}] - def __init__(self): - system_info.__init__(self) - def calc_ver_info(self, ver_param): """Returns True on successful version detection, else False""" lib_dirs = self.get_lib_dirs() @@ -929,10 +928,10 @@ def get_mkl_rootdir(self): return d return None - def __init__(self): + def __init__(self, verbosity=None): mklroot = self.get_mkl_rootdir() if mklroot is None: - system_info.__init__(self) + system_info.__init__(self, verbosity=verbosity) else: from .cpuinfo import cpu l = 'mkl' # use shared library @@ -950,7 +949,8 @@ def __init__(self): system_info.__init__( self, default_lib_dirs=[os.path.join(mklroot, 'lib', plt)], - default_include_dirs=[os.path.join(mklroot, 'include')]) + default_include_dirs=[os.path.join(mklroot, 'include')], + verbosity=verbosity) def calc_info(self): lib_dirs = self.get_lib_dirs() @@ -1094,8 +1094,8 @@ def calc_info(self): else: info['language'] = 'f77' - atlas_version, atlas_extra_info = get_atlas_version(**atlas) - dict_append(info, **atlas_extra_info) + atlas_info = get_atlas_version(verbosity=self.verbosity, **atlas) + dict_append(info, **atlas_info[1]) self.set_info(**info) @@ -1119,8 +1119,8 @@ def calc_info(self): dict_append(info, include_dirs=[h]) info['language'] = 'c' - atlas_version, atlas_extra_info = get_atlas_version(**atlas) - dict_append(atlas, **atlas_extra_info) + atlas_info = get_atlas_version(verbosity=self.verbosity, **atlas) + dict_append(atlas, **atlas_info[1]) dict_append(info, **atlas) @@ -1294,6 +1294,7 @@ def calc_info(self): def get_atlas_version(**config): libraries = config.get('libraries', []) library_dirs = config.get('library_dirs', []) + verbosity = config.get('verbosity', 1) key = (tuple(libraries), tuple(library_dirs)) if key in _cached_atlas_version: return _cached_atlas_version[key] @@ -1302,11 +1303,13 @@ def get_atlas_version(**config): info = {} try: s, o = c.get_output(atlas_version_c_text, - libraries=libraries, library_dirs=library_dirs) + libraries=libraries, library_dirs=library_dirs, + use_tee=verbosity) if s and re.search(r'undefined reference to `_gfortran', o, re.M): s, o = c.get_output(atlas_version_c_text, libraries=libraries + ['gfortran'], - library_dirs=library_dirs) + library_dirs=library_dirs, + use_tee=verbosity) if not s: warnings.warn(""" ***************************************************** @@ -1480,7 +1483,7 @@ def calc_info(self): if not atlas_info: atlas_info = get_info('atlas_blas') - if sys.platform == 'darwin'and not atlas_info: + if sys.platform == 'darwin' and not atlas_info: # Use the system BLAS from Accelerate or vecLib under OSX args = [] link_args = [] @@ -1629,10 +1632,11 @@ class x11_info(system_info): section = 'x11' notfounderror = X11NotFoundError - def __init__(self): + def __init__(self, verbosity=None): system_info.__init__(self, default_lib_dirs=default_x11_lib_dirs, - default_include_dirs=default_x11_include_dirs) + default_include_dirs=default_x11_include_dirs, + verbosity=verbosity) def calc_info(self): if sys.platform in ['win32']: @@ -1658,7 +1662,7 @@ class _numpy_info(system_info): modulename = 'Numeric' notfounderror = NumericNotFoundError - def __init__(self): + def __init__(self, verbosity=None): include_dirs = [] try: module = __import__(self.modulename) @@ -1690,7 +1694,8 @@ def __init__(self): include_dirs.append(d) system_info.__init__(self, default_lib_dirs=[], - default_include_dirs=include_dirs) + default_include_dirs=include_dirs, + verbosity=verbosity) def calc_info(self): try: