ó
î&]\c           @` sı   d  d l  m Z m Z m Z d  d l m Z m Z m Z d  d l Z d  d l	 Z	 d  d l
 Z
 d  d l m Z d  d l m Z d  d l m Z d d d     YZ d	 e f d
     YZ d S(   i    (   t   divisiont   print_functiont   absolute_import(   t   callt   PIPEt   PopenN(   t   assert_(   t   asbytes(   t   _flapackt   FindDependenciesLddc           B` s#   e  Z d    Z d   Z d   Z RS(   c         C` sV   d g |  _  y t |  j  d t d t } Wn$ t k
 rQ t d |  j    n Xd  S(   Nt   lddt   stdoutt   stderrs   command %s cannot be run(   t   cmdR   R   t   OSErrort   RuntimeError(   t   selft   st(    (    s<   lib/python2.7/site-packages/scipy/linalg/tests/test_build.pyt   __init__   s
    c         C` sZ   t  |  j | g d t d t } | j   \ } } | j d k sV t d |   n  | S(   NR   R   i    s#   Failed to check dependencies for %s(   R   R   R   t   communicatet
   returncodeR   (   R   t   filet   pR   R   (    (    s<   lib/python2.7/site-packages/scipy/linalg/tests/test_build.pyt   get_dependencies   s
    "c   
      C` sĤ   |  j  |  } t g  | D]' } t |  t j t |   f ^ q  } g  } xP | j   D]B } x9 | j   D]+ \ } }	 |	 j |  ro | j |  qo qo Wq\ W| S(   N(	   R   t   dictR   t   ret   compilet
   splitlinest   itemst   searcht   append(
   R   R   t   depsR   t   dept   rdepst   foundst   lt   kt   v(    (    s<   lib/python2.7/site-packages/scipy/linalg/tests/test_build.pyt   grep_dependencies"   s    :(   t   __name__t
   __module__R   R   R&   (    (    (    s<   lib/python2.7/site-packages/scipy/linalg/tests/test_build.pyR	      s   		t   TestF77Mismatchc           B` s7   e  Z e j j e j d   d k d d d    Z RS(   i   t   linuxt   reasons8   Skipping fortran compiler mismatch on non Linux platformc         C` sB   t    } | j t j d d g  } t t |  d k d  d  S(   Nt   libg2ct   libgfortrani   sİ   Both g77 and gfortran runtimes linked in scipy.linalg.flapack ! This is
likely to cause random crashes and wrong results. See numpy INSTALL.rst.txt for
more information.(   R	   R&   t   flapackt   __file__R   t   len(   R   t   fR   (    (    s<   lib/python2.7/site-packages/scipy/linalg/tests/test_build.pyt   test_lapack0   s
    	(   R'   R(   t   pytestt   markt   skipift   syst   platformR2   (    (    (    s<   lib/python2.7/site-packages/scipy/linalg/tests/test_build.pyR)   /   s   (    (   t
   __future__R    R   R   t
   subprocessR   R   R   R6   R   R3   t   numpy.testingR   t   numpy.compatR   t   scipy.linalgR   R.   R	   t   objectR)   (    (    (    s<   lib/python2.7/site-packages/scipy/linalg/tests/test_build.pyt   <module>   s   