-
Notifications
You must be signed in to change notification settings - Fork 184
Unsupported Architecture Issue while cross-compiling on linux #1308
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
Comments
Please set CMAKE_SYSTEM_PROCESSOR in the toolchain cmake file |
Dear @snnn [ 89%] Building CXX object CMakeFiles/onnxruntime-genai.dir/src/webgpu/interface.cpp.o On debugging, I have found that RTLD_DI_ORIGIN is undefined incase we are compiling the source code for Android or Apple. But I am buildng right now with custom toolchain and build command used is below, so not sure the cause of the error: Build Command: |
You are building it for musl? We never tested the config. I believe the error was because the libc doesn't have the RTLD_DI_ORIGIN symbol. I think we should add a check to this project's top level CMakeLists.txt to check if the symbol exists, then add #ifdef to the code that caused the error. Then the build will pass, but, certainly the functionalities that rely on the code path wouldn't work. It's not big deal I think, if you only use the default CPU execution provider. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I am trying to build onnx-genai library(shared object) by cross compiling for a linux based custom architecture. I have made the same for onnxruntime and I am able to build, while facing below issue while building onnx-genai:
-- Fetch json
-- Tokenizer needed.
-- math lib 'libm' not found; floating point support disabled
CMake Error at cmake/global_variables.cmake:153 (message):
Unsupported architecture. CMAKE_SYSTEM_PROCESSOR:
Call Stack (most recent call first):
CMakeLists.txt:37 (include)
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "/home/test/onnxruntime/onnxruntime-genai/build.py", line 656, in
update(arguments, environment)
File "/home/test/onnxruntime/onnxruntime-genai/build.py", line 574, in update
util.run(command, env=env)
File "/home/test/onnxruntime/onnxruntime-genai/tools/python/util/run.py", line 56, in run
completed_process = subprocess.run(
File "/usr/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/bin/cmake', '-G', 'Unix Makefiles', '-DCMAKE_BUILD_TYPE=MinSizeRel', '-S', '/home/test/onnxruntime/onnxruntime-genai', '-B', '/home/test/onnxruntime/onnxruntime-genai/build/basic/MinSizeRel', '-DCMAKE_POSITION_INDEPENDENT_CODE=ON', '-DUSE_CUDA=OFF', '-DUSE_ROCM=OFF', '-DUSE_DML=OFF', '-DENABLE_JAVA=OFF', '-DBUILD_WHEEL=ON', '-DCMAKE_TOOLCHAIN_FILE=/home/test/custom-toolchains/toolchains/aarch64-custom-linux-musl/tools.cmake', '-DCMAKE_POSITION_INDEPENDENT_CODE=ON']' returned non-zero exit status 1.
The command used to build is below:
./build.sh --build_dir build/basic --config MinSizeRel --parallel --cmake_extra_defines CMAKE_TOOLCHAIN_FILE="/test/custom-toolchains/toolchains/aarch64-custom-linux-musl/tools.cmake" CMAKE_POSITION_INDEPENDENT_CODE=ON --skip_tests
The debugging suggest the below line in build.py causing the error:
build.py", line 574, in update
util.run(command, env=env)
Is the linux environment not supported for cross compiling or is it some other issue?
The text was updated successfully, but these errors were encountered: