Skip to content

OpenEquivariance fails on wheel pip package installation on ARM systems. #194

@achacond

Description

@achacond

OpenEquivariance fails on wheel pip package installation on ARM systems.
This is likely due to using an x86 pre-compiled libtorch_cpu.so library (see details below)

 [17/19] Linking CXX shared module oeq_stable_cuda.cpython-312-aarch64-linux-gnu.so
      FAILED: [code=1] oeq_stable_cuda.cpython-312-aarch64-linux-gnu.so
      : && /usr/bin/aarch64-linux-gnu-g++ -fPIC -O3 -DNDEBUG  -shared -Wl,-s -Wl,--gc-sections -Wl,--dependency-file=CMakeFiles/oeq_stable_cuda.dir/link.d  -o oeq_stable_cuda.cpython-312-aarch64-linux-gnu.so CMakeFiles/oeq_stable_cuda.dir/openequivariance/extension/libtorch_tp_jit_stable.cpp.o CMakeFiles/oeq_stable_cuda.dir/openequivariance/extension/json11/json11.cpp.o  -Wl,-rpath,/tmp/tmp977gblf5/build/_deps/libtorch-src/lib:/usr/local/cuda-13.1/targets/sbsa-linux/lib:/tmp/tmp977gblf5/build:  libnanobind-static.a  _deps/libtorch-src/lib/libtorch_cpu.so  _deps/libtorch-src/lib/libc10.so  /usr/local/cuda-13.1/targets/sbsa-linux/lib/libcudart.so  /usr/local/cuda/targets/sbsa-linux/lib/stubs/libcuda.so  /usr/local/cuda-13.1/targets/sbsa-linux/lib/libnvrtc.so  libtorch_cuda.so  -ldl  /usr/lib/aarch64-linux-gnu/librt.a && :
      /usr/bin/ld: _deps/libtorch-src/lib/libtorch_cpu.so: error adding symbols: file in wrong format
      collect2: error: ld returned 1 exit status
      [18/19] Building CXX object CMakeFiles/oeq_stable_cuda_aoti.dir/openequivariance/extension/libtorch_tp_jit_stable.cpp.o
      ninja: build stopped: subcommand failed.
      
      *** CMake build failed
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for openequivariance
Failed to build openequivariance
error: failed-wheel-build-for-install

× Failed to build install

Steps for the reproduction:

Download the wheel package and decompress:
pip download --no-clean openequivariance

File CMakeLists.txt shows the source of the pre-compiled torch libraries:

# Download LibTorch 
include(FetchContent)
FetchContent_Declare(
    libtorch
    URL "https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.10.0%2Bcpu.zip"
)
message(STATUS "Downloading LibTorch...")
FetchContent_MakeAvailable(libtorch)

By download them and check the format of the *.so lib with file we can identify that uses x86 binary format:
wget https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.10.0%2Bcpu.zip

# file libtorch/lib/libtorch_cpu.so 
libtorch/lib/libtorch_cpu.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=e59a73f8ca02c19463bd923dc568ce765b2a1106, not stripped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions