From d360019cad31899f218d6564a1c2a5073f5666b7 Mon Sep 17 00:00:00 2001 From: Matt Spraggs Date: Mon, 14 Aug 2017 01:36:07 +0100 Subject: [PATCH] Setuptools: Removed custom clang OpenMP flag hack This reverts commit 3bd83b5b04c07204936620c8968dd8846db3a94b. --- pyQCD/utils/build/__init__.py | 26 ++------------------------ pyQCD/utils/build/build_ext.py | 10 ---------- pyQCD/utils/build/build_shared_clib.py | 11 +---------- 3 files changed, 3 insertions(+), 44 deletions(-) diff --git a/pyQCD/utils/build/__init__.py b/pyQCD/utils/build/__init__.py index 5bd7c614..b524e132 100644 --- a/pyQCD/utils/build/__init__.py +++ b/pyQCD/utils/build/__init__.py @@ -15,10 +15,8 @@ "/usr/local", "/usr", "/opt", "/"] -# N.B. Only use these lists for flags that are globally compatible (i.e. every -# supported compiler, every supported platform). -compiler_args = ["-std=c++11", "-O3"] -linker_args = [] +compiler_args = ["-std=c++11", "-O3", "-fopenmp"] +linker_args = ["-lgomp"] header_search_files = ["signature_of_eigen3_matrix_library"] extension_sources = { @@ -34,26 +32,6 @@ } -def generate_flags(compiler): - """Generate flags for given compiler""" - - compiler_flags = ["-std=c++11", "-O3"] - linker_flags = [] - - args = compiler.compiler - - if "clang" in args[0] or "clang++" in args[0]: - compiler_flags.append("-fopenmp=libomp") - linker_flags.append("-fopenmp=libomp") - else: - compiler_flags.append("-fopenmp") - linker_flags.append("-lgomp") - - return compiler_flags, linker_flags - - import IPython; IPython.embed(); raise KeyboardInterrupt - - def generate_include_dirs(): """Locate required include directories""" include_dirs = ["./pyQCD"] diff --git a/pyQCD/utils/build/build_ext.py b/pyQCD/utils/build/build_ext.py index 6251332b..c622a068 100644 --- a/pyQCD/utils/build/build_ext.py +++ b/pyQCD/utils/build/build_ext.py @@ -37,8 +37,6 @@ def finalize_options(self): ext.library_dirs.extend(libdirs) def run(self): - - from pyQCD.utils.build import generate_flags # Code below is lovingly spliced together from setuptools and distutils # build_ext implementations, minus some code @@ -105,14 +103,6 @@ def run(self): if self.link_objects is not None: self.compiler.set_link_objects(self.link_objects) - compile_args, link_args = generate_flags(self.compiler) - for ext in self.extensions: - ext.extra_compile_args = ext.extra_compile_args or [] - ext.extra_link_args = ext.extra_link_args or [] - - ext.extra_compile_args.extend(compile_args) - ext.extra_link_args.extend(link_args) - # Now actually compile and link everything. self.build_extensions() diff --git a/pyQCD/utils/build/build_shared_clib.py b/pyQCD/utils/build/build_shared_clib.py index 8ca75159..c31a1c39 100644 --- a/pyQCD/utils/build/build_shared_clib.py +++ b/pyQCD/utils/build/build_shared_clib.py @@ -99,9 +99,6 @@ def finalize_options(self): self.include_dirs = self.include_dirs.split(os.pathsep) def run(self): - - from pyQCD.utils.build import generate_flags - if not self.libraries: return @@ -122,12 +119,6 @@ def run(self): for macro in self.undef: self.compiler.undefine_macro(macro) - compile_args, link_args = generate_flags(self.compiler) - - for lib_name, build_info in self.libraries: - build_info["extra_compile_args"].extend(compile_args) - build_info["extra_link_args"].extend(link_args) - old_inplace, self.inplace = self.inplace, 0 self.build_libraries(self.libraries) self.inplace = old_inplace @@ -259,4 +250,4 @@ def copy_libraries_to_output(self): copy_file( src_filename, dest_filename, verbose=self.verbose, dry_run=self.dry_run - ) + ) \ No newline at end of file