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_clib.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_clib.py')
-rw-r--r-- | numpy/distutils/command/build_clib.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/numpy/distutils/command/build_clib.py b/numpy/distutils/command/build_clib.py index a0db6f31f..1b3004c2f 100644 --- a/numpy/distutils/command/build_clib.py +++ b/numpy/distutils/command/build_clib.py @@ -118,12 +118,15 @@ class build_clib(old_build_clib): self.compiler.show_customization() if not self.disable_optimization: + 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_clib.py' - )) + os.path.join(self.build_temp, 'ccompiler_opt_cache_clib.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 + 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") @@ -271,7 +274,12 @@ class build_clib(old_build_clib): 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") |