-
Notifications
You must be signed in to change notification settings - Fork 247
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
Assistance on building 32-bit wheels for PyTables #568
Comments
Oh, I can see it works already [1]. The proof is that running docker run -it --rm dockcross/manylinux2014-x64 bash
linux32 yum install -y blosc-devel bzip2-devel hdf5-devel lz4-devel lzo-devel snappy-devel libzstd-devel zlib-devel will unfortunately (but probably obviously) croak with
Bummer! [1] https://github.com/daq-tools/PyTables/runs/1798360495?check_suite_focus=true#step:7:565 |
So, I just tried to run a recipe I was imagining without using # Use a modern variant of `manylinux`
docker run -it --rm dockcross/manylinux2014-x64 bash
# Install prerequisites
yum install -y python3 python3-devel python3-numpy python3-numexpr
yum install -y blosc-devel bzip2-devel hdf5-devel lz4-devel lzo-devel snappy-devel libzstd-devel zlib-devel
pip3 install numpy numexpr cython wheel
# Get sources
git clone https://github.com/PyTables/PyTables
cd PyTables
# Configure build
export PYTABLES_NO_EMBEDDED_LIBS=true
export DISABLE_AVX2=true
# Build 64-bit wheel
python3 setup.py bdist_wheel
# Build 32-bit wheel
linux32 python3 setup.py bdist_wheel and the outcome was ls -l dist
tables-3.6.2.dev0-cp36-cp36m-linux_i686.whl
tables-3.6.2.dev0-cp36-cp36m-linux_x86_64.whl Do you believe it is sane what I am attempting here in order to create both 32-bit and 64-bit wheels for Linux? If so, do you believe we could make this recipe work with |
@amotl, no, that's not true. |
Is there a reason you cannot use |
Hi Yannick, thanks for looking into this. I am already past my initial bummer:
Oh, I didn't try. Apologies! Somehow I did misinterpret something that there would be no images for I will try that and report back to you how it goes along building wheels for PyTables. With kind regards, |
Right, sorry! Just wanted to clarify :-) If not, I can dive deeper. But normally, using 32-bit images for 32-bit builds is the most straightforward. Cross-compilation is not really supported (yet) by If things don't work out, let me know, and I'll have a deeper dive than these two superficial messages! |
Hi Yannick, trying Just to keep you in the loop: Of course I tried the regular
If you can have a deeper look, I would appreciate that very much. With kind regards, |
@amotl You may look to my repository for building imagecodces wheels https://github.com/Czaki/imagecodecs_build. I just use build my own docker images https://github.com/Czaki/imagecodecs_build/blob/master/build_utils/Dockerfile_i686 and build part of libraries present for x86_64 and missed for i686. I do not know which ones are missed. Maybe they are present in https://hub.docker.com/r/bokota/imagecodecs_i686, but this image is not updated regularly. |
Hah, that's annoying. But you will need |
So you want to do the yum install in 64 bit mode, but the build in 32 bit? I'm guessing blosc would then have to only be used for some stage of the build but not included in any way in the wheel itself? I'm sure things like the hdf5 libraries would need to match the build arch. |
Hi again, thanks for your answers. I understand that the idea of building 32-bit wheels on 64-bit Linux is utter Quatsch. Apologies! Now, I am still struggling to find appropriate 32-bit images to get hold of the build prerequisites. Thank you for suggesting docker run -it --rm bokota/imagecodecs_i686 bash
yum install -y blosc-devel bzip2-devel hdf5-devel lz4-devel lzo-devel snappy-devel libzstd-devel zlib-devel
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/i386/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base With kind regards, |
Even after fixing docker run -it --rm dockcross/manylinux2014-x86 bash
echo $'#!/bin/bash\nLD_PRELOAD=/usr/lib/libcurl.so.4 /usr/bin/yum "$@"' > /usr/local/bin/yum and manually installing EPEL like yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm there is no joy because EPEL apparently stopped being available for 32-bit starting with CentOS version 7, see [1,2]. yum install -y blosc-devel bzip2-devel hdf5-devel lz4-devel lzo-devel snappy-devel libzstd-devel zlib-devel
Cannot retrieve metalink for repository: epel/i386. Please verify its path and try again [1] https://archives.fedoraproject.org/pub/archive/epel/6/i386/ |
This images contains compiled from source these libraries: Maybe it covers these libraries which are missed from repositories. Otherwise, I suggest basing on my work and prepare own Dockerfile with libraries compiled from the source. |
Dear Grzegorz, this looks really nice, thanks. Apparently, only With kind regards, |
Hi again, I took a quick look and found that even more libraries are installed. Let me write down a short summary about what I was able to confirm.
Regarding
Would you accept respective patches to With kind regards, [1] https://forums.cpanel.net/threads/yumrepo-error-and-cannot-find-valid-baseurl.682465/ |
Create PR. i will rebuild docker images these evening. |
Shouldn't you be able to add them to a manylinux image as well, and get things going this way? |
Hi Yannick, I would prefer using vanilla That's why I appreciated the idea by @Czaki because, apparently, many of those prerequisites are already satisfied by the On the other hand, I also added a fix to make With kind regards, [1] https://pkgs.org/search/?q=blosc-devel |
@amotl, right, sorry. I definitely don't know too much about this either, but I saw the |
Hmmm, but there is |
Dear Yannick, I tried a few of those packages from non-CentOS distributions by attempting to install them directly (using the HTTP URL) without using any package repository flavor of CentOS at all. The outcome is usually that the process croaks on dependency hell aspects like those: yum install -y http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/i586/RPMS.classic/libblosc-devel-1.18.1-alt1.i586.rpm
Error: Package: libblosc-devel-1.18.1-alt1.i586 (/libblosc-devel-1.18.1-alt1.i586)
Requires: libblosc = -alt1:sisyphus+250012.100.1.1 yum install -y http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/i586/RPMS.classic/libblosc-1.18.1-alt1.i586.rpm
Error: Package: libblosc-1.18.1-alt1.i586 (/libblosc-1.18.1-alt1.i586)
Requires: libzstd.so.1 >= liEXtCElKAXDD2 In fact, all of Don't even get me started on With kind regards, [1] Springdale Computational i386: https://centos.pkgs.org/6/springdale-computational-i386/hdf5-devel-1.8.5.patch1-7.sdl6.i686.rpm.html |
I have to correct this statement. On docker run -it --rm quay.io/pypa/manylinux2010_i686 bash
cat /etc/centos-release
CentOS release 6.10 (Final) yum install -y blosc-devel bzip2-devel hdf5-devel lz4-devel lzo-devel snappy-devel libzstd-devel zlib-devel
No package blosc-devel available. However, trying to add those yum install -y http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/i586/RPMS.classic/libblosc-devel-1.18.1-alt1.i586.rpm
Error: Package: libblosc-devel-1.18.1-alt1.i586 (/libblosc-devel-1.18.1-alt1.i586)
Requires: libblosc = -alt1:sisyphus+250012.100.1.1 blocking on: yum install -y http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/i586/RPMS.classic/libblosc-1.18.1-alt1.i586.rpm
ERROR You need to update rpm to handle:
rpmlib(SetVersions) is needed by libblosc-1.18.1-alt1.i586 |
By following the suggestion to use # Use classic `manylinux2010_i686`
docker run -it --rm quay.io/pypa/manylinux2010_i686 bash
# Install baseline prerequisites
yum install -y bzip2-devel hdf5-devel lz4-devel lzo-devel snappy-devel libzstd-devel zlib-devel
# Install libblosc from "ALT Linux Sisyphus"
yum install -y wget
wget http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/i586/RPMS.classic/libblosc-1.18.1-alt1.i586.rpm
wget http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/i586/RPMS.classic/libblosc-devel-1.18.1-alt1.i586.rpm
rpm --install --nodeps libblosc-1.18.1-alt1.i586.rpm libblosc-devel-1.18.1-alt1.i586.rpm
# Build 32-bit wheel
export PATH=/opt/python/cp39-cp39/bin:$PATH
pip install numpy numexpr cython wheel
git clone https://github.com/PyTables/PyTables
cd PyTables
export PYTABLES_NO_EMBEDDED_LIBS=true
export DISABLE_AVX2=true
python setup.py bdist_wheel
# Outcome
ls dist/
tables-3.6.2.dev0-cp39-cp39-linux_i686.whl After installing it, it shows >>> tables.print_versions()
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PyTables version: 3.6.2.dev0
HDF5 version: 1.8.5-patch1
NumPy version: 1.20.0
Numexpr version: 2.7.2 (not using Intel's VML/MKL)
Zlib version: 1.2.3 (in Python interpreter)
LZO version: 2.03 (Apr 30 2008)
BZIP2 version: 1.0.5 (10-Dec-2007)
Blosc version: 1.18.1 (2020-03-29)
Blosc compressors: blosclz (2.0.0), lz4 (1.9.2), lz4hc (1.9.2), snappy (unknown), zlib (1.2.11), zstd (1.4.4)
Blosc filters: shuffle, bitshuffle
Cython version: 0.29.21
Python version: 3.9.1 (default, Jan 24 2021, 15:58:04)
[GCC 8.3.1 20190311 (Red Hat 8.3.1-3)]
Platform: Linux-4.19.76-linuxkit-i686-with-glibc2.12
Byte-ordering: little
Detected cores: 4
Default encoding: utf-8
Default FS encoding: utf-8
Default locale: (en_US, UTF-8)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [1] https://serverfault.com/questions/381018/tell-yum-to-ignore-a-single-dependency |
Nice work, @amotl, congrats! |
Nice piece of work! |
Hi @Czaki, as you can see, I have been able to base the recipe upon the baseline However, I would like to eventually come back to submitting a patch to Maybe I should carry those notes over to another issue on the With kind regards, |
do it |
Thanks, I've just added Czaki/imagecodecs_build#1. So, I am closing this now and again - thanks for all the fish! |
Thanks for the patience and explanations, @amotl! |
Dear @joerick, @YannickJadoul, @Czaki, @henryiii and all other contributors,
thank you so much for conceiving and maintaining this excellent tool. It saves so many lives!
I am currently working on PyTables/PyTables#823 on behalf of PyTables/PyTables#872 and want to humbly ask for your assistance. While there might be more things to discuss in this regard, I currently want to focus on one specific detail.
Attaching to #336 and #338, I see that you added the possibility to run jobs within Docker through
linux32
, which is also referenced at [1]. If I am getting this right,linux32
might be used to build 32-bit wheels for Linux even when running on a 64-bit platform / container image?Now, I am asking about the correct usage. At https://github.com/joerick/cibuildwheel/blob/acd93000777eed59c0a9b4e3bf8986a50aeb56e6/cibuildwheel/linux.py#L120, the
simulate_32_bit
option is enabled conditionally when the name of the image's platform tag ends withi686
. So, I figure this would not trigger when using ax64
build image for both variants likeright?
Maybe you can help in this regard how I could make
cibuildwheel
use thissimulate_32_bit
option when being configured with the same 64-bit image for running both manylinux targets (32-bit and 64-bit) like outlined above. Maybe I am getting this completely wrong and it would in fact never work. If this is the case, I will also be happy about any enlightenment.With kind regards,
Andreas.
[1] https://github.com/pypa/manylinux#example
The text was updated successfully, but these errors were encountered: