Performance Improvement Through Faster Software Components

Moving from the other thread to here:

Not entirely sure but based on your log I’d say the issue is that you are trying to build pillow-simd in a conda environment using your system compiler (I’m guessing, can’t tell from that output but if you haven’t specifically installed a compiler into your environment it will be your system one). It is thus looking for a jpeg package in your system not the environment (where libjpeg-turbo is) and failing. If this is the issue then it should be solved by building with a compiler in your environment. Installing jpeg on your system might solve it but using different compilers can cause issues and then your environment depends on system packages which isn’t ideal. You can install a compiler with conda install gxx_linux-64 pkgconfig (pkgconfig is used to locate installed libraries and so ensures it uses the environment ones not system ones). Then do the pip build step. Also note that you haven’t uninstalled pillow so while pillow-simd should overwrite the pillow files it could end up with a mix of files and break.

Or you could try the pillow-accel package I made. It’s still in development and hasn’t been extensively tested but I’ve run all the pillow tests against it without issue (well, one failure but not a major issue, it works just doesn’t pass the test). To install the AVX2 version run conda install -c defaults -c thomasbrandon -c conda-forge pillow-accel-avx2 (while differently named it is just pillow-simd code, the build can be seen on the Azure Pipelines project linked above and related github).
If installing it be sure to review what package changes conda install wants to make. There can be issues where conflicting dependencies cause conda to do silly things like try and switch everything to a different python version. But I think those issues should be largely resolved. One particular issue is that it currently blocks libjpeg v8 as this is replaced by libjpeg-turbo, so if another installed package wants this particular version it will want to uninstall that other package. Generally other packages will install the newer libjpeg v9 which can coexist with libjpeg-turbo which doesn’t support the v9 API. But this isn’t especially tested yet.

2 Likes