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

Jax 0.5.0 error: no type named 'string' in namespace 'std' #26062

Open
gongomgra opened this issue Jan 23, 2025 · 1 comment
Open

Jax 0.5.0 error: no type named 'string' in namespace 'std' #26062

gongomgra opened this issue Jan 23, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gongomgra
Copy link

Description

I'm not able to build jaxlib version 0.5.0 on aarch64, I see the following build error:

ERROR: /root/.cache/bazel/_bazel_root/6ff6e7d4aad9a899a443c18cfae68f22/external/compute_library/BUILD.bazel:355:11: Compiling src/core/utils/logging/FilePrinter.cpp failed: (Exit 1): clang-18 failed: error executing command (from target @compute_library//:arm_compute)
  (cd /root/.cache/bazel/_bazel_root/6ff6e7d4aad9a899a443c18cfae68f22/execroot/__main__ && \
  exec env - \
    CLANG_COMPILER_PATH=/usr/bin/clang-18 \
    PATH=/root/.local/bin:/root/bin:/usr/share/Modules/bin:/opt/bitnami/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
  /usr/bin/clang-18 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-
std=c++14' -MD -MF bazel-out/aarch64-opt/bin/external/compute_library/_objs/arm_compute/FilePrinter.pic.d '-frandom-seed=bazel-out/aarch64-opt/bin/external/compute_library/_objs/arm_compute/FilePrinter.pic.o' -fPIC -DENABLE_NEON -DARM_COMPUTE_CPU_ENABLED -DARM_COMP
UTE_ENABLE_NEON -DARM_COMPUTE_ENABLE_I8MM -DENABLE_FP32_KERNELS -DENABLE_QASYMM8_KERNELS -DENABLE_QASYMM8_SIGNED_KERNELS -DENABLE_QSYMM16_KERNELS -DENABLE_INTEGER_KERNELS -DENABLE_NHWC_KERNELS -DENABLE_NCHW_KERNELS -DARM_COMPUTE_GRAPH_ENABLED -DARM_COMPUTE_ENABLE_S
VEF32MM -DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS -D_GLIBCXX_USE_NANOSLEEP -DENABLE_SVE -DARM_COMPUTE_ENABLE_SVE -DARM_COMPUTE_ENABLE_BF16 '-DBAZEL_CURRENT_REPOSITORY="compute_library"' -iquote external/compute_library -iquote bazel-out/aarch64-opt/bin/external/com
pute_library -Ibazel-out/aarch64-opt/bin/external/compute_library/include/_virtual_includes/include -isystem external/compute_library/arm_compute/runtime -isystem bazel-out/aarch64-opt/bin/external/compute_library/arm_compute/runtime -isystem external/compute_libra
ry/src/core/NEON/kernels/assembly -isystem bazel-out/aarch64-opt/bin/external/compute_library/src/core/NEON/kernels/assembly -isystem external/compute_library/src/core/NEON/kernels/convolution/common -isystem bazel-out/aarch64-opt/bin/external/compute_library/src/c
ore/NEON/kernels/convolution/common -isystem external/compute_library/src/core/NEON/kernels/convolution/winograd -isystem bazel-out/aarch64-opt/bin/external/compute_library/src/core/NEON/kernels/convolution/winograd -isystem external/compute_library/src/core/cpu/ke
rnels/assembly -isystem bazel-out/aarch64-opt/bin/external/compute_library/src/core/cpu/kernels/assembly -isystem external/compute_library/src/cpu/kernels/assembly -isystem bazel-out/aarch64-opt/bin/external/compute_library/src/cpu/kernels/assembly -isystem externa
l/compute_library/src/core/NEON/kernels/arm_conv -isystem bazel-out/aarch64-opt/bin/external/compute_library/src/core/NEON/kernels/arm_conv -isystem external/compute_library/src/core/NEON/kernels/arm_gemm -isystem bazel-out/aarch64-opt/bin/external/compute_library/
src/core/NEON/kernels/arm_gemm '-fvisibility=hidden' -Wno-sign-compare -Wno-unknown-warning-option -Wno-stringop-truncation -Wno-array-parameter '-DMLIR_PYTHON_PACKAGE_PREFIX=jaxlib.mlir.' -Wno-gnu-offsetof-extensions -Qunused-arguments '-Werror=mismatched-tags' -Wno-gnu-offsetof-extensions -Qunused-arguments '-Werror=mismatched-tags' '-std=c++17' '-march=armv8-a' -O3 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/compute_library/src/core/utils/logging/FilePrinter.cpp -o bazel-out/aarch64-opt/bin/external/compute_library/_objs/arm_compute/FilePrinter.pic.o)
# Configuration: 7f3e8ef8d4e1c3bf7770a5cd241fa0a6c9bebc2d5e4c95e2396bfebbb6e6cbbf
# Execution platform: @local_execution_config_platform//:platform
In file included from external/compute_library/src/core/utils/logging/FilePrinter.cpp:24:
In file included from external/compute_library/arm_compute/core/utils/logging/FilePrinter.h:27:
external/compute_library/arm_compute/core/utils/logging/IPrinter.h:56:34: error: no type named 'string' in namespace 'std'
   56 |     inline void print(const std::string &msg)
      |                             ~~~~~^
external/compute_library/arm_compute/core/utils/logging/IPrinter.h:67:44: error: no type named 'string' in namespace 'std'
   67 |     virtual void print_internal(const std::string &msg) = 0;
      |                                       ~~~~~^
In file included from external/compute_library/src/core/utils/logging/FilePrinter.cpp:24:
external/compute_library/arm_compute/core/utils/logging/FilePrinter.h:47:49: error: non-virtual member function marked 'override' hides virtual member function
   47 |     void print_internal(const std::string &msg) override;
      |                                                 ^
external/compute_library/arm_compute/core/utils/logging/IPrinter.h:67:18: note: hidden overloaded virtual function 'arm_compute::logging::Printer::print_internal' declared here: type mismatch at 1st parameter ('const int &' vs 'const std::string &' (aka 'const basic_string<char> &'))
   67 |     virtual void print_internal(const std::string &msg) = 0;
      |                  ^
In file included from external/compute_library/src/core/utils/logging/FilePrinter.cpp:24:
external/compute_library/arm_compute/core/utils/logging/FilePrinter.h:36:7: warning: abstract class is marked 'final' [-Wabstract-final-class]
   36 | class FilePrinter final : public Printer
      |       ^
external/compute_library/arm_compute/core/utils/logging/IPrinter.h:67:18: note: unimplemented pure virtual method 'print_internal' in 'FilePrinter'
   67 |     virtual void print_internal(const std::string &msg) = 0;
      |                  ^
1 warning and 3 errors generated.
[5,995 / 9,008] 7 actions running
    Compiling xla/tsl/distributed_runtime/rpc/coordination/grpc_coordination_service_impl.cc; 4s local
Target //jaxlib/tools:build_wheel failed to build

Previous clang versions like 16.x or 17.x from llvm-project/releases generate a different error. For instance, Clang 16.0.0 works for x86_64, but not for aarch64:

ERROR: /tmp/jax-jax-v0.5.0/jaxlib/BUILD:201:19: Linking jaxlib/cpu_feature_guard.so failed: (Exit 1): clang-16 failed: error executing command (from target //jaxlib:cpu_feature_guard.so)
  (cd /root/.cache/bazel/_bazel_root/6ff6e7d4aad9a899a443c18cfae68f22/execroot/__main__ && \
  exec env - \
    CLANG_COMPILER_PATH=/tmp/clang+llvm-16.0.0-aarch64-linux-gnu/bin/clang-16 \
    LD_LIBRARY_PATH=/tmp/clang+llvm-16.0.0-aarch64-linux-gnu/lib:/tmp/clang+llvm-17.0.6-aarch64-linux-gnu/lib: \
    PATH=/tmp/clang+llvm-16.0.0-aarch64-linux-gnu/bin:/tmp/clang+llvm-17.0.6-aarch64-linux-gnu/bin:/opt/bitnami/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
  /tmp/clang+llvm-16.0.0-aarch64-linux-gnu/bin/clang-16 @bazel-out/aarch64-opt/bin/jaxlib/cpu_feature_guard.so-2.params)
# Configuration: 326616f3723b94f105241aea35dc41af5fda2cbd07234b7ac29b29fcdd6ca354
# Execution platform: @local_execution_config_platform//:platform
/tmp/clang+llvm-16.0.0-aarch64-linux-gnu/bin/clang-16: /usr/lib/libtinfo.so.6: no version information available (required by /tmp/clang+llvm-16.0.0-aarch64-linux-gnu/bin/clang-16)
clang-16: error: invalid linker name in argument '-fuse-ld=/tmp/clang+llvm-16.0.0-aarch64-linux-gnu/bin/ld.lld:'
Target //jaxlib/tools:build_wheel failed to build
INFO: Elapsed time: 3.292s, Critical Path: 0.22s

System info (python version, jaxlib version, accelerator, etc.)

$ cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="9.5 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.5"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.5 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
BUG_REPORT_URL="https://issues.redhat.com/"

$ python --version
Python 3.12.8

$ clang --version
clang version 18.1.8 (Red Hat, Inc. 18.1.8-3.el9)
Target: aarch64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Configuration file: /etc/clang/aarch64-redhat-linux-gnu-clang.cfg
@gongomgra gongomgra added the bug Something isn't working label Jan 23, 2025
copybara-service bot pushed a commit to google/tsl that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719326299
copybara-service bot pushed a commit to openxla/xla that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719326299
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719326299
@penpornk
Copy link
Collaborator

Thank you for reporting!

The error didn't happen for me when I tried with LLVM 18 on Ubuntu. But I could reproduce the error in a RHEL 9 docker image (+ Bazel 7.4.1, Python 3.12.5, clang 18.1.8). I'll submit a fix soon.

In the meanwhile, you should be able to skip the error by passing --disable_mkl_dnn to build.py.

copybara-service bot pushed a commit to openxla/xla that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719326299
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719326299
copybara-service bot pushed a commit to openxla/xla that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719326299
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719326299
copybara-service bot pushed a commit to google/tsl that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719416696
copybara-service bot pushed a commit to openxla/xla that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719416696
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this issue Jan 24, 2025
Reported in:
jax-ml/jax#26062

PiperOrigin-RevId: 719416696
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants