Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #588 from OP2/wence/feature/unsafe-cflags
Browse files Browse the repository at this point in the history
compilation: Add config option to ignore workaround_cflags
  • Loading branch information
wence- authored Aug 25, 2020
2 parents 9608d18 + 7a22c17 commit 889d800
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyop2/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ def __init__(self, cc, ld=None, cppargs=[], ldargs=[],
self.comm = compilation_comm(comm)
self._cc = os.environ.get(ccenv, cc)
self._ld = os.environ.get('LDSHARED', ld)
self._cppargs = cppargs + configuration['cflags'].split() + self.workaround_cflags
self._cppargs = cppargs + configuration['cflags'].split()
if configuration["use_safe_cflags"]:
self._cppargs += self.workaround_cflags
self._ldargs = ldargs + configuration['ldflags'].split()

@property
Expand Down
4 changes: 4 additions & 0 deletions pyop2/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class Configuration(dict):
to a node-local filesystem too.
:param log_level: How chatty should PyOP2 be? Valid values
are "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL".
:param use_safe_cflags: Apply cflags turning off some compiler
optimisations that are known to be buggy on particular
versions? See :attr:`~.Compiler.workaround_cflags` for details.
:param dump_gencode: Should PyOP2 write the generated code
somewhere for inspection?
:param print_cache_size: Should PyOP2 print the size of caches at
Expand All @@ -80,6 +83,7 @@ class Configuration(dict):
"cflags": ("PYOP2_CFLAGS", str, ""),
"ldflags": ("PYOP2_LDFLAGS", str, ""),
"compute_kernel_flops": ("PYOP2_COMPUTE_KERNEL_FLOPS", bool, False),
"use_safe_cflags": ("PYOP2_USE_SAFE_CFLAGS", bool, True),
"type_check": ("PYOP2_TYPE_CHECK", bool, True),
"check_src_hashes": ("PYOP2_CHECK_SRC_HASHES", bool, True),
"log_level": ("PYOP2_LOG_LEVEL", (str, int), "WARNING"),
Expand Down

0 comments on commit 889d800

Please sign in to comment.