B
    `                 @   sr   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 G dd dZG dd	 d	eZdS )
    )callPIPEPopenN)assert_)asbytes)_flapackc               @   s$   e Zd Zdd Zdd Zdd ZdS )FindDependenciesLddc             C   sD   dg| _ yt| j ttd W n" tk
r>   td| j  Y nX d S )NZldd)stdoutstderrzcommand %s cannot be run)cmdr   r   OSErrorRuntimeError)self r   L/home/dcms/DCMS/lib/python3.7/site-packages/scipy/linalg/tests/test_build.py__init__   s
    zFindDependenciesLdd.__init__c             C   s<   t | j|g ttd}| \}}|jdks8td| |S )N)r	   r
   r   z#Failed to check dependencies for %s)r   r   r   communicate
returncoder   )r   filepr	   r
   r   r   r   get_dependencies   s
    
z$FindDependenciesLdd.get_dependenciesc       	      C   s`   |  |}tdd |D }g }x:| D ].}x(| D ]\}}||r8|| q8W q*W |S )Nc             S   s"   g | ]}t |tt |fqS r   )r   recompile).0depr   r   r   
<listcomp>#   s    z9FindDependenciesLdd.grep_dependencies.<locals>.<listcomp>)r   dict
splitlinesitemssearchappend)	r   r   depsr	   ZrdepsZfoundslkvr   r   r   grep_dependencies    s    

z%FindDependenciesLdd.grep_dependenciesN)__name__
__module____qualname__r   r   r%   r   r   r   r   r      s   r   c               @   s4   e Zd Zejjejdd dk dddd ZdS )TestF77MismatchN   linuxz8Skipping fortran compiler mismatch on non Linux platform)reasonc             C   s0   t  }|tjddg}tt|dk d d S )NZlibg2cZlibgfortran   zBoth 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%   flapack__file__r   len)r   fr!   r   r   r   test_lapack.   s
    
zTestF77Mismatch.test_lapack)	r&   r'   r(   pytestmarkZskipifsysplatformr2   r   r   r   r   r)   -   s   r)   )
subprocessr   r   r   r5   r   r3   Znumpy.testingr   Znumpy.compatr   Zscipy.linalgr   r.   r   objectr)   r   r   r   r   <module>   s   