Add AIX support#1065
Open
KV2773 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds IBM AIX build support across the core shared library build and several bundled third-party dependencies, including handling of AIX-specific macro collisions and big-endian data parsing.
Changes:
- Add AIX-specific exported-symbol list support for the shared library and wire it into the build.
- Patch external dependencies (SentencePiece, OpenCV/libpng, dlib, dr_libs, BlingFire) to compile on AIX.
- Update the UGM tokenizer’s precompiled charsmap parsing to avoid strict-aliasing and handle big-endian hosts.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/ortcustomops.exp | Adds an AIX export list for shared-library symbol exports. |
| shared/api/nemo_mel_spectrogram.h | Undefines hz on AIX to avoid macro collisions with parameter names. |
| operators/tokenizer/ugm_kernels.hpp | Uses memcpy for header reads and swaps bytes on big-endian systems. |
| operators/text/vector_to_string.hpp | Renames the std::hash parameter (no functional change). |
| CMakeLists.txt | Uses .exp exports on AIX and .ver version scripts on Linux/Android. |
| cmake/externals/sentencepieceproject.cmake | Adds AIX/enum patches to the SentencePiece patch set. |
| cmake/externals/sentencepieceproject_enum.patch | Forces ScriptType enum underlying type to int32_t. |
| cmake/externals/sentencepieceproject_aix.patch | Defines endianness macro handling for AIX in SentencePiece. |
| cmake/externals/rand_aix.patch | Adds AIX fixes to OpenCV sources (macro collision + ELF/auxv guards). |
| cmake/externals/opencv.cmake | Applies additional AIX-specific OpenCV patches during fetch. |
| cmake/externals/opencv_libpng_aix.patch | Enables libpng PowerPC VSX optimizations on AIX. |
| cmake/externals/dr_libs.cmake | Applies an AIX patch to dr_libs during fetch. |
| cmake/externals/dr_libs_aix.patch | Undefines hz on AIX for dr_mp3. |
| cmake/externals/dlib.cmake | Applies an AIX patch to dlib during fetch. |
| cmake/externals/dlib_aix.patch | Updates dlib’s embedded libpng VSX detection to include AIX. |
| cmake/externals/blingfire.cmake | Applies an AIX patch and links Iconv on AIX. |
| cmake/externals/blingfire-aix.patch | Adjusts BlingFire headers for AIX (but currently breaks macOS). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #include <unordered_map> | ||
| #include <cwctype> | ||
| #include <locale> | ||
| #include <cstring> |
Comment on lines
+98
to
+99
| uint32_t xcda_blob_size; | ||
| std::memcpy(&xcda_blob_size, &charsmap_data_[0], sizeof(xcda_blob_size)); |
Comment on lines
13
to
17
|
|
||
| template <class T> | ||
| struct hash<std::vector<T>> { | ||
| size_t operator()(const vector<T>& __vector) const noexcept; | ||
| size_t operator()(const vector<T>& __vec) const noexcept; | ||
| }; |
Comment on lines
+11
to
14
| link_libraries(Iconv::Iconv) | ||
| endif() | ||
|
|
||
| FetchContent_MakeAvailable(Blingfire) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.