diff options
author | Matti Picus <matti.picus@gmail.com> | 2021-01-03 09:22:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-03 09:22:18 +0200 |
commit | 555b3d8e10745bed72e25e70465ac447009fa8d2 (patch) | |
tree | feffae5d3635d9414aea67315f4ad2298be98782 /numpy/distutils/command/build_ext.py | |
parent | d4f7d9e215773e979eb43a1e5a3cbb51f96bd09d (diff) | |
parent | ce6cd579d4accd81edfd96fd8b7923455d5a9e61 (diff) | |
download | numpy-555b3d8e10745bed72e25e70465ac447009fa8d2.tar.gz |
Merge pull request #18100 from seiko2plus/issue_18092
BUG, BLD: Generate the main dispatcher config header into the build dir
Diffstat (limited to 'numpy/distutils/command/build_ext.py')
-rw-r--r-- | numpy/distutils/command/build_ext.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py index ca6f8bcd2..448f7941c 100644 --- a/numpy/distutils/command/build_ext.py +++ b/numpy/distutils/command/build_ext.py @@ -146,11 +146,16 @@ class build_ext (old_build_ext): self.compiler.show_customization() if not self.disable_optimization: - opt_cache_path = os.path.abspath(os.path.join(self.build_temp, 'ccompiler_opt_cache_ext.py')) - self.compiler_opt = new_ccompiler_opt(compiler=self.compiler, - cpu_baseline=self.cpu_baseline, - cpu_dispatch=self.cpu_dispatch, - cache_path=opt_cache_path) + dispatch_hpath = os.path.join("numpy", "distutils", "include", "npy_cpu_dispatch_config.h") + dispatch_hpath = os.path.join(self.get_finalized_command("build_src").build_src, dispatch_hpath) + opt_cache_path = os.path.abspath( + os.path.join(self.build_temp, 'ccompiler_opt_cache_ext.py') + ) + self.compiler_opt = new_ccompiler_opt( + compiler=self.compiler, dispatch_hpath=dispatch_hpath, + cpu_baseline=self.cpu_baseline, cpu_dispatch=self.cpu_dispatch, + cache_path=opt_cache_path + ) if not self.compiler_opt.is_cached(): log.info("Detected changes on compiler optimizations, force rebuilding") self.force = True @@ -416,7 +421,12 @@ class build_ext (old_build_ext): copt_baseline_flags = [] copt_macros = [] if not self.disable_optimization: - copt_build_src = None if self.inplace else self.get_finalized_command("build_src").build_src + bsrc_dir = self.get_finalized_command("build_src").build_src + dispatch_hpath = os.path.join("numpy", "distutils", "include") + dispatch_hpath = os.path.join(bsrc_dir, dispatch_hpath) + include_dirs.append(dispatch_hpath) + + copt_build_src = None if self.inplace else bsrc_dir copt_c_sources = [ c_sources.pop(c_sources.index(src)) for src in c_sources[:] if src.endswith(".dispatch.c") |