Skip to content
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

[Build] Cross compiling for ARM with simulation failed at v1.16.1 #17952

Closed
y-okumura-isp opened this issue Oct 14, 2023 · 2 comments
Closed
Labels
build build issues; typically submitted using template

Comments

@y-okumura-isp
Copy link

y-okumura-isp commented Oct 14, 2023

Describe the issue

Cross compiling for ARM with simulation failed at v 1.16.1.
It looks CentOS7 python version=3.6.8 is old (need 3.7+).

BTW v1.15.1 needs 3.5+, so we didn't have this error.

Urgency

no

Target platform

Ubuntu 20.04 x86_64

Build script

We followed the steps in https://github.com/microsoft/onnxruntime/blob/v1.16.1/dockerfiles/README.md#arm-3264.

git clone https://github.com/microsoft/onnxruntime.git
cd onnxruntime

git submodule update --init
docker build -t onnxruntime-source -f Dockerfile.arm64 ..

Error / output

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
2023-10-14 06:13:37,919 tools_python_utils [INFO] - flatbuffers module is not installed. parse_config will not be available
Traceback (most recent call last):
  File "/code/tools/ci_build/build.py", line 65, in <module>
    _check_python_version()
  File "/code/tools/ci_build/build.py", line 53, in _check_python_version
    f"Invalid Python version. At least Python 3.{required_minor_version} is required. "
__main__.UsageError: Invalid Python version. At least Python 3.7 is required. Actual Python version: 3.6.8 (default, Jun 20 2023, 11:42:12)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
The command '/bin/sh -c /code/dockerfiles/scripts/install_centos_arm64.sh && cd /code && CC=/opt/rh/devtoolset-10/root/usr/bin/gcc CXX=/opt/rh/devtoolset-10/root/usr/bin/g++ ./build.sh --allow_running_as_root --skip_submodule_sync --config Release --build_wheel --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER)' returned a non-zero code: 1

Visual Studio Version

No response

GCC / Compiler Version

No response

@y-okumura-isp y-okumura-isp added the build build issues; typically submitted using template label Oct 14, 2023
@snnn snnn closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2023
@snnn
Copy link
Member

snnn commented Oct 16, 2023

Try the latest code:
https://github.com/microsoft/onnxruntime/tree/main/dockerfiles#cpu

I fixed the issue in #16856 but I wasn't able to get it into the last release.

@y-okumura-isp
Copy link
Author

Thank you for your quick reply.

As I wanted to use the tagged version, I updated CentOS python version.
I'm looking forward to use the latest code next time.

Here are my commands to build ONNX Runtime v1.15.1 with python 3.8.10.


(step1) build as-is (with python 3.6.15)

git checkout -b v1.15.1 refs/tags/v1.15.1

cd dockerfiles
docker build -t onnxruntime-source -f Dockerfile.arm64 ..

docker run -it --rm onnxruntime-source

(step2) update python and rebuild

Run stage-0 container.

$ docker images

REPOSITORY                                        TAG                                 IMAGE ID       CREATED         SIZE
onnxruntime-source                                latest                              a0e76562f63e   38 hours ago    613MB
<none>                                            <none>                              d53b63fd2ad9   38 hours ago    2.29GB  // stage-0 image. use this

$ docker run -it d53b63fd2ad9 /bin/bash

In the container:

# build & install python
cd /root
wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz
tar zxf Python-3.8.6.tgz
cd Python-3.8.6

# https://www.python.jp/install/centos/index.html
yum groupinstall "development tools"
yum install bzip2-devel gdbm-devel libffi-devel \
  libuuid-devel ncurses-devel openssl-devel readline-devel \
  sqlite-devel xz-devel zlib-devel tk-devel

./configure --enable-optimizations --enable-shared
make -j8
make install

# remove python 3.6.15 devel package just to be sure
yum remove python3-devel

# build ONNX Runtime
cd /code

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
python3.8 -m pip install numpy packaging wheel

cd /code
CC=/opt/rh/devtoolset-10/root/usr/bin/gcc CXX=/opt/rh/devtoolset-10/root/usr/bin/g++ ./build.sh --allow_running_as_root --skip_submodule_sync --config Release --build_wheel --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template
Projects
None yet
Development

No branches or pull requests

2 participants