[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such file or directory: 'patchelf' while compiling from source #68247

Open
chudur-budur opened this issue May 20, 2024 · 1 comment
Open
Assignees
Labels
stat:awaiting tensorflower Status - Awaiting response from tensorflower subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.16 type:build/install Build and install issues

Comments

@chudur-budur
Copy link

Issue type

Build/Install

Have you reproduced the bug with TensorFlow Nightly?

No

Source

source

TensorFlow version

tf 2.16

Custom code

No

OS platform and distribution

Ubuntu 22.04.4 LTS

Mobile device

No response

Python version

3.11

Bazel version

6.5.0

GCC/compiler version

clang 17.0.2

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

I was following the instruction from the official TensorFlow guide. Everything was setup ad-verbatim from the build guide. I am using the prebuilt clang+llvm.

However when I try to compile, I am getting this error:

(tfdev-noclang) user@host:/localdisk/user/tensorflow|(r2.16)> bazel build //tensorflow/tools/pip_package/v2:wheel --repo_env=WHEEL_NAME=tensorflow_cpu --verbose_failures
Starting local Bazel server and connecting to it...
INFO: Reading 'startup' options from /localdisk/user/tensorflow/.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=170
INFO: Reading rc options for 'build' from /localdisk/user/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /localdisk/user/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --features=-force_no_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Found applicable config definition build:short_logs in file /localdisk/user/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /localdisk/user/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:linux in file /localdisk/user/tensorflow/.bazelrc: --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --copt=-Wno-error=unused-but-set-variable --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=dynamic_kernels --experimental_guard_against_concurrent_changes
INFO: Found applicable config definition build:dynamic_kernels in file /localdisk/user/tensorflow/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
DEBUG: /localdisk/user/tensorflow/tensorflow/tools/toolchains/python/python_repo.bzl:32:14:
TF_PYTHON_VERSION environment variable was not set correctly; using Python 3.11.

To set Python version, run:
export TF_PYTHON_VERSION=3.11
INFO: Analyzed target //tensorflow/tools/pip_package/v2:wheel (686 packages loaded, 44337 targets configured).
INFO: Found 1 target...
ERROR: /localdisk/user/tensorflow/tensorflow/tools/pip_package/v2/BUILD:265:9: Action tensorflow/tools/pip_package/v2/wheel_house failed: (Exit 1): build_pip_package_py failed: error executing command (from target //tensorflow/tools/pip_package/v2:wheel)
  (cd /localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/execroot/org_tensorflow && \
  exec env - \
  bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/tools/pip_package/v2/build_pip_package_py @bazel-out/k8-opt/bin/tensorflow/tools/pip_package/v2/wheel_house-0.params)
# Configuration: f208c1d5bcafb33cd85fd8b339492cbe2d1cfa863f489f4edcdc5b70bc65aa65
# Execution platform: @local_execution_config_platform//:platform
Traceback (most recent call last):
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/execroot/org_tensorflow/bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/tools/pip_package/v2/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/v2/build_pip_package.py", line 321, in <module>
    prepare_wheel_srcs(args.headers, args.srcs, args.xla_aot,
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/execroot/org_tensorflow/bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/tools/pip_package/v2/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/v2/build_pip_package.py", line 196, in prepare_wheel_srcs
    patch_so(srcs_dir)
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/execroot/org_tensorflow/bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/tools/pip_package/v2/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/v2/build_pip_package.py", line 231, in patch_so
    subprocess.run(["patchelf", "--add-rpath", path,
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/external/python_x86_64-unknown-linux-gnu/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/external/python_x86_64-unknown-linux-gnu/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/external/python_x86_64-unknown-linux-gnu/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'patchelf'
Target //tensorflow/tools/pip_package/v2:wheel failed to build
INFO: Elapsed time: 626.996s, Critical Path: 303.61s
INFO: 16379 processes: 1413 internal, 14966 local.
FAILED: Build did NOT complete successfully

Standalone code to reproduce the issue

# Follow everything from the official guide.
# Use the prebuilt clang+llvm
# To build, invoke this command:
(tfdev-noclang) user@host:/localdisk/user/tensorflow|(r2.16)> bazel build //tensorflow/tools/pip_package/v2:wheel --repo_env=WHEEL_NAME=tensorflow_cpu --verbose_failures

Relevant log output

Starting local Bazel server and connecting to it...
INFO: Reading 'startup' options from /localdisk/user/tensorflow/.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=170
INFO: Reading rc options for 'build' from /localdisk/user/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /localdisk/user/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --features=-force_no_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Found applicable config definition build:short_logs in file /localdisk/user/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /localdisk/user/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:linux in file /localdisk/user/tensorflow/.bazelrc: --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --copt=-Wno-error=unused-but-set-variable --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=dynamic_kernels --experimental_guard_against_concurrent_changes
INFO: Found applicable config definition build:dynamic_kernels in file /localdisk/user/tensorflow/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
DEBUG: /localdisk/user/tensorflow/tensorflow/tools/toolchains/python/python_repo.bzl:32:14:
TF_PYTHON_VERSION environment variable was not set correctly; using Python 3.11.

To set Python version, run:
export TF_PYTHON_VERSION=3.11
INFO: Analyzed target //tensorflow/tools/pip_package/v2:wheel (686 packages loaded, 44337 targets configured).
INFO: Found 1 target...
ERROR: /localdisk/user/tensorflow/tensorflow/tools/pip_package/v2/BUILD:265:9: Action tensorflow/tools/pip_package/v2/wheel_house failed: (Exit 1): build_pip_package_py failed: error executing command (from target //tensorflow/tools/pip_package/v2:wheel)
  (cd /localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/execroot/org_tensorflow && \
  exec env - \
  bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/tools/pip_package/v2/build_pip_package_py @bazel-out/k8-opt/bin/tensorflow/tools/pip_package/v2/wheel_house-0.params)
# Configuration: f208c1d5bcafb33cd85fd8b339492cbe2d1cfa863f489f4edcdc5b70bc65aa65
# Execution platform: @local_execution_config_platform//:platform
Traceback (most recent call last):
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/execroot/org_tensorflow/bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/tools/pip_package/v2/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/v2/build_pip_package.py", line 321, in <module>
    prepare_wheel_srcs(args.headers, args.srcs, args.xla_aot,
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/execroot/org_tensorflow/bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/tools/pip_package/v2/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/v2/build_pip_package.py", line 196, in prepare_wheel_srcs
    patch_so(srcs_dir)
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/execroot/org_tensorflow/bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/tools/pip_package/v2/build_pip_package_py.runfiles/org_tensorflow/tensorflow/tools/pip_package/v2/build_pip_package.py", line 231, in patch_so
    subprocess.run(["patchelf", "--add-rpath", path,
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/external/python_x86_64-unknown-linux-gnu/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/external/python_x86_64-unknown-linux-gnu/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/localdisk/user/.cache/bazel/_bazel_user/e4eace97acba9979e5f9a9765d32d25e/external/python_x86_64-unknown-linux-gnu/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'patchelf'
Target //tensorflow/tools/pip_package/v2:wheel failed to build
INFO: Elapsed time: 626.996s, Critical Path: 303.61s
INFO: 16379 processes: 1413 internal, 14966 local.
FAILED: Build did NOT complete successfully
@the-rccg
Copy link
the-rccg commented Jun 5, 2024

facing the same issue

@tilakrayal tilakrayal added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting tensorflower Status - Awaiting response from tensorflower subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.16 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

4 participants