spack / spack

A flexible package manager that supports multiple versions, configurations, platforms, and compilers.
https://spack.io
Other
4.43k stars 2.29k forks source link

Installation issue: LLVM on aarch64 #34954

Open adamjstewart opened 1 year ago

adamjstewart commented 1 year ago

Steps to reproduce the issue

Trying to build TensorFlow in #34300. Newer versions depend on py-libclang, which depends on llvm+clang@14. However, I see a build error with llvm@14.0.6 on aarch64.

Error message

/tmp/root/spack-stage/spack-stage-llvm-14.0.6-6iekuiopldpzj4gwzf6fbsiv4ln7kjfg/spack-src/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp: In static member function 'static std::unique_ptr<lldb_private::process_linux::NativeRegisterContextLinux> lldb_private::process_linux::NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(const lldb_private::ArchSpec&, lldb_private::process_linux::NativeThreadLinux&)':
/tmp/root/spack-stage/spack-stage-llvm-14.0.6-6iekuiopldpzj4gwzf6fbsiv4ln7kjfg/spack-src/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:63:28: error: aggregate 'lldb_private::process_linux::NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(const lldb_private::ArchSpec&, lldb_private::process_linux::NativeThreadLinux&)::user_sve_header sve_header' has incomplete type and cannot be defined
     struct user_sve_header sve_header;
                            ^~~~~~~~~~
/tmp/root/spack-stage/spack-stage-llvm-14.0.6-6iekuiopldpzj4gwzf6fbsiv4ln7kjfg/spack-src/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp: In member function 'virtual lldb_private::Status lldb_private::process_linux::NativeRegisterContextLinux_arm64::WriteRegister(const lldb_private::RegisterInfo*, const lldb_private::RegisterValue&)':
/tmp/root/spack-stage/spack-stage-llvm-14.0.6-6iekuiopldpzj4gwzf6fbsiv4ln7kjfg/spack-src/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:376:13: error: 'sve_vl_valid' was not declared in this scope
         if (sve_vl_valid(vg_value * 8)) {
             ^~~~~~~~~~~~

Information on your system

Additional information

spack-build-out.txt

@haampie @trws

General information

William-Mou commented 1 year ago

Hi @adamjstewart

Also M1 Mac is belong to Arm arch, but it doesn't support SVE instruction set. Maybe you should disable sve from some flag like -march=armv8-a+sve when you compile TensorFlow with Clang?

adamjstewart commented 1 year ago

The error reported above is for Linux, not for M1.

naromero77 commented 1 year ago

I just tried this on an a different ARM machine and could not see a failure, is it still an issue?

adamjstewart commented 1 year ago

Did you try LLVM 14 or newer LLVM? TensorFlow still requires LLVM 14 so unfortunately I can't rely on newer versions.

naromero77 commented 1 year ago

I did: spack install llvm@14.0.6 and it worked.

FWIW


n.a.romero@sal-amperehn01:~$ spack arch
linux-rocky8-neoverse_n1
adamjstewart commented 1 year ago

Let me try #34300 again and see if I can reproduce the issue.

adamjstewart commented 1 year ago

Okay, let's see if we still get the same issue in https://github.com/spack/spack/pull/39666. It's a newer aarch64 image so it may no longer be an issue.

adamjstewart commented 1 year ago

Yep, still seeing the same error: https://gitlab.spack.io/spack/spack/-/jobs/8086790

We used to print instructions to reproduce the build failure using docker, @kwryankrattiger do you know where to find these?

kwryankrattiger commented 1 year ago

The instructions are still printed, however this jobs log got truncated. This is what you want to run

spack ci reproduce-build --autostart [--working-dir /path/to/reproduction/directory] https://gitlab.spack.io/api/v4/projects/2/jobs/8086790/artifacts