(self)
| 85 | return False |
| 86 | |
| 87 | def run(self): |
| 88 | if not self.libraries: |
| 89 | return |
| 90 | |
| 91 | # Make sure that library sources are complete. |
| 92 | languages = [] |
| 93 | |
| 94 | # Make sure that extension sources are complete. |
| 95 | self.run_command('build_src') |
| 96 | |
| 97 | for (lib_name, build_info) in self.libraries: |
| 98 | l = build_info.get('language', None) |
| 99 | if l and l not in languages: |
| 100 | languages.append(l) |
| 101 | |
| 102 | from distutils.ccompiler import new_compiler |
| 103 | self.compiler = new_compiler(compiler=self.compiler, |
| 104 | dry_run=self.dry_run, |
| 105 | force=self.force) |
| 106 | self.compiler.customize(self.distribution, |
| 107 | need_cxx=self.have_cxx_sources()) |
| 108 | |
| 109 | if self.warn_error: |
| 110 | self.compiler.compiler.append('-Werror') |
| 111 | self.compiler.compiler_so.append('-Werror') |
| 112 | |
| 113 | libraries = self.libraries |
| 114 | self.libraries = None |
| 115 | self.compiler.customize_cmd(self) |
| 116 | self.libraries = libraries |
| 117 | |
| 118 | self.compiler.show_customization() |
| 119 | |
| 120 | if not self.disable_optimization: |
| 121 | dispatch_hpath = os.path.join("numpy", "distutils", "include", "npy_cpu_dispatch_config.h") |
| 122 | dispatch_hpath = os.path.join(self.get_finalized_command("build_src").build_src, dispatch_hpath) |
| 123 | opt_cache_path = os.path.abspath( |
| 124 | os.path.join(self.build_temp, 'ccompiler_opt_cache_clib.py') |
| 125 | ) |
| 126 | if hasattr(self, "compiler_opt"): |
| 127 | # By default `CCompilerOpt` update the cache at the exit of |
| 128 | # the process, which may lead to duplicate building |
| 129 | # (see build_extension()/force_rebuild) if run() called |
| 130 | # multiple times within the same os process/thread without |
| 131 | # giving the chance the previous instances of `CCompilerOpt` |
| 132 | # to update the cache. |
| 133 | self.compiler_opt.cache_flush() |
| 134 | |
| 135 | self.compiler_opt = new_ccompiler_opt( |
| 136 | compiler=self.compiler, dispatch_hpath=dispatch_hpath, |
| 137 | cpu_baseline=self.cpu_baseline, cpu_dispatch=self.cpu_dispatch, |
| 138 | cache_path=opt_cache_path |
| 139 | ) |
| 140 | def report(copt): |
| 141 | log.info("\n########### CLIB COMPILER OPTIMIZATION ###########") |
| 142 | log.info(copt.report(full=True)) |
| 143 | |
| 144 | import atexit |
nothing calls this directly
no test coverage detected