Updates:
To resolve this, we plan to introduce an option that packages a
_manylinux.pymodule
The corresponding fix has been reviewed and integrated. For reference, see pull request Slicer#8168.
Add support for configuring _manylinux module
For convenience and future reference, the associated pull request description is also copied below:
This commit introduces the ability to configure a
_manylinuxmodule in the Slicer build system to enhance compatibility when installing binary Python wheels.This update resolves potential issues with installing Python wheels built for newer GLIBC versions or ABIs, which could cause crashes in environments with older configurations.
Specifically, installing
manylinux_2_28_x86_64ITK wheels compiled with_GLIBCXX_USE_CXX11_ABI=1was causing segmentation faults in the Stable Slicer version, which is compiled with_GLIBCXX_USE_CXX11_ABI=0. The_manylinuxmodule ensures thatmanylinux_2_17_x86_64ITK wheels are always installed, even when Slicer and its associated Python interpreter are executed on newer operating systems.The
_manylinux.pymodule is dynamically generated during the build process and ensures that Python packages installed viapipare compatible with the GLIBC version used in the Slicer build environment.Summary of Changes
External_python.cmake:
- Added logic to configure
_manylinux.pyfor Linux-based build environments.- By default,
_manylinux.pyis generated. If disabled using the CMake optionPYTHON_CONFIGURE_MANYLINUX_MODULE, any existing_manylinux.pymodule is removed to prevent inadvertent impacts on Python package installations.- Introduced a CMake option
PYTHON_REMOVE_MANYLINUX_MODULE_IF_EXISTSto allow users to disable the removal of an existing_manylinux.pymodule.
python_configure_manylinux_module.cmake:
- New CMake script to detect the system’s GLIBC version using
ldd.- Dynamically generates the
_manylinux.pymodule, which includes:
- A
manylinux_compatiblefunction to override the default behavior ofpipfor checking compatibility of manylinux tags.- Embedded documentation and compatibility checks to prevent crashes caused by mismatched ABI or GLIBC versions.
By restricting installed packages to compatible manylinux tags, this update ensures stability and reliability for Python packages in the Slicer ecosystem.
References