Skip to content

Commit

Permalink
Setuptools: Removed custom clang OpenMP flag hack
Browse files Browse the repository at this point in the history
This reverts commit 3bd83b5.
  • Loading branch information
mspraggs committed Aug 14, 2017
1 parent 990ba73 commit d360019
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
26 changes: 2 additions & 24 deletions pyQCD/utils/build/__init__.py
Expand Up @@ -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 = {
Expand All @@ -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"]
Expand Down
10 changes: 0 additions & 10 deletions pyQCD/utils/build/build_ext.py
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down
11 changes: 1 addition & 10 deletions pyQCD/utils/build/build_shared_clib.py
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -259,4 +250,4 @@ def copy_libraries_to_output(self):
copy_file(
src_filename, dest_filename, verbose=self.verbose,
dry_run=self.dry_run
)
)

0 comments on commit d360019

Please sign in to comment.