bazelbuild / bazelisk

A user-friendly launcher for Bazel.
Apache License 2.0
1.95k stars 300 forks source link

bazel version 6.5.0 install issue #573

Open Helena2007 opened 2 months ago

Helena2007 commented 2 months ago

I am working on pointnet project in python. The project uses tensorflow and tensorrt. In the integration of tensorflow with tensorrt, bazel 6.5.0 needs to be installed for that installed bazelisk. but got ERROR: The project you're trying to build requires Bazel 6.5.0 (specified in /....../pointnet/tensorflow/.bazelversion), but it wasn't found in /usr/bin. Initially installed bazelisk and was able to install bazel 6.5.0 but in usr/local/bin. deleted that and when tried again to install in /usr/bin got error. when executed bazelisk install --version 6.5.0 WARNING: Invoking Bazel in batch mode since it is not invoked from within a workspace (below a directory having a WORKSPACE file). OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release. Command 'install' not found. Try 'bazel help'.

avdv commented 2 months ago

bazelisk manages Bazel versions transparently for you. You don't need to install them explicitly. But you have to make sure that you're calling bazelisk instead of bazel. (it seems you called bazel which is installed in /usr/bin)

If you call bazelisk instead of bazel, then bazelisk will read the .bazelversion file and download this version and call it.

Helena2007 commented 2 months ago

Installed bazel 6.5.0 version successfully using bazelisk. In the process of Rebuilding TensorFlow with TensorRT Support successfully completed steps up to Build TensorFlow. Now to Generate TensorFlow Wheel Package when run the command

sudo bazel-bin/tensorflow/tools/pip_package/build_pip_package_py --output-name=tensorflow_pkg.whl --project-name=pointnet --headers=/...../pointnet/tensorflow/tensorflow/core/framework got error, Traceback (most recent call last): File "/....../pointnet/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/build_pip_package.py", line 336, in prepare_wheel_srcs(args.headers, args.srcs, args.xla_aot, File "/..../pointnet/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/build_pip_package.py", line 175, in prepare_wheel_srcs prepare_headers(headers, os.path.join(srcs_dir, "tensorflow/include")) File "/.../pointnet/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/build_pip_package.py", line 102, in prepare_headers copy_file(file, srcs_dir) File "/.../pointnet/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/utils/utils.py", line 77, in copy_file shutil.copy(src_file, dest_dir_path) File "/root/.cache/bazel/_bazel_root/b7a2b4a7c8c9d490d024a728eda02b60/external/python_x86_64-unknown-linux-gnu/lib/python3.11/shutil.py", line 419, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/root/.cache/bazel/_bazel_root/b7a2b4a7c8c9d490d024a728eda02b60/external/python_x86_64-unknown-linux-gnu/lib/python3.11/shutil.py", line 236, in copyfile raise SameFileError("{!r} and {!r} are the same file".format(src, dst)) shutil.SameFileError: '/..../pointnet/tensorflow/tensorflow/core/framework' and '/..../pointnet/tensorflow/tensorflow/core/framework' are the same file

avdv commented 2 months ago

I don't know which guide you're following, and I am not too familiar with tensorflow (never heard of the pointnet project nor tensor-rt before). Better ask in some tensorflow / pointnet specific forum.