Skip to content
Open
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
6 changes: 4 additions & 2 deletions build_tools/jax.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ def xla_path() -> str:
from jax.extend import ffi # pylint: disable=ungrouped-imports

except ImportError:
print("Could not import jax. Looking for XLA source in $XLA_HOME or /opt/xla")
if os.getenv("XLA_HOME"):
xla_home = Path(os.getenv("XLA_HOME"))
xla_home = Path(os.getenv("XLA_HOME").strip())
else:
xla_home = "/opt/xla"
else:
xla_home = ffi.include_dir()
print(f"Found XLA source in {xla_home}")

if not os.path.isdir(xla_home):
raise FileNotFoundError("Could not find xla source.")
raise FileNotFoundError(f"Could not find xla source. Searched: {xla_home}")
return xla_home


Expand Down