[Numpy-discussion] Silencing NumPy output

Charles R Harris charlesr.harris at gmail.com
Fri Nov 15 12:40:54 EST 2013


On Fri, Nov 15, 2013 at 10:31 AM, Charles R Harris <
charlesr.harris at gmail.com> wrote:

>
>
>
> On Fri, Nov 15, 2013 at 8:12 AM, Frédéric Bastien <nouiz at nouiz.org> wrote:
>
>> Hi,
>>
>> NumPy 1.8 removed the private NumPy interface
>> numpy.distutils.__config__. So a Theano user make a PR to make Theano
>> use the official interface:
>>
>> numpy.distutils.system_info.get_info("blas_opt")
>>
>> But this output many stuff to the output. I can silence part of it by
>> silencing warnings, but I'm not able to silence this output:
>>
>> Found executable /usr/bin/gfortran
>> ATLAS version 3.8.3 built by mockbuild on Wed Jul 28 02:12:34 UTC 2010:
>>    UNAME    : Linux x86-15.phx2.fedoraproject.org 2.6.32-44.el6.x86_64
>> #1 SMP Wed Jul 7 15:47:50 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
>>    INSTFLG  : -1 0 -a 1
>>    ARCHDEFS : -DATL_OS_Linux -DATL_ARCH_Corei7 -DATL_CPUMHZ=1596
>> -DATL_SSE3 -DATL_SSE2 -DATL_SSE1 -DATL_USE64BITS -DATL_GAS_x8664
>>    F2CDEFS  : -DAdd_ -DF77_INTEGER=int -DStringSunStyle
>>    CACHEEDGE: 524288
>>    F77      : gfortran, version GNU Fortran (GCC) 4.5.0 20100716 (Red
>> Hat 4.5.0-3)
>>    F77FLAGS : -O -g -Wa,--noexecstack -fPIC -m64
>>    SMC      : gcc, version gcc (GCC) 4.5.0 20100716 (Red Hat 4.5.0-3)
>>    SMCFLAGS : -fomit-frame-pointer -mfpmath=sse -msse3 -O2
>> -fno-schedule-insns2 -g -Wa,--noexecstack -fPIC -m64
>>    SKC      : gcc, version gcc (GCC) 4.5.0 20100716 (Red Hat 4.5.0-3)
>>    SKCFLAGS : -fomit-frame-pointer -mfpmath=sse -msse3 -O2
>> -fno-schedule-insns2 -g -Wa,--noexecstack -fPIC -m64
>>
>> -L/opt/lisa/os_v2/canopy/appdata/canopy-1.1.0.1371.rh5-x86_64/../../appdata/canopy-1.1.0.1371.rh5-x86_64/lib
>> -lptf77blas -lptcblas -latlas
>>
>> I tried to redirect the stdout and stderr, but it don't work. I looked
>> into NumPy code and I don't see a way to change that from a library
>> that use NumPy.
>>
>> Is there a way to access to silence that output?
>>
>> Is there a new place of the old interface: numpy.distutils.__config__
>> that I can reuse? It don't need to be a public interface.
>>
>
> Looks like the problem is in numpy/distutils/exec_command.py and
> numpy/distutils/log.py. In particular, it looks like a logging problem and
> I'd guess it may be connected to the debug logs. Also, looks like
> numpy.distutils.log inherits from distutils.log, which may be obsolete. You
> might get some control of the log with an environment variable, but the
> function itself looks largely undocumented. That said, it should probably
> be printing to stderror when run from the command line.
>
>
In numpy/distutils/__init__.py line 886  try changing log.set_verbosity(-2)
to log.set_verbosity(2)

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131115/4fb582ae/attachment.html>


More information about the NumPy-Discussion mailing list