
    Ug                     B    d Z ddlZddlZddlZddlZddlmZ d Zd ZdS )z,Helpers for OpenMP support during the build.    N   )compile_test_programc                      t           j        dk    rdgS t           j        dk    rdt          j        dd          v rg S dgS )Nwin32z/openmpdarwinopenmpCPPFLAGS z-fopenmp)sysplatformosgetenv     b/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/sklearn/_build_utils/openmp_helpers.pyget_openmp_flagr      sI    
|w{		!	!h")J2K2K&K&K 	<r   c                     dt           j        v rdS t          j        d          } t          j        dd          }|3|                                                    d          }d |D             }t                      }d}	 t          | ||          }|r^d	|d
         v rTt          |d
                                                             d          d                   }t          |          |k    }ndt           j        v rd}nd}n# t          $ r}d}|}Y d}~nd}~ww xY w|sLt          j        d          rt          d          |t          j        d          }t          j        |           |S )z6Check whether OpenMP test code can be compiled and runPYODIDEFz        #include <omp.h>
        #include <stdio.h>
        int main(void) {
        #pragma omp parallel
        printf("nthreads=%d\n", omp_get_num_threads());
        return 0;
        }
        LDFLAGSN c                 <    g | ]}|                     d           |S ))z-Lz
-Wl,-rpathz-lz-Wl,--sysroot=/)
startswith).0flags     r   
<listcomp>z(check_openmp_support.<locals>.<listcomp>:   s;     
 
 
LMM

 
 
r   )extra_preargsextra_postargsz	nthreads=r   =r   PYTHON_CROSSENVTSKLEARN_FAIL_NO_OPENMPz0Failed to build scikit-learn with OpenMP supportas  

                                ***********
                                * WARNING *
                                ***********

                It seems that scikit-learn cannot be built with OpenMP.

                - Make sure you have followed the installation instructions:

                    https://scikit-learn.org/dev/developers/advanced_installation.html

                - If your compiler supports OpenMP but you still see this
                  message, please submit a bug report at:

                    https://github.com/scikit-learn/scikit-learn/issues

                - The build will continue with OpenMP-based parallelism
                  disabled. Note however that some estimators will run in
                  sequential mode instead of leveraging thread-based
                  parallelism.

                                    ***
                )r   environtextwrapdedentr   stripsplitr   r   intlen	Exceptionwarningswarn)	coder   r   openmp_exceptionoutputnthreadsopenmp_supported	exceptionmessages	            r   check_openmp_supportr2   #   s   BJu?	
 
D Ii..M %++--33C88
 
%
 
 
 %&&N%%n
 
 
  		%kVAY..6!9??,,22377:;;H"6{{h6"*,,  $$ % % % !$%   #9-.. 	#B #$ o G4 M'"""s    BD 
DDD)	__doc__r   r   r"   r)   pre_build_helpersr   r   r2   r   r   r   <module>r5      sp    2 2 
			 



   3 3 3 3 3 3  (\ \ \ \ \r   