[Doc] AIX build instruction (#22220)

### Description
This PR contains the steps of building onnxruntime in AIX OS.

### Motivation and Context
AIX OS users can build the onnxruntime in their local env.
This commit is contained in:
Ranjit Ranjan 2024-09-27 00:13:45 +05:30 committed by GitHub
parent b6ff0cc5fd
commit 2b89dd6cd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -107,6 +107,61 @@ The last command will generate a fat-binary for both CPU architectures.
Note: unit tests will be skipped due to the incompatible CPU instruction set when doing cross-compiling.
#### AIX
In AIX, you can build ONNX Runtime for 64bit using
* IBM Open XL compiler tool chain.
Minimum required AIX OS version is 7.2. You need to have 17.1.2 compiler PTF5 (17.1.2.5) version.
* GNU GCC compiler tool chain.
Minimum required AIX OS version is 7.3. GCC version 10.3+ is required.
For IBM Open XL, export below environment settings.
```bash
ulimit -m unlimited
ulimit -d unlimited
ulimit -n 2000
ulimit -f unlimited
export OBJECT_MODE=64
export BUILD_TYPE="Release"
export CC="/opt/IBM/openxlC/17.1.2/bin/ibm-clang"
export CXX="/opt/IBM/openxlC/17.1.2/bin/ibm-clang++_r"
export CFLAGS="-pthread -m64 -D_ALL_SOURCE -mcmodel=large -Wno-deprecate-lax-vec-conv-all -Wno-unused-but-set-variable -Wno-unused-command-line-argument -maltivec -mvsx -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare"
export CXXFLAGS="-pthread -m64 -D_ALL_SOURCE -mcmodel=large -Wno-deprecate-lax-vec-conv-all -Wno-unused-but-set-variable -Wno-unused-command-line-argument -maltivec -mvsx -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare"
export LDFLAGS="-L$PWD/build/Linux/$BUILD_TYPE/ -lpthread"
export LIBPATH="$PWD/build/Linux/$BUILD_TYPE/"
```
For GCC, export below environment settings.
```bash
ulimit -m unlimited
ulimit -d unlimited
ulimit -n 2000
ulimit -f unlimited
export OBJECT_MODE=64
export BUILD_TYPE="Release"
export CC="gcc"
export CXX="g++"
export CFLAGS="-maix64 -pthread -DFLATBUFFERS_LOCALE_INDEPENDENT=0 -maltivec -mvsx -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -fno-extern-tls-init -Wl,-berok "
export CXXFLAGS="-maix64 -pthread -DFLATBUFFERS_LOCALE_INDEPENDENT=0 -maltivec -mvsx -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -fno-extern-tls-init -Wl,-berok "
export LDFLAGS="-L$PWD/build/Linux/$BUILD_TYPE/ -Wl,-bbigtoc -lpython3.9"
export LIBPATH="$PWD/build/Linux/$BUILD_TYPE"
```
To initiate build, run the below command
```bash
./build.sh \
--config $BUILD_TYPE\
--build_shared_lib \
--skip_submodule_sync \
--cmake_extra_defines CMAKE_INSTALL_PREFIX=$PWD/install \
--parallel
```
* If you want to install the package in a custom directory, then mention the directory location as value of CMAKE_INSTALL_PREFIX.
* In case of IBM Open XL compiler tool chain, It is possible that in AIX 7.2 some of the runtime libraries like libunwind.a needed for onnxruntime, will be missing. To fix this, you can install the relevant file-sets.
* --parallel option in build option.
As name suggest, this option is for parallel building and resource intensive option. So, if your system is not having good amount of memory for each CPU core, then this option can be skipped.
* --allow_running_as_root is needed if root user is triggering the build.
#### Notes
* Please note that these instructions build the debug build, which may have performance tradeoffs. The "--config" parameter has four valid values: Debug, Release, RelWithDebInfo and MinSizeRel. Compared to "Release", "RelWithDebInfo" not only has debug info, it also disables some inlines to make the binary easier to debug. Thus RelWithDebInfo is slower than Release.
@ -131,13 +186,14 @@ Note: unit tests will be skipped due to the incompatible CPU instruction set whe
### Architectures
{: .no_toc }
| | x86_32 | x86_64 | ARM32v7 | ARM64 | PPC64LE | RISCV64 |
|-----------|:------------:|:------------:|:------------:|:------------:|:-------:|:-------:|
|Windows | YES | YES | YES | YES | NO | NO |
|Linux | YES | YES | YES | YES | YES | YES |
|macOS | NO | YES | NO | NO | NO | NO |
|Android | NO | NO | YES | YES | NO | NO |
|iOS | NO | NO | NO | YES | NO | NO |
| | x86_32 | x86_64 | ARM32v7 | ARM64 | PPC64LE | RISCV64 | PPC64BE |
|-----------|:------------:|:------------:|:------------:|:------------:|:-------:|:-------:| :------:|
|Windows | YES | YES | YES | YES | NO | NO | NO |
|Linux | YES | YES | YES | YES | YES | YES | NO |
|macOS | NO | YES | NO | NO | NO | NO | NO |
|Android | NO | NO | YES | YES | NO | NO | NO |
|iOS | NO | NO | NO | YES | NO | NO | NO |
|AIX | NO | NO | NO | NO | NO | NO | YES |
### Build Environments(Host)
{: .no_toc }