2[c#@`sddlmZmZmZddlZddlZddlZddlZddlm Z dZ dZ de fdYZ dZd Zd Zd d d dddddddddddddddddgZdd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4gZd5d6d7d8d9gZddddddddddddddddgZdddddgZdddegZdd d!d#d"d(d+d-d.g Zd d d ddddddd$d%dddd dddddd"d!d#d(d)d*ddddd&d'd+d,d1g#ZgeD]Zedf^q&ZgeD]Zedg^qCZdhdidjgZdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddgZdZdZdZ dZ!dZ"dZ#ddddddddddddddddgZ$ddddddddgZ%ddddddddgZ&e&dddZ'ddddddddddddg Z(ddddddddddddddddgZ)ddddddddddddg Z*ddddddddddddddddgZ+e+dddZ,ddddddddgdgdZ-ddddddddgdgdZ.dZ/dS(i(tdivisiontabsolute_importtprint_functionN(tmingw32i i tMismatchCAPIWarningcB`seZRS((t__name__t __module__(((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyR.scC`sfddlm}|jd}|dkr:tdn|d|j}t|dkrbtStS(s7Return True if a released version of numpy is detected.i(t LooseVersions ../version.pysCould not get versiontvstringiN( tdistutils.versionRt get_versiontNonet ValueErrortversiontlentFalsetTrue(tconfigRtvtpv((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyt is_released1s cC`sitjjd|z:td}td}|j|j}|j}Wdtjd=X|||fS(s Return current C API checksum and the recorded checksum. Return current C API checksum and the recorded checksum for the given version of the C API version. itgenapit numpy_apiN(tsystpathtinsertt __import__t fullapi_hashtfull_apitget_versions_hash(t apiversiont codegen_dirtmRt curapi_hasht apis_hash((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pytget_api_versions=s    cC`sWt||\}}||ksSd}tj|||||tftddndS(s@Emits a MismacthCAPIWarning if the C API version needs updating.sAPI mismatch detected, the C API version numbers have to be updated. Current C api version is %d, with checksum %s, but recorded checksum for C API version %d in codegen_dir/cversions.txt is %s. If functions were added in the C API, you have to update C_API_VERSION in %s.t stackleveliN(R#twarningstwarnt__file__R(RRR!tapi_hashtmsg((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pytcheck_api_versionRs  tsintcosttantsinhtcoshttanhtfabstfloortceiltsqrttlog10tlogtexptasintacostatantfmodtmodftfrexptldexptexpm1tlog1ptacoshtasinhtatanhtrintttrunctexp2tlog2thypottatan2tpowtcopysignt nextaftertftellotfseekotstrtolltstrtoulltcbrtt strtold_lt fallocatet backtraces xmmintrin.hs emmintrin.hs features.hs xlocale.hsdlfcn.ht__builtin_isnans5.t__builtin_isinft__builtin_isfinitet__builtin_bswap32t5ut__builtin_bswap64t__builtin_expects5, 0t__builtin_mul_overflows 5, 5, (int*)5s'volatile int r = __builtin_cpu_supportss"sse"sstdio.ht__BUILTIN_CPU_SUPPORTSt _m_from_int64t0t _mm_load_pss (float*)0t _mm_prefetchs(float*)0, _MM_HINT_NTAt _mm_load_pds (double*)0t__builtin_prefetchs(float*)0, 0, 3s__asm__ volatiles"vpand %xmm1, %xmm2, %xmm3"tLINK_AVXs"vpand %ymm1, %ymm2, %ymm3"t LINK_AVX2s"xgetbv"tXGETBVs)__attribute__((optimize("unroll-loops")))tattribute_optimize_unroll_loopss__attribute__((optimize("O3")))tattribute_optimize_opt_3s__attribute__((nonnull (1)))tattribute_nonnulls__attribute__((target ("avx")))tattribute_target_avxs __attribute__((target ("avx2")))tattribute_target_avx2t__threads__declspec(thread)tftlscomplex doubles complex floatscomplex long doubletcabstcacostcacoshtcargtcasintcasinhtcatantcatanhtccostccoshtcexptcimagtclogtconjtcpowtcprojtcrealtcsintcsinhtcsqrttctantctanhcC`sd|jS(NsHAVE_%s(tupper(tname((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyt fname2defscC`s|jdd}|jS(Nt t(treplaceR(tsymboltdefine((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pytsym2defscC`s|jdd}|jS(NRt_(RR(RR((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyttype2defsc C`s|jtidd6}tjdkrht rhy|jjjdWqtt fk rdqXntjdkr|jj j drd|jj kr|jj j dd}|jjd |d |d |d |d |dn|j|ddd\}}zytt|}|SWnt k r|j dd}|d7}|j|ddd\}}|jjd|jj|gdttd}|SXWd|jXdS(Ns long doublettypetwin32s/GLtintels-ipos -ipoRtcompilert compiler_sot compiler_cxxt linker_exet linker_sos -sharedtctstructsvolatile structsint main(void) { return 0; } t _configtest(t_check_compilertLONG_DOUBLE_REPRESENTATION_SRCRtplatformRRtcompile_optionstremovetAttributeErrorR t compiler_typet startswithtcc_exeRtset_executablest_compileR tlong_double_representationtpyodt temp_filestappendtlink_executablet_clean(tcmdtbodyt newcompilertsrctobjtltype((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyt check_long_double_representations>     sA /* "before" is 16 bytes to ensure there's no padding between it and "x". * We're not expecting any "long double" bigger than 16 bytes or with * alignment requirements stricter than 16 bytes. */ typedef %(type)s test_type; struct { char before[16]; test_type x; char after[8]; } foo = { { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\001', '\043', '\105', '\147', '\211', '\253', '\315', '\357' }, -123456789.0, { '\376', '\334', '\272', '\230', '\166', '\124', '\062', '\020' } }; c`sCfd}fd}tjddkr8|S|SdS(sPython implementation of the od UNIX utility (od -b, more exactly). Parameters ---------- filename : str name of the file to get the dump from. Returns ------- out : seq list of lines of od output Note ---- We only implement enough to get the necessary information for long double representation, this is not intended as a compatible replacement for od. c`sg}td}zg|jD]*}ttttj|d^q%}x~tdt|dD]d}dtt|g}|jg|||d!D]}d|^q|j dj |qnW|SWd|j XdS(Ntrbiis%07ds%03dR( topentreadtinttocttbinasciitb2a_hextrangeRtextendRtjointclose(touttfidtotyotitlineR(tfilename(s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyt_pyod2"s=/c`sg}td}zg|jD]}t|d^q%}xtdt|dD]n}dtt|dg}|jg|||d!D]}dt|^q|jdj|qZW|SWd|j XdS(NRiiis%07ds%03dR( RRRRRRRRRR(RRRtyo2RRR(R(s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyt_pyod30s)5iiN(Rt version_info(RRR((Rs6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyRs t000t001t043t105t147t211t253t315t357t376t334t272t230t166t124t062t020t301t235t157t064it240t242t171t353t031t300t326t363t100icC`sdgd}d}xu|D]m}xd|jdD]R}|jd|j||dtkr1tj|}|d tdkr|dd!tkrdS|dd!tkrd Sq|d td kr?|d d!t krd S|d d!t krd S|d d!t krd S|d d!t kr%dS|d d!t krdSq|d tkr|dd!tkrfdS|dd!tkrdSqq1q1WqW|dk rtd|ntd|dS(sSGiven a binary dump as given by GNU od -b, look for long double representation.Ri iiii itINTEL_EXTENDED_12_BYTES_LEtMOTOROLA_EXTENDED_12_BYTES_BEitINTEL_EXTENDED_16_BYTES_LEt IEEE_QUAD_BEt IEEE_QUAD_LEtIBM_DOUBLE_DOUBLE_LEtIBM_DOUBLE_DOUBLE_BEitIEEE_DOUBLE_LEtIEEE_DOUBLE_BEsUnrecognized format (%s)sCould not lock sequences (%s)N(R tsplittpopRt _AFTER_SEQtcopyt _BEFORE_SEQt_INTEL_EXTENDED_12Bt_MOTOROLA_EXTENDED_12Bt_INTEL_EXTENDED_16Bt_IEEE_QUAD_PREC_BEt_IEEE_QUAD_PREC_LEt_IBM_DOUBLE_DOUBLE_LEt_IBM_DOUBLE_DOUBLE_BEt_IEEE_DOUBLE_LEt_IEEE_DOUBLE_BER (tlinesRtsawRtw((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyRWs@     (RUs5.(RVs5.(RWs5.(RXRY(RZRY(R[s5, 0(R\s 5, 5, (int*)5(s'volatile int r = __builtin_cpu_supportss"sse"sstdio.hR](R^R_s emmintrin.h(R`s (float*)0s xmmintrin.h(Ras(float*)0, _MM_HINT_NTAs xmmintrin.h(Rbs (double*)0s emmintrin.h(Rcs(float*)0, 0, 3(s__asm__ volatiles"vpand %xmm1, %xmm2, %xmm3"sstdio.hRd(s__asm__ volatiles"vpand %ymm1, %ymm2, %ymm3"sstdio.hRe(s__asm__ volatiles"xgetbv"sstdio.hRf(s)__attribute__((optimize("unroll-loops")))Rg(s__attribute__((optimize("O3")))Rh(s__attribute__((nonnull (1)))Ri(s__attribute__((target ("avx")))Rj(s __attribute__((target ("avx2")))Rk(0t __future__RRRRR%RRtnumpy.distutils.misc_utilRt C_ABI_VERSIONt C_API_VERSIONtWarningRRR#R*tMANDATORY_FUNCStOPTIONAL_STDFUNCStOPTIONAL_HEADERStOPTIONAL_INTRINSICStOPTIONAL_FUNCTION_ATTRIBUTEStOPTIONAL_VARIABLE_ATTRIBUTEStOPTIONAL_STDFUNCS_MAYBEt C99_FUNCSRmtC99_FUNCS_SINGLEtC99_FUNCS_EXTENDEDtC99_COMPLEX_TYPEStC99_COMPLEX_FUNCSRRRRRRRRRRRRRRRRRR(((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/setup_common.pyts                  > 3