
    riii                     n    d Z ddlZddlZddlZddlmZ  G d de          ZdefdZ	dee
         fdZdS )	z/Find the path to xgboost dynamic library files.    N)Listc                       e Zd ZdZdS )XGBoostLibraryNotFoundz)Error thrown by when xgboost is not foundN)__name__
__module____qualname____doc__     U/var/www/html/bet.cuttalo.com/ml/venv/lib/python3.11/site-packages/xgboost/libpath.pyr   r   
   s        3333r   r   returnc                  \    t          t          j                            dd                    S )zP`XGBOOST_BUILD_DOC` is used by the sphinx conf.py to skip building the C++ code.XGBOOST_BUILD_DOCF)boolosenvirongetr
   r   r   is_sphinx_buildr      s!    
2E::;;;r   c                  ^   t           j                            t           j                            t           j                            t
                                        } t           j                            | d          t           j                            | t           j        j        t           j        j        d          t           j                            t          j	        d          g}t          j
        dk    rH|                    t           j                            t          j	        d          t           j                            t          j	        d          t           j                            t          j	        dd          t           j                            t          j	        dd          t           j                            t          j	        dd          t           j                            t          j	        ddd          t           j                            t          j	        ddd          g           d |D             }net          j
                            d          rd |D             }n9t          j
        d	k    rd
 |D             }nt          j
        dk    rd |D             }t          j                    dk    rd |D             }d |D             }|sVt                      sHd}dd                    |          z   dz   | z   dz   t          j	        z   dz   |z   dz   }t          |          |S )zFind the path to xgboost dynamic library files.

    Returns
    -------
    lib_path
       List of all found library path to xgboost
    libwin32binLibraryz	mingw-w64c                 N    g | ]"}t           j                            |d           #S )zxgboost.dllr   pathjoin.0ps     r   
<listcomp>z!find_lib_path.<locals>.<listcomp>3   s(    EEEqBGLLM22EEEr   )linuxfreebsd
emscriptenc                 N    g | ]"}t           j                            |d           #S zlibxgboost.sor   r   s     r   r!   z!find_lib_path.<locals>.<listcomp>5   (    GGGBGLLO44GGGr   darwinc                 N    g | ]"}t           j                            |d           #S )zlibxgboost.dylibr   r   s     r   r!   z!find_lib_path.<locals>.<listcomp>7   s)    JJJABGLL$677JJJr   cygwinc                 N    g | ]"}t           j                            |d           #S )zcygxgboost.dllr   r   s     r   r!   z!find_lib_path.<locals>.<listcomp>9   s)    HHH!BGLL$455HHHr   OS400c                 N    g | ]"}t           j                            |d           #S r&   r   r   s     r   r!   z!find_lib_path.<locals>.<listcomp>;   r'   r   c                     g | ]B}t           j                            |          !t           j                            |          @|CS r
   )r   r   existsisfiler   s     r   r!   z!find_lib_path.<locals>.<listcomp>=   s>    OOOarw~~a'8'8ORW^^A=N=NOOOOr   z5https://xgboost.readthedocs.io/en/stable/install.htmlzJCannot find XGBoost Library in the candidate path.  List of candidates:
- z
- z
XGBoost Python package path: z
sys.base_prefix: z
See: z for installing XGBoost.)r   r   dirnameabspath
expanduser__file__r   pardirsysbase_prefixplatformextend
startswithsystemr   r   )	curr_pathdll_pathlib_pathlinkmsgs        r   find_lib_pathrA      s    0B0B80L0L M MNNI 	Y&&
YFF 	S_e,,H |wS_e44S_i88S_i??S_i??S_iEES_ieLLS_ieLL
	
 
	
 
	
 FEHEEE		 	 !C	D	D IGGhGGG		!	!JJJJJ		!	!HHxHHHG##GGhGGGOO8OOOH *O-- *F({{8$$& 00 	
 $$ o   )	) 	 %S)))Or   )r	   r   r8   r6   typingr   	Exceptionr   r   r   strrA   r
   r   r   <module>rE      s    5 5 				  



      4 4 4 4 4Y 4 4 4< < < < <
;tCy ; ; ; ; ; ;r   