o
    oh                     @   s,   d dl Z d dlZd dlZd dlZdd ZdS )    Nc                 C   s"  t d}tj|dj| |d}tjd}|d u r5t	d}	t	d}
|
d ur+|
n|	}|d u r5t
dtt dr?t  }nt  }|d	krId
}t j|dd }tdd dD }|||g| }||ddddd|g}|dd |D 7 }|dd |D 7 }|dd |D 7 }tj|tjd |S )N
EXT_SUFFIXz{name}{suffix})namesuffixCCclanggcczFFailed to find C compiler. Please specify via CC environment variable.get_default_schemeposix_localposix_prefix)schemeincludec                 s   s    | ]}t |V  qd S )N)osgetenv).0var r   h/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/triton/runtime/build.py	<genexpr>   s    z_build.<locals>.<genexpr>)TRITON_CUDACRT_PATHTRITON_CUDART_PATHz-O3z-sharedz-fPICz
-Wno-psabiz-oc                 S      g | ]}d | qS )z-lr   )r   libr   r   r   
<listcomp>!       z_build.<locals>.<listcomp>c                 S   r   )z-Lr   r   dirr   r   r   r   "   r   c                 S   s   g | ]}|d urd| qS )Nz-Ir   r   r   r   r   r   #   s    )stdout)	sysconfigget_config_varr   pathjoinformatenvirongetshutilwhichRuntimeErrorhasattrr   _get_default_scheme	get_pathsset
subprocess
check_callDEVNULL)r   srcsrcdirlibrary_dirsinclude_dirs	librariesr   soccr   r   r   py_include_dircustom_backend_dirscc_cmdr   r   r   _build   s.   




r8   )r   r   r$   r+   r8   r   r   r   r   <module>   s
    