Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
- id: pyupgrade

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
rev: 26.1.0
hooks:
- id: black

Expand Down
18 changes: 6 additions & 12 deletions tools/build_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ def compile_test_program(code, extra_preargs=None, extra_postargs=None):

def basic_check_build():
"""Check basic compilation and linking of C code."""
code = textwrap.dedent(
"""\
code = textwrap.dedent("""\
#include <stdio.h>
int main(void) {
return 0;
}
"""
)
""")
compile_test_program(code)


Expand All @@ -99,17 +97,15 @@ def get_openmp_flag(compiler):

def check_openmp_support(compiler):
"""Check whether OpenMP test code can be compiled and run."""
code = textwrap.dedent(
"""\
code = textwrap.dedent("""\
#include <omp.h>
#include <stdio.h>
int main(void) {
#pragma omp parallel
printf("nthreads=%d\\n", omp_get_num_threads());
return 0;
}
"""
)
""")
extra_preargs = os.getenv("LDFLAGS", None)
if extra_preargs is not None:
extra_preargs = extra_preargs.strip().split(" ")
Expand Down Expand Up @@ -150,8 +146,7 @@ def check_openmp_support(compiler):
traceback.print_exc()

if not openmp_supported:
message = textwrap.dedent(
"""
message = textwrap.dedent("""

***********
* WARNING *
Expand All @@ -176,8 +171,7 @@ def check_openmp_support(compiler):
parallelism.

***\n
"""
)
""")
warnings.warn(message)

return openmp_supported
Expand Down