a
    ˜¥»aÔ  ã                   @   sd   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 G dd„ dƒZG dd„ dƒZdS )	é    )ÚcallÚPIPEÚPopenN)Úassert_)Ú_flapackc                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚFindDependenciesLddc              
   C   sV   dg| _ zt| j ttd� W n4 tyP } ztd| j  ƒ|‚W Y d }~n
d }~0 0 d S )NZldd©ÚstdoutÚstderrzcommand %s cannot be run)Úcmdr   r   ÚOSErrorÚRuntimeError)ÚselfÚe© r   úW/home/yuhw/wc/pochoir/venv/lib/python3.9/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 )Nr   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   sX   |   |¡}tdd„ |D ƒƒ}g }| ¡ D ]*}| ¡ D ]\}}| |¡r4| |¡ q4q(|S )Nc                 S   s&   g | ]}|  d ¡t |  d ¡¡f‘qS )Úlatin1)ÚencodeÚ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é   z©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(   ÚflapackÚ__file__r   Úlen)r   Úfr$   r   r   r   Útest_lapack.   s    ÿÿzTestF77Mismatch.test_lapack)	r)   r*   r+   ÚpytestÚmarkZskipifÚsysÚplatformr5   r   r   r   r   r,   -   s   ÿr,   )Ú
subprocessr   r   r   r8   r   r6   Znumpy.testingr   Zscipy.linalgr   r1   r   r,   r   r   r   r   Ú<module>   s   