elixir-nx / xla

Pre-compiled XLA extension
Apache License 2.0
89 stars 20 forks source link

Error on 0.8 Nerves compile that worked on 0.7.3 #96

Open lawik opened 1 month ago

lawik commented 1 month ago

I get this error:

==> xla
Compiling 5 files (.ex)
Generated xla app

19:44:48.362 [info] Downloading a precompiled XLA archive for target x86_64-linux-gnu-cpu

19:44:49.815 [info] Successfully downloaded the XLA archive
==> exla
Unpacking /root/.cache/xla/0.8.0/download/xla_extension-0.8.0-x86_64-linux-gnu-cpu.tar.gz into /root/project/deps/exla/cache
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/aarch64-nerves-linux-gnu-g++ -fPIC -I/root/.nerves/artifacts/nerves_system_rpi4-portable-1.28.1/staging/usr/lib/erlang/erts-15.0.1/include -Icache/xla_extension/include -Wall -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-comment -std=c++17 -w -DLLVM_VERSION_STRING= -O3 -c c_src/exla/exla.cc -o cache/objs/exla.o
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/aarch64-nerves-linux-gnu-g++ -fPIC -I/root/.nerves/artifacts/nerves_system_rpi4-portable-1.28.1/staging/usr/lib/erlang/erts-15.0.1/include -Icache/xla_extension/include -Wall -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-comment -std=c++17 -w -DLLVM_VERSION_STRING= -O3 -c c_src/exla/exla_mlir.cc -o cache/objs/exla_mlir.o
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/aarch64-nerves-linux-gnu-g++ -fPIC -I/root/.nerves/artifacts/nerves_system_rpi4-portable-1.28.1/staging/usr/lib/erlang/erts-15.0.1/include -Icache/xla_extension/include -Wall -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-comment -std=c++17 -w -DLLVM_VERSION_STRING= -O3 -c c_src/exla/custom_calls.cc -o cache/objs/custom_calls.o
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/aarch64-nerves-linux-gnu-g++ -fPIC -I/root/.nerves/artifacts/nerves_system_rpi4-portable-1.28.1/staging/usr/lib/erlang/erts-15.0.1/include -Icache/xla_extension/include -Wall -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-comment -std=c++17 -w -DLLVM_VERSION_STRING= -O3 -c c_src/exla/exla_client.cc -o cache/objs/exla_client.o
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/aarch64-nerves-linux-gnu-g++ -fPIC -I/root/.nerves/artifacts/nerves_system_rpi4-portable-1.28.1/staging/usr/lib/erlang/erts-15.0.1/include -Icache/xla_extension/include -Wall -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-comment -std=c++17 -w -DLLVM_VERSION_STRING= -O3 -c c_src/exla/exla_nif_util.cc -o cache/objs/exla_nif_util.o
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/aarch64-nerves-linux-gnu-g++ -fPIC -I/root/.nerves/artifacts/nerves_system_rpi4-portable-1.28.1/staging/usr/lib/erlang/erts-15.0.1/include -Icache/xla_extension/include -Wall -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-comment -std=c++17 -w -DLLVM_VERSION_STRING= -O3 -c c_src/exla/exla_cuda.cc -o cache/objs/exla_cuda.o
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/aarch64-nerves-linux-gnu-g++ cache/objs/exla.o cache/objs/exla_mlir.o cache/objs/custom_calls.o cache/objs/exla_client.o cache/objs/exla_nif_util.o cache/objs/exla_cuda.o -o cache/libexla.so -Lcache/xla_extension/lib -lxla_extension -shared -Wl,-rpath,'$ORIGIN/xla_extension/lib'
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/../lib/gcc/aarch64-nerves-linux-gnu/13.2.0/../../../../aarch64-nerves-linux-gnu/bin/ld: skipping incompatible cache/xla_extension/lib/libxla_extension.so when searching for -lxla_extension
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/../lib/gcc/aarch64-nerves-linux-gnu/13.2.0/../../../../aarch64-nerves-linux-gnu/bin/ld: cannot find -lxla_extension: No such file or directory
/root/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-linux_x86_64-13.2.0/bin/../lib/gcc/aarch64-nerves-linux-gnu/13.2.0/../../../../aarch64-nerves-linux-gnu/bin/ld: skipping incompatible cache/xla_extension/lib/libxla_extension.so when searching for -lxla_extension
collect2: error: ld returned 1 exit status
make: *** [Makefile:90: cache/libexla.so] Error 1
could not compile dependency :exla, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile exla --force", update it with "mix deps.update exla" or clean it with "mix deps.clean exla"
==> nerves_livebook
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. If you are using
Ubuntu or any other Debian-based system, install the packages
"build-essential". Also install "erlang-dev" package if not
included in your Erlang/OTP version. If you're on Fedora, run
"dnf group install 'Development Tools'".

Repeats on CI and on my own Linux box. This happens if I set my dependency to 0.8 instead of 0.7.3.

Anything I've missed in terms of different requirements for 0.8?

jonatanklosko commented 1 month ago

Looks specific to cross compilation, though I can't think of any specific change, beyond XLA itself.

ld: skipping incompatible cache/xla_extension/lib/libxla_extension.so when searching for -lxla_extension

This is confusing because the downloaded binary is for the target architecture.