Closed leonardorame closed 3 months ago
We are not considering this system architecture string, I improved it on main. You can workaround the error by setting XLA_TARGET_PLATFORM
explicitly. That said, as far as I understand FreeBSD has it's own libc implementation, so we don't have a precompiled binary for that. So to use XLA on that platform you need to build it locally with XLA_BUILD=true
(assuming that XLA supports FreeBSD, but since it's UNIX, I should probably be fine).
Hi @jonatanklosko, thanks for your answer. Could you explain what should I set in XLA_TARGET_PLATFORM
?.
Hi again @jonatanklosko, I've set this env var:
XLA_TARGET_PLATFORM=X86_64-FreeBSD XLA_BUILD=true
Then cloned the repository and mix deps.get
, then mix compile
, but I got this error:
** (Mix) Could not compile with "gmake" (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'".
Do you have gmake installed?
Yes I have gmake, make, gcc.
You can try running with MAKE=make
, MAKE=gmake
, I'm not sure what else it can be. If neither works, you can try invoking make explicitly like ROOT_DIR="$(pwd)" BUILD_ARCHIVE="$(pwd)/tmp/build/xla_extension.tar.gz" make
to see if there are any meaningful errors.
Running this on the cloned repo:
ROOT_DIR="$(pwd)" BUILD_ARCHIVE="$(pwd)/tmp/build/xla_extension.tar.gz" make
First asked for bazel
program, so pkg install bazel
, then tried again.
Then it needed numpy
, so I installed py39-pip
, then pip-3.9 install numpy
, and tried again.
Then it looks like the source needs g++ 14 minimum, now trying to install it.
CXXOPTS="-std=c++14" CC=gcc14 CPP=gcc14 ROOT_DIR="$(pwd)" BUILD_ARCHIVE="~/xla_extension.tar.gz" make
ERROR: /usr/home/informemedico/.cache/bazel/_bazel_informemedico/1fd8e3102f291348a56716ebce84006d/external/llvm-project/llvm/BUILD.bazel:360:11: Compiling llvm/lib/TableGen/StringMatcher.cpp [for tool] failed: (Exit 1): clang failed: error executing command (from target @llvm-project//llvm:TableGen) /usr/bin/clang -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF ... (remaining 65 arguments skipped)
In file included from external/llvm-project/llvm/lib/TableGen/StringMatcher.cpp:13:
In file included from external/llvm-project/llvm/include/llvm/TableGen/StringMatcher.h:16:
In file included from external/llvm-project/llvm/include/llvm/ADT/StringRef.h:12:
external/llvm-project/llvm/include/llvm/ADT/DenseMapInfo.h:264:26: error: no template named 'tuple_element_t' in namespace 'std'; did you mean 'tuple_element'?
using EltType = std::tuple_element_t<I, Tuple>;
~~~~~^
That error looks still related to the compiler version. On CI we actually build with gcc 9, so worth trying that.
Hi @jonatanklosko yes, just pasted that here to document my progress on buiding it. Also asked some FreeBSD folks on the #freebsd channel at irc.libera.chat to help with thiis.
Hi @jonatanklosko as you can see here: https://forums.freebsd.org/threads/trying-to-build-a-linux-c-program-on-freebsd-14-with-gcc9.92731/ I'm asking for help in the FreeBSD forums.
One conclusion I came up is that the Bazel is using /usr/bin/clang
, do you think it can be the culpit of my problem. Do you know how to change it to, for example, /usr/local/bin/gcc9
?.
Just figured out the issue was in OpenXLA, now asking there: https://github.com/openxla/xla/issues/10630
I think I made it work in a Linux Jail!
Now I need a small example to test.
Hi, trying to test this on LiveBook running on FreeBSD 14 x86_64, but I get this error:
Can you help me with this?