Skip to content

Commit

Permalink
parse hook to change Bazel version of build dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Nov 21, 2024
1 parent 4cfd111 commit c3353c1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,29 @@ def parse_hook_qt5_check_qtwebengine_disable(ec, eprefix):
raise EasyBuildError("Qt5-specific hook triggered for non-Qt5 easyconfig?!")


def parse_hook_tensorflow_replace_bazel(ec, eprefix):
"""
Replace Bazel/6.1.0 build dependency in TensorFlow/2.15.1 easyconfigs with
Bazel/6.3.1.
"""
# This is an attempt to work around some build errors. TensorFlow/2.13.0 was
# built with Bazel/6.3.1, hence using that version may just work.
if ec.name == 'TensorFlow' and ec.version in ['2.15.1']:
print_msg("Trying to replace Bazel/6.1.0 build dependency with Bazel/6.3.1 for TensorFlow/2.15.1 easyconfig")
build_deps = ec['builddependencies']
bazel_build_dep = None
bazel_name, bazel_version = ('Bazel', '6.1.0')
for idx, build_dep in enumerate(build_deps):
if build_dep[0] == bazel_name and build_dep[1] == bazel_version:
bazel_build_dep = build_dep
break
if bazel_build_dep:
build_deps[idx] = (bazel_name, '6.3.1')
print_msg(f"Replaced build dependency {idx} with ({build_deps[idx][0]}, {build_deps[idx][1]})")
else:
raise EasyBuildError("TensorFlow-specific parse_hook triggered for non-TensorFlow easyconfig?!")


def parse_hook_ucx_eprefix(ec, eprefix):
"""Make UCX aware of compatibility layer via additional configuration options."""
if ec.name == 'UCX':
Expand Down Expand Up @@ -973,6 +996,7 @@ def inject_gpu_property(ec):
'OpenBLAS': parse_hook_openblas_relax_lapack_tests_num_errors,
'pybind11': parse_hook_pybind11_replace_catch2,
'Qt5': parse_hook_qt5_check_qtwebengine_disable,
'TensorFlow': parse_hook_tensorflow_replace_bazel,
'UCX': parse_hook_ucx_eprefix,
}

Expand Down

0 comments on commit c3353c1

Please sign in to comment.