ó
Ë½÷Xc           @` 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
 m Z 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   TestCaset   dec(   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<   /tmp/pip-build-7oUkmx/scipy/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<   /tmp/pip-build-7oUkmx/scipy/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<   /tmp/pip-build-7oUkmx/scipy/scipy/linalg/tests/test_build.pyt   grep_dependencies!   s    :(   t   __name__t
   __module__R   R   R'   (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/linalg/tests/test_build.pyR
      s   		t   TestF77Mismatchc           B` s1   e  Z e j e j d   d k d ƒ d „  ƒ Z RS(   i   t   linuxs8   Skipping fortran compiler mismatch on non Linux platformc         C` sD   t  ƒ  } | j t j d d g ƒ } |  j 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__t   assertFalset   len(   R   t   fR    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/linalg/tests/test_build.pyt   test_lapack/   s
    	(   R(   R)   R   t   skipift   syst   platformR3   (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/linalg/tests/test_build.pyR*   .   s   (    (   t
   __future__R    R   R   t
   subprocessR   R   R   R5   R   t   numpy.testingR   R   t   numpy.compatR   t   scipy.linalgR	   R.   R
   R*   (    (    (    s<   /tmp/pip-build-7oUkmx/scipy/scipy/linalg/tests/test_build.pyt   <module>   s   