MCPcopy Create free account
hub / github.com/numpy/numpy / run

Method run

numpy/distutils/command/build_ext.py:96–353  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

94 CCompilerOpt.conf_target_groups["simd_test"] = self.simd_test
95
96 def run(self):
97 if not self.extensions:
98 return
99
100 # Make sure that extension sources are complete.
101 self.run_command('build_src')
102
103 if self.distribution.has_c_libraries():
104 if self.inplace:
105 if self.distribution.have_run.get('build_clib'):
106 log.warn('build_clib already run, it is too late to '
107 'ensure in-place build of build_clib')
108 build_clib = self.distribution.get_command_obj(
109 'build_clib')
110 else:
111 build_clib = self.distribution.get_command_obj(
112 'build_clib')
113 build_clib.inplace = 1
114 build_clib.ensure_finalized()
115 build_clib.run()
116 self.distribution.have_run['build_clib'] = 1
117
118 else:
119 self.run_command('build_clib')
120 build_clib = self.get_finalized_command('build_clib')
121 self.library_dirs.append(build_clib.build_clib)
122 else:
123 build_clib = None
124
125 # Not including C libraries to the list of
126 # extension libraries automatically to prevent
127 # bogus linking commands. Extensions must
128 # explicitly specify the C libraries that they use.
129
130 from distutils.ccompiler import new_compiler
131 from numpy.distutils.fcompiler import new_fcompiler
132
133 compiler_type = self.compiler
134 # Initialize C compiler:
135 self.compiler = new_compiler(compiler=compiler_type,
136 verbose=self.verbose,
137 dry_run=self.dry_run,
138 force=self.force)
139 self.compiler.customize(self.distribution)
140 self.compiler.customize_cmd(self)
141
142 if self.warn_error:
143 self.compiler.compiler.append('-Werror')
144 self.compiler.compiler_so.append('-Werror')
145
146 self.compiler.show_customization()
147
148 if not self.disable_optimization:
149 dispatch_hpath = os.path.join("numpy", "distutils", "include", "npy_cpu_dispatch_config.h")
150 dispatch_hpath = os.path.join(self.get_finalized_command("build_src").build_src, dispatch_hpath)
151 opt_cache_path = os.path.abspath(
152 os.path.join(self.build_temp, 'ccompiler_opt_cache_ext.py')
153 )

Callers

nothing calls this directly

Calls 15

new_compilerFunction · 0.90
new_ccompiler_optFunction · 0.90
has_f_sourcesFunction · 0.90
has_cxx_sourcesFunction · 0.90
new_fcompilerFunction · 0.90
warnMethod · 0.80
customizeMethod · 0.80
cache_flushMethod · 0.80
infoMethod · 0.80
updateMethod · 0.80
listdirMethod · 0.80
endswithMethod · 0.80

Tested by

no test coverage detected