o
    Ge                     @   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   sH   dg| _ zt| j ttd W d S  ty# } ztd| j  |d }~ww )Nlddstdoutstderrzcommand %s cannot be run)cmdr   r   OSErrorRuntimeError)selfe r   g/var/www/html/SPIRAL.web.tool/spiral_venv/lib/python3.10/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st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 ]\}}||r(|| qq|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
   rdeps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 )Nlibg2c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markskipifsysplatformr:   r   r   r   r   r/   -   s
    r/   )
subprocessr   r   r   r>   r   r;   numpy.testingr   scipy.linalgr   r6   r   r/   r   r   r   r   <module>   s    