ó
ØÆ÷Xc           @` sÌ   d  d l  m Z m Z m Z d  d l m Z m Z d  d l Z d  d l Z d  d l	 m
 Z
 d  d l m Z m Z m Z d  d l m Z d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ e d k rÈ e ƒ  n  d S(   i    (   t   divisiont   absolute_importt   print_function(   t   PIPEt   PopenN(   t   lapack_lite(   t   TestCaset   dect   run_module_suite(   t   asbytes_nestedt   FindDependenciesLddc           B` s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C` sh   d g |  _  y1 t |  j  d t d t ƒ} | j ƒ  \ } } Wn$ t k
 rc t d |  j  ƒ ‚ n Xd  S(   Nt   lddt   stdoutt   stderrs   command %s cannot be run(   t   cmdR   R   t   communicatet   OSErrort   RuntimeError(   t   selft   pR   R   (    (    s<   /tmp/pip-build-X4mzal/numpy/numpy/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 dependencies check for %s(   R   R   R   R   t
   returncodeR   (   R   t   lfileR   R   R   (    (    s<   /tmp/pip-build-X4mzal/numpy/numpy/linalg/tests/test_build.pyt   get_dependencies   s
    "c   
      C` sš   |  j  | ƒ } t g  | D] } | t j | ƒ f ^ q ƒ } g  } xP | j ƒ  D]B } x9 | j ƒ  D]+ \ } }	 |	 j | ƒ rc | j | ƒ qc qc WqP W| S(   N(   R   t   dictt   ret   compilet
   splitlinest   itemst   searcht   append(
   R   R   t   depsR   t   dept   rdepst   foundst   lt   kt   v(    (    s<   /tmp/pip-build-X4mzal/numpy/numpy/linalg/tests/test_build.pyt   grep_dependencies    s    .(   t   __name__t
   __module__R   R   R&   (    (    (    s<   /tmp/pip-build-X4mzal/numpy/numpy/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` sJ   t  ƒ  } | j t j t d d g ƒ ƒ } |  j t | ƒ d k d ƒ d  S(   Nt   libg2ct   libgfortrani   sœ   Both g77 and gfortran runtimes linked in lapack_lite ! This is likely to
cause random crashes and wrong results. See numpy INSTALL.txt for more
information.(   R
   R&   R   t   __file__R	   t   assertFalset   len(   R   t   fR   (    (    s<   /tmp/pip-build-X4mzal/numpy/numpy/linalg/tests/test_build.pyt   test_lapack/   s
    	(   R'   R(   R   t   skipift   syst   platformR1   (    (    (    s<   /tmp/pip-build-X4mzal/numpy/numpy/linalg/tests/test_build.pyR)   -   s   t   __main__(   t
   __future__R    R   R   t
   subprocessR   R   R3   R   t   numpy.linalgR   t   numpy.testingR   R   R   t   numpy.compatR	   t   objectR
   R)   R'   (    (    (    s<   /tmp/pip-build-X4mzal/numpy/numpy/linalg/tests/test_build.pyt   <module>   s    