Skip to content

Commit b314ca6

Browse files
lucianopazricardoV94
authored andcommitted
Add extra logging information for cmodule
1 parent 7b13a95 commit b314ca6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pytensor/link/c/cmodule.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -2007,13 +2007,18 @@ def try_blas_flag(flags):
20072007
cflags.extend(f"-L{path_wrapper}{d}{path_wrapper}" for d in std_lib_dirs())
20082008

20092009
res = GCC_compiler.try_compile_tmp(
2010-
test_code, tmp_prefix="try_blas_", flags=cflags, try_run=True
2010+
test_code, tmp_prefix="try_blas_", flags=cflags, try_run=True, output=True
20112011
)
20122012
# res[0]: shows successful compilation
20132013
# res[1]: shows successful execution
2014+
# res[2]: shows execution results
2015+
# res[3]: shows execution or compilation error message
20142016
if res and res[0] and res[1]:
20152017
return " ".join(flags)
20162018
else:
2019+
_logger.debug(
2020+
"try_blas_flags of flags: %r\nfailed with error message %s", flags, res[3]
2021+
)
20172022
return ""
20182023

20192024

@@ -2801,7 +2806,6 @@ def check_libs(
28012806
_logger.debug("The following blas flags will be used: '%s'", res)
28022807
return res
28032808
else:
2804-
_logger.debug(f"Supplied flags {res} failed to compile")
28052809
_logger.debug("Supplied flags '%s' failed to compile", res)
28062810
raise RuntimeError(f"Supplied flags {flags} failed to compile")
28072811

0 commit comments

Comments
 (0)