Skip to content

Commit

Permalink
Use empty blas_ldflags if no cxx is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianopaz committed Nov 20, 2023
1 parent 7eafb6c commit 2bb847c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pytensor/link/c/cmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2773,6 +2773,9 @@ def check_libs(
else:
raise RuntimeError(f"Supplied flags {flags} failed to compile")

# If no compiler is available we default to empty ldflags
if not config.cxx:
return ""
_std_lib_dirs = std_lib_dirs()
if len(_std_lib_dirs) > 0:
rpath = _std_lib_dirs[0]
Expand Down
5 changes: 5 additions & 0 deletions tests/link/c/test_cmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ def test_default_blas_ldflags(
)


def test_default_blas_ldflags_no_cxx():
with pytensor.config.change_flags(cxx=""):
assert default_blas_ldflags() == ""


@patch(
"os.listdir", return_value=["mkl_core.1.dll", "mkl_rt.1.0.dll", "mkl_rt.1.1.lib"]
)
Expand Down

0 comments on commit 2bb847c

Please sign in to comment.