Cannot find bazel. Please install bazel/bazelisk

I’m trying to build TensorFlow from source, because my GPU is not in CUDA’s list, and in this page it mentions that

  • For GPUs with unsupported CUDA® architectures, or to avoid JIT compilation from PTX, or to use different versions of the NVIDIA® libraries, see the Linux build from source guide.

I’m stuck at the configuration process, where typing ./configure results in the error Cannot find bazel. Please install bazel/bazelisk.
Bazel-6.1.0 is installed in my system, which is the version required by TensorFlow. If I type bazel, or bazelisk in the terminal, I get this:

                                                          [bazel release 6.1.0]
Usage: bazel <command> <options> ...

plus some usage info. This shows that bazel is installed in my system, and its path correctly set. So, why the configuration file can’t find it?

Hi @AlexandrosDrymonitis, I have tried to clone the tensorflow repo and change the directory to tensorflow and executed the ./configure and did not face any error.

Could you please re-verify the path. Thank You.

HI @Kiran_Sai_Ramineni, thank you for your reply. What do you mean “re-verify” the path? What path? I have bazel-6.1.0 in my /usr/bin directory, and bazelisk-linux-amd64 in my /usr/local/bin directory, both of which are in my PATH by default (I have doubled checked with printenv PATH.
Before I run ./configure I change to the tensorflow directory, so, I can’t really understand what the problem is here.
Any other suggestions?

@Kiran_Sai_Ramineni I fixed it by creating a symlink in /usr/local/bin/bazel pointing to /usr/bin/bazel-6.1.0.