1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
U
O±dÂRã@sæddlZddlZddlZddlZddlZddlZddlmZddlm    Z    ddl
m Z ddl m Z ddlmZmZddl
Z
ddlmZddlmZdd    lmZmZmZmZmZmZmZd
e    d <d e    d <Gdd„deƒZGdd„dƒZdS)éN)Úconfig)ÚLANG_EXT)Úlog)Ú    copy_file)Ú CompileErrorÚ    LinkError)Úfilepath_from_subprocess_output)Úgenerate_manifest)Úcheck_gcc_function_attributeÚ,check_gcc_function_attribute_with_intrinsicsÚcheck_gcc_variable_attributeÚcheck_gcc_version_at_leastÚ check_inlineÚcheck_restrictÚcheck_compiler_gccz.fÚf77z.f90Úf90c@sÎeZdZejdg7_dd„Zdd„Zdd„Zdd    „Zd
d „Z    d.dd„Z
d/dd„Z d0dd„Z d1dd„Z d2dd„Zd3dd„Zd4dd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd5d*d+„Zd6d,d-„Zd S)7r)z
fcompiler=Nz!specify the Fortran compiler typecCsd|_t |¡dS©N)Ú    fcompilerÚ
old_configÚinitialize_options©Úself©rúUd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/distutils/command/config.pyr$szconfig.initialize_optionsc
CsDt |¡ddlm}m}tjdkrÞ|jjdkrÞ|jj    sžz|j 
¡WnVt k
rœ}z8t   d¡||jjjf}tt   d¡ƒtj |¡|‚W5d}~XYnXddlm}| ¡dkrÞ|jj|jjfD]}d    |krÆ| d    ¡qÆt|j|ƒs@||j|jd
|jd |_|jdk    r@|j |j¡|j ¡r@|j |¡|j  ¡dS) Nr)Ú    FCompilerÚ new_fcompilerÚwin32)ÚmsvcZintelwZintelemwa>                        Could not initialize compiler instance: do you have Visual Studio
                        installed?  If you are trying to build with MinGW, please use "python setup.py
                        build -c mingw32" instead.  If you have Visual Studio installed, check it is
                        correctly installed, and the right version (VS 2015 as of this writing).
 
                        Original exception was: %s, and the Compiler class was %s
                        ============================================================================zd                        ============================================================================)Ú msvc9compileré
z    /MANIFESTé)ÚcompilerÚdry_runÚforceZ
c_compiler)!rÚ_check_compilerZnumpy.distutils.fcompilerrrÚsysÚplatformr"Ú compiler_typeZ initializedZ
initializeÚIOErrorÚtextwrapÚdedentÚ    __class__Ú__name__ÚprintÚ    distutilsÚerrorsÚDistutilsPlatformErrorrZget_build_versionZldflags_sharedZldflags_shared_debugÚappendÚ
isinstancerr#Z    customizeÚ distributionÚ get_versionZ customize_cmdZshow_customization)rrrÚeÚmsgrZldflagsrrrr%(s@
ÿ ø       ÿ þ   zconfig._check_compilerc    
Cs–ddlm}ddlm}|j}|dkr.|j|_|jdkrF|d|fƒ‚z||f|Ž}Wn2||fk
rŠ}z||_||‚W5d}~XYnX||_|S)Nr)r)ÚDistutilsExecError©rrz%s compiler is not set)Údistutils.ccompilerrÚdistutils.errorsr8r"r)    rZmthÚlangÚargsrr8Z save_compilerÚretr6rrrÚ _wrap_methodXs  
zconfig._wrap_methodcCs4| tj|||||f¡\}}|j |d¡||fS)Nz.d)r?rÚ_compileÚ
temp_filesr2)rÚbodyÚheadersÚ include_dirsr<ÚsrcÚobjrrrr@hs
 
 
ÿzconfig._compilec
CsÊ|jjdkr˜|pgdd…}|p$gdd…}|dkrÂd}|jrÂ|jjpJgD]P}| d¡r’zt dd|g¡}Wnttjfk
rˆYn
Xt    |ƒ}| 
|¡qL|jj p¨gD]}||krª| 
|¡qª|D]Î}| d¡rÖqÆd}    |pàgD],}
t j  |
d|¡} t j  | ¡râd    }    qqâ|    rqÆd}    |D]X}
t j  |
d
|¡} t j  | ¡r t j  |
d|¡} t| | ƒ|j 
| ¡d    }    qzq |    r‚qÆt d ||f¡qÆn|jjd kr®t|ƒ| tj|||||||f¡S) Nrr9Úcz/usr/libZcygpathz-wFz%s.libTzlib%s.az+could not find library %r in directories %sZmingw32)r"r(rÚ library_dirsÚ
startswithÚ
subprocessÚ check_outputÚOSErrorÚCalledProcessErrorrr2Ú    librariesÚosÚpathÚjoinÚisfilerrArÚwarnr    r?rÚ_link) rrBrCrDrNrHr<ÚdÚlibnameZ
fileexistsZlibdirZlibfileZlibfile2rrrrTpsl
ÿ
 
 
 
ÿ
 
ÿÿz config._linkNrGcCs| ¡| d|g|¡S)Nz2/* we need a dummy line to make distutils happy */)r%Ú try_compile)rÚheaderrDrHr<rrrÚ check_header¦s þzconfig.check_headercCs(| ¡t d¡||f}| |||¡S)Nz¨
            int main(void)
            {
            #ifndef %s
                (void) %s;
            #endif
                ;
                return 0;
            }©r%r*r+rW©rÚsymbolrCrDrBrrrÚ
check_decl¬s
ø
zconfig.check_declcCs&| ¡t d¡|f}| |||¡S)NzÇ
            int main(void)
            {
            #if %s
            #else
            #error false or undefined macro
            #endif
                ;
                return 0;
            }rZr[rrrÚcheck_macro_true»s
    ÷ zconfig.check_macro_truecCsp| ¡t d¡d|i}d}zBz | |d|i||d¡d}Wntjjk
r\d}YnXW5| ¡X|S)zYCheck type availability. Return True if the type can be compiled,
        False otherwisez³
            int main(void) {
              if ((%(name)s *) 0)
                return 0;
              if (sizeof (%(name)s))
                return 0;
            }
            ÚnameFÚtyperGT)r%r*r+Ú_cleanr@r/r0r)rÚ    type_namerCrDrHrBÚstrrrÚ
check_typeËs"ù    ÿ
zconfig.check_typec     Csb| ¡t d¡}| |d|i||d¡| ¡|rŒt d¡}|D]F}z,| |||dœ||d¡| ¡|WStk
rˆYqDXqDt d¡}d}d}    z*| |||    dœ||d¡| ¡WqôWqžtk
rð|    d}d    |    d}    YqžXqž|    }
||
kr^|
|d    |}    z*| |||    dœ||d¡| ¡|    }
Wqøtk
rZ|    d}YqøXqø|S)
zCheck size of a given type.a,
            typedef %(type)s npy_check_sizeof_type;
            int main (void)
            {
                static int test_array [1 - 2 * !(((long) (sizeof (npy_check_sizeof_type))) >= 0)];
                test_array [0] = 0
 
                ;
                return 0;
            }
            r`rGaW
                typedef %(type)s npy_check_sizeof_type;
                int main (void)
                {
                    static int test_array [1 - 2 * !(((long) (sizeof (npy_check_sizeof_type))) == %(size)s)];
                    test_array [0] = 0
 
                    ;
                    return 0;
                }
                )r`Úsizea3
            typedef %(type)s npy_check_sizeof_type;
            int main (void)
            {
                static int test_array [1 - 2 * !(((long) (sizeof (npy_check_sizeof_type))) <= %(size)s)];
                test_array [0] = 0
 
                ;
                return 0;
            }
            rr!é)r%r*r+r@rar) rrbrCrDrHÚexpectedrBreÚlowZmidÚhighrrrÚcheck_type_sizeèsb
ÿ
ÿ
 
ÿ
ÿzconfig.check_type_sizeFc    
CsÈ| ¡g}    |r6t|ƒtkr(|     |¡n|     d|¡|     d¡|     d|¡|     d¡|     d¡|r†|dkrrd}|     d||f¡n|     d|¡|     d    ¡|     d
¡d  |    ¡d }    | |    ||||¡S) Núint %s (void);ú#ifdef _MSC_VERú#pragma function(%s)ú#endifúint main (void) {Úú      %s(%s);ú  %s;ú   return 0;Ú}Ú
)r%r`Ústrr2rQÚtry_link)
rÚfuncrCrDrNrHÚdeclÚcallÚ    call_argsrBrrrÚ
check_func;s,  
 
 
 
 
 
ÿzconfig.check_funcc    Cs| ¡g}    |r4| ¡D]\}
} | r|     d|
¡q|     d¡|D]} |     d| ¡qB|     d¡|     d¡|rÎ|D]X}
|
|kr¼||
r¼|rš|
|krš||
s d} n||
} |     d|
| f¡qr|     d|
¡qrn|D]}
|     d|
¡qÒ|     d    ¡|     d
¡d  |    ¡d }    | |    ||||¡S) a0Check a list of functions at once.
 
        This is useful to speed up things, since all the functions in the funcs
        list will be put in one compilation unit.
 
        Arguments
        ---------
        funcs : seq
            list of functions to test
        include_dirs : seq
            list of header paths
        libraries : seq
            list of libraries to link the code snippet to
        library_dirs : seq
            list of library paths
        decl : dict
            for every (key, value), the declaration in the value will be
            used for function in key. If a function is not in the
            dictionary, no declaration will be used.
        call : dict
            for every item (f, value), if the value is True, a call will be
            done to the function f.
        rkrlrmrnrorprqrrrsrtru)r%Úitemsr2rQrw)rÚfuncsrCrDrNrHryrzr{rBÚfÚvrxr=rrrÚcheck_funcs_once]s8
 
 
 
 
 
ÿzconfig.check_funcs_oncecCst|ƒS)zUReturn the inline keyword recognized by the compiler, empty string
        otherwise.)rrrrrršszconfig.check_inlinecCst|ƒS)zWReturn the restrict keyword recognized by the compiler, empty string
        otherwise.)rrrrrrŸszconfig.check_restrictcCst|ƒS)z$Return True if the C compiler is gcc)rrrrrr¤szconfig.check_compiler_gcccCs t|||ƒSr)r
)rÚ    attributer_rrrr
¨sz#config.check_gcc_function_attributecCst|||||ƒSr)r )rr‚r_ÚcodeÚincluderrrr «s
ÿz3config.check_gcc_function_attribute_with_intrinsicscCs
t||ƒSr)r )rr‚rrrr °sz#config.check_gcc_variable_attributercCst||||ƒS)zYReturn True if the GCC version is greater than or equal to the
        specified version.)r )rÚmajorÚminorZ
patchlevelrrrr ³sz!config.check_gcc_version_at_leastc
Cs~tjdtdd| ¡d\}}    z&tƒ}
z&| ||||||¡\} } } |
 ¡Wn$tk
rt|
j}    |
 ¡‚YnXt    j
  d| ¡} zt j | gdd}    WnHt jk
rÆ}z|j}d}    W5d}~XYn$tk
ràd    }d}    Yn
Xt|    ƒ}    tt    d
ƒr8t     |¡}t     |¡r<t     |¡}t d |f¡|tjkr<t‚n|}t d ¡Wn$ttfk
rlt d ¡YnX| ¡||    fS)z®Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'. Returns the exit status code
        of the program and its output.
        zû
+++++++++++++++++++++++++++++++++++++++++++++++++
Usage of get_output is deprecated: please do not 
use it anymore, and avoid configuration checks 
involving running executable on the target machine.
+++++++++++++++++++++++++++++++++++++++++++++++++
rf)Ú
stacklevel)éÿrpÚ.)ÚcwdrpNéÚ WEXITSTATUSz subprocess exited with signal %dzsuccess!zfailure.)ÚwarningsrSÚDeprecationWarningr%Ú
GrabStdoutrTÚrestoreÚ    ExceptionÚdatarOrPrQrJrKrMÚ
returncoderLrÚhasattrrŒÚ WIFSIGNALEDÚWTERMSIGrÚerrorÚsignalÚSIGINTÚKeyboardInterruptÚinforrra)rrBrCrDrNrHr<Zuse_teeÚexitcodeÚoutputZgrabberrErFZexeÚexcZ
exitstatusÚsigrrrÚ
get_output¸sTû
ÿ
 
 
 
 zconfig.get_output)NNrG)NN)NN)NNN)NNNN)NNNNFFN)NNNNFFN)rr)NNNNrGN)r-Ú
__module__Ú __qualname__rÚ user_optionsrr%r?r@rTrYr]r^rdrjr|rrrrr
r r r r rrrrrs`ÿ06
ÿ
ÿ
ÿ
 
Tý
#ý
=
þrc@s,eZdZdd„Zdd„Zdd„Zdd„Zd    S)
rcCstj|_d|_|t_dS)Nrp)r&ÚstdoutÚ
sys_stdoutr’rrrrÚ__init__÷szGrabStdout.__init__cCs|j |¡|j|7_dSr)r¥Úwriter’)rr’rrrr§üs zGrabStdout.writecCs|j ¡dSr)r¥Úflushrrrrr¨szGrabStdout.flushcCs |jt_dSr)r¥r&r¤rrrrrszGrabStdout.restoreN)r-r¡r¢r¦r§r¨rrrrrrõsr)rOr˜rJr&r*rZdistutils.command.configrrrr/rÚdistutils.file_utilrr:rrZnumpy.distutils.exec_commandrZ numpy.distutils.mingw32ccompilerr    Z numpy.distutils.command.autodistr
r r r rrrrrrrrÚ<module>s*      $Y