Current File : //usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pyo
�
E�`Qc@s�ddlZddlZddlZddlZddlmZddlTddlmZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZmZmZmZmZddlmZd�Zdd
�Zeede�ddd�Z eede �dddddddd�Z!eede!�dHd�Z"eede"�d�Z#d�Z$eede$�dd�Z%eede%�dddd�Z&e'dgd�Z(eede(�d �Z)eed!e)�dIe*d%<dJe*d(<dKe*d+<dLe*d/<ej+dMdNdOdPf7_+ej,d1kr�dQe*d5<e�r�ej-d6�dSej+e_+q�ne.Z/dddddd8�Z.e.e_.e0Z1d9�Z0e0e_0xVd:d;d<d=d>gD]?Z2ej3j4d?e2d@�Z5e5dk	r�e6e5dAe0�q�q�We7Z8dB�Z7e7e_7ddlZddl9Z9ej:dCe9j;�Z<ej:dD�Z=ej:dE�Z>ej:dF�Z?dG�Z@e@e_@e�dS(Ti����N(tcopy(t*(t	ccompiler(tDistutilsExecErrortDistutilsModuleErrortDistutilsPlatformError(tcustomize_compiler(tLooseVersion(tlog(texec_command(t	cyg2win32tis_sequencetmingw32t
quote_argst
msvc_on_amd64(t
get_exceptioncsNtjddkr+tj�d|�}n�fd�}t|||�dS(Niics�|||�S(N((tselftargstkw(tfunc(s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pyt<lambda>s(tsystversion_infottypest
MethodTypetNonetsetattr(tklasstmethod_nameRtm((Rs?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytreplace_methodscCs�|dkr9|}t|�r9djt|��}q9ntj|�t|�\}}|r�t|�r�djt|��}ny	|GHWntk
r�nXtj	d|�r�d}nd}t
d|||f��ndS(s�
    Execute a command in a sub-process.

    Parameters
    ----------
    cmd : str
        The command to execute.
    display : str or sequence of str, optional
        The text to add to the log file kept by `numpy.distutils`.
        If not given, `display` is equal to `cmd`.

    Returns
    -------
    None

    Raises
    ------
    DistutilsExecError
        If the command failed, i.e. the exit status was not 0.

    t sToo many open filess2
Try rerunning setup command until build succeeds.ts)Command "%s" failed with exit status %d%sN(RRtjointlistRtinfoR	tUnicodeErrortretsearchR(Rtcmdtdisplaytstotmsg((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytCCompiler_spawns"
	
	tspawniR cCsG|dkrd}ng}x%|D]}tjjtjj|��\}}tjj|�d}|tjj|�}|jd�r�|jd�d}|| }	tjj	tjj
|	��}	|	||}n||jkr�td||f��n|rtjj	|�}ntjj
|||j�}
|j|
�q"W|S(s�
    Return the name of the object files for the given source files.

    Parameters
    ----------
    source_filenames : list of str
        The list of paths to source files. Paths can be either relative or
        absolute, this is handled transparently.
    strip_dir : bool, optional
        Whether to strip the directory from the returned paths. If True,
        the file name prepended by `output_dir` is returned. Default is False.
    output_dir : str, optional
        If given, this path is prepended to the returned paths to the
        object files.

    Returns
    -------
    obj_names : list of str
        The list of paths to the object files corresponding to the source
        files in `source_filenames`.

    R is..is"unknown file type '%s' (from '%s')N(Rtostpathtsplitexttnormpatht
splitdrivetisabst
startswithtrfindtbasenametabspathtsrc_extensionstUnknownFileErrorR!t
obj_extensiontappend(Rtsource_filenamest	strip_dirt
output_dirt	obj_namestsrc_nametbasetexttitdtobj_name((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytCCompiler_object_filenamesJs&	
$
tobject_filenamesc	CsK|s
gStjddkr0ddlm}	nddlm}	t||	�r�g}
x\dddgD]K}t|d|�}|dkr�qen|
jd	|d
j	|�f�qeWdj	|
�}
n|j
}
dd
j	|
�f}
tj|
�|j
||||||�\}}}}}|j|||�}d
d
j	|�}
|rg|
dd
j	|�7}
ntj|
�t||	�r|j�}x�|D]k}||kr�||\}}|jdkr�t|�}t|�}n|j||||||�q�q�Wn?x<|j�D].\}\}}|j||||||�qW|S(s�
    Compile one or more source files.

    Please refer to the Python distutils API reference for more details.

    Parameters
    ----------
    sources : list of str
        A list of filenames
    output_dir : str, optional
        Path to the output directory.
    macros : list of tuples
        A list of macro definitions.
    include_dirs : list of str, optional
        The directories to add to the default include file search path for
        this compilation only.
    debug : bool, optional
        Whether or not to output debug symbols in or alongside the object
        file(s).
    extra_preargs, extra_postargs : ?
        Extra pre- and post-arguments.
    depends : list of str, optional
        A list of file names that all targets depend on.

    Returns
    -------
    objects : list of str
        A list of object file names, one per source file `sources`.

    Raises
    ------
    CompileError
        If compilation fails.

    iii����(t	FCompilertf77tf90tfixt	compiler_sFortran %s compiler: %sRs
sC compiler: %s
scompile options: '%s's
extra options: '%s'tabsoftN(RRt	fcompilerRHtnumpy.distutils.fcompilert
isinstancetgetattrRR;R!tcompiler_soRR#t_setup_compilet_get_cc_argstkeyst
compiler_typeR
t_compiletitems(RtsourcesR>tmacrostinclude_dirstdebugt
extra_preargstextra_postargstdependsRHR(tfctfcomptccomptobjectstpp_optstbuildtcc_argstobjects_to_buildtobjtsrcRB((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytCCompiler_compileysF)$	


& tcompilecsKtjd|jj�jjf���fd�}|d�rT|j�j�n|d�r�x*�jD]\}}|j||�qjWn|d�r�x!�jD]}|j	|�q�Wn|d�r�|j
|j�j�n|d�r	|j|j
�j
�n|d�r(|j�j�n|d	�rG|j�j�nd
S(s�
    Customize compiler using distutils command.

    Parameters
    ----------
    cmd : class instance
        An instance inheriting from `distutils.cmd.Command`.
    ignore : sequence of str, optional
        List of `CCompiler` commands (without ``'set_'``) that should not be
        altered. Strings that are checked for are:
        ``('include_dirs', 'define', 'undef', 'libraries', 'library_dirs',
        'rpath', 'link_objects')``.

    Returns
    -------
    None

    scustomize %s using %scs"t�|d�dk	o!|�kS(N(RQR(tattr(R'tignore(s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytallow�sR[tdefinetundeft	librariestlibrary_dirstrpathtlink_objectsN(RR#t	__class__t__name__tset_include_dirsR[Rotdefine_macroRptundefine_macrot
set_librariesRqtset_library_dirsRrtset_runtime_library_dirsRstset_link_objectsRt(RR'RmRntnametvaluetmacro((R'Rms?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytCCompiler_customize_cmd�s&t
customize_cmdc	
Csg}d}|jj�}xHdddddddd	d
dg
D]"}||kr@|j|�q@q@Wx]|D]U}t||�rmt||�}t|t|��}|j|t|�f�qmqmWg}dt|d
�d}x|D]}|j||�q�Wdj|�S(NitversionRqRrt
object_switchtcompile_switchR[RoRpRsRts%-iss = %ss
(	texecutablesRUR;thasattrRQtmaxtlentreprR!(	tcompilertpropstmxRUtkeytvtlinestformattprop((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pyt_compiler_to_string�s$
 
cCsVy|j�WnnXtjjdkrRddGH|jGHt|�GHddGHndS(s�
    Print the compiler customizations to stdout.

    Parameters
    ----------
    None

    Returns
    -------
    None

    Notes
    -----
    Printing is only done if the distutils log threshold is < 2.

    iRiPN(tget_versionRt_global_logt	thresholdRuR�(R((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytCCompiler_show_customizations	tshow_customizationcCs(tjd|jj�t|�|r$y|jjd�Wnttfk
rTnXt	|d�r�d|j
dkr�|js!|j
djd�r�d
\}}nd\}}|j
dj
||�g|j
d	|_q!q$t	|d�r
tjd
|j
f�ntjd|jj�ndS(sm
    Do any platform-specific customization of a compiler instance.

    This method calls `distutils.sysconfig.customize_compiler` for
    platform-specific customization, as well as optionally remove a flag
    to suppress spurious warnings in case C++ code is being compiled.

    Parameters
    ----------
    dist : object
        This parameter is not used for anything.
    need_cxx : bool, optional
        Whether or not C++ has to be compiled. If so (True), the
        ``"-Wstrict-prototypes"`` option is removed to prevent spurious
        warnings. Default is False.

    Returns
    -------
    None

    Notes
    -----
    All the default options used by distutils can be extracted with::

      from distutils import sysconfig
      sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'BASECFLAGS',
                                'CCSHARED', 'LDSHARED', 'SO')

    scustomize %ss-Wstrict-prototypesR�tccitgccsg++sc++is#### %s #######sMissing compiler_cxx fix for N(sgccsg++(R�sc++(RR#RuRvRRRtremovetAttributeErrort
ValueErrorR�R�tcompiler_cxxR4treplacetwarn(Rtdisttneed_cxxtatb((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytCCompiler_customize6s$
"	t	customizes[-.\d]+cs���fd�}|S(sU
    Simple matching of version numbers, for use in CCompiler and FCompiler.

    Parameters
    ----------
    pat : str, optional
        A regular expression matching version numbers.
        Default is ``r'[-.\d]+'``.
    ignore : str, optional
        A regular expression matching patterns to skip.
        Default is ``''``, in which case nothing is skipped.
    start : str, optional
        A regular expression matching the start of where to start looking
        for version numbers.
        Default is ``''``, in which case searching is started at the
        beginning of the version string given to `matcher`.

    Returns
    -------
    matcher : callable
        A function that is appropriate to use as the ``.version_match``
        attribute of a `CCompiler` class. `matcher` takes a single parameter,
        a version string.

    cs�|jdd�}d}�rItj�|�}|s:dS|j�}nxWtj�||�}|sldS�r�tj�|jd��r�|j�}qLnPqL|jd�S(Ns
Ri(R�R%tmatchRtendR&tgroup(Rtversion_stringtposR(Rmtpattstart(s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytmatcher�s !((R�RmR�R�((RmR�R�s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytsimple_version_matchpscs|rt|d�r|jS|j�y
|j}Wntk
rHdSX|s[|dr_dSy
|j}WnBtk
r�y
|j�Wntk
r�dSX�fd�}nXt|dd�\}}d}||kr�||�}|r�t	|�}q�n||_|S(s�
    Return compiler version, or None if compiler is not available.

    Parameters
    ----------
    force : bool, optional
        If True, force a new determination of the version, even if the
        compiler already has a version attribute. Default is False.
    ok_status : list of int, optional
        The list of status values returned by the version look-up process
        for which a version string is returned. If the status value is not
        in `ok_status`, None is returned. Default is ``[0]``.

    Returns
    -------
    version : str or None
        Version string, in the format of `distutils.version.LooseVersion`.

    R�ics/tj�|�}|sdS|jd�}|S(NR�(R%R�RR�(R�RR�(R�(s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pyR��s
tuse_teeN(
R�R�tfind_executablestversion_cmdR�Rt
version_matchtversion_patternR	R(Rtforcet	ok_statusR�R�tstatustoutputR�((R�s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytCCompiler_get_version�s2






	R�cCs�|jdkr|St|�}|jdg|jd|_tjjd�r�d|jdkr�|jd|jdg|jd|_n|jdg|jd|_|S(s�
    Return the C++ compiler.

    Parameters
    ----------
    None

    Returns
    -------
    cxx : class instance
        The C++ compiler, as a `CCompiler` instance.

    tmsvciitaixt	ld_so_aixi(RVRR�RRRtplatformR4t	linker_so(Rtcxx((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytCCompiler_cxx_compiler�s%tcxx_compilertintelccompilertIntelCCompilers(Intel C Compiler for 32-bit applicationstinteltIntelItaniumCCompilers7Intel C Itanium Compiler for Itanium-based applicationstinteletIntelEM64TCCompilers(Intel C Compiler for 64-bit applicationstintelemt
pathccompilertPathScaleCCompilers2PathScale Compiler for SiCortex-based applicationstpathccslinux.*twin32tmingw32ccompilertMingw32CCompilers>Mingw32 port of GNU C Compiler for Win32(for MSC built Python)Rs+Setting mingw32 as default compiler for nt.tntcCs�|dkrtj}ny2|dkr6t|�}nt|\}}}WnDtk
r�d|}|dk	r�|d|}nt|��nXd|}yt|�Wn�tk
r,t	t
��}tjdt	|��|d}yt|�Wq-tk
r(t	t
��}t
d|��q-XnXy!tj|}	t|	�|}
Wn+tk
r{t
dd||f��nX|
d||�}tjd	|
�|S(
Ns5don't know how to compile C/C++ code on platform '%s's with '%s' compilersnumpy.distutils.s,%s in numpy.distutils; trying from distutilsis4can't compile C/C++ code: unable to load module '%s's4can't compile C/C++ code: unable to find class '%s' sin module '%s'snew_compiler returns %s(RR.R~tget_default_compilertcompiler_classtKeyErrorRt
__import__tImportErrortstrRRR#RRtmodulestvarsR\(tplatR�tverbosetdry_runR�tmodule_namet
class_nametlong_descriptionR+tmoduleR((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytnew_compilersD



	




cCswt|�}t|�}t||||�}g}x=|D]5}t|�rb|jt|��q:|j|�q:W|S(N(R
t_distutils_gen_lib_optionsRtextendR"R;(R�Rrtruntime_library_dirsRqtrtlib_optsRC((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytgen_lib_options7s	
R�tbcpptcygwinctemxctunixcs
distutils.R�R�cCst|�}t||�S(N(R
t!_distutils_gen_preprocess_options(RZR[((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytgen_preprocess_optionsNss
[^\\\'\"%s ]*s'(?:[^'\\]|\\.)*'s"(?:[^"\\]|\\.)*"s\scCs�|j�}g}d}x�|r�tj||�}|j�}|t|�krf|j|| �Pn||tjkr�|j|| �||j�}d}n(||dkr�|| ||d}|d}n�||dkr�t	j||�}n9||dkr t
j||�}ntd||��|dkrWt
d||��n|j�\}}tj||d|d!�r�|| ||d|d!||}|j�d}n|j�}|t|�kr|j|�PqqW|S(	Nis\it't"s!this can't happen (bad char '%c')s"bad string (mismatched %s quotes?)i(tstript
_wordchars_reR�R�R�R;tstringt
whitespacetlstript
_squote_ret
_dquote_retRuntimeErrorRR�tspant
_has_white_reR&(R)twordsR�RR�tbeg((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pytsplit_quoted^s@		
%
((R�R�s(Intel C Compiler for 32-bit applications(R�R�s7Intel C Itanium Compiler for Itanium-based applications(R�R�s(Intel C Compiler for 64-bit applications(R�R�s2PathScale Compiler for SiCortex-based applications(slinux.*R�(slinux.*R�(slinux.*R�(slinux.*R�(R�R�s>Mingw32 port of GNU C Compiler for Win32(for MSC built Python)(sntsmingw32((sntsmingw32(AR%R.RRRtdistutils.ccompilert	distutilsRtdistutils.errorsRRRtdistutils.sysconfigRtdistutils.versionRtnumpy.distutilsRtnumpy.distutils.exec_commandR	tnumpy.distutils.misc_utilR
RRR
Rtnumpy.distutils.compatRRRR,t	CCompilerRFRjR�R�R�R�R�tFalseR�R�R�t_default_compilersR�R#R�t_distutils_new_compilerR�R�t_ccR�tgett_mRR�R�R�RkR�R�R�R�R�R�(((s?/usr/lib64/python2.7/site-packages/numpy/distutils/ccompiler.pyt<module>s�
(		*-	U)		#8/5	





	
%						/