Skip to content

Commit 2bb847c

Browse files
committed
Use empty blas_ldflags if no cxx is configured
1 parent 7eafb6c commit 2bb847c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

pytensor/link/c/cmodule.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2773,6 +2773,9 @@ def check_libs(
27732773
else:
27742774
raise RuntimeError(f"Supplied flags {flags} failed to compile")
27752775

2776+
# If no compiler is available we default to empty ldflags
2777+
if not config.cxx:
2778+
return ""
27762779
_std_lib_dirs = std_lib_dirs()
27772780
if len(_std_lib_dirs) > 0:
27782781
rpath = _std_lib_dirs[0]

tests/link/c/test_cmodule.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ def test_default_blas_ldflags(
226226
)
227227

228228

229+
def test_default_blas_ldflags_no_cxx():
230+
with pytensor.config.change_flags(cxx=""):
231+
assert default_blas_ldflags() == ""
232+
233+
229234
@patch(
230235
"os.listdir", return_value=["mkl_core.1.dll", "mkl_rt.1.0.dll", "mkl_rt.1.1.lib"]
231236
)

0 commit comments

Comments
 (0)