Package Details: libjxl-git 0.11.0.r55.g8da7c884-1

Git Clone URL: https://aur.archlinux.org/libjxl-git.git (read-only, click to copy)
Package Base: libjxl-git
Description: JPEG XL image format reference implementation (git version)
Upstream URL: https://jpeg.org/jpegxl/
Keywords: jpeg-xl
Licenses: BSD-3-Clause
Conflicts: libjpeg-xl-git, libjxl
Provides: libjpeg-xl-git, libjxl, libjxl.so, libjxl_threads.so
Replaces: libjpeg-xl-git
Submitter: dbermond
Maintainer: dbermond
Last Packager: dbermond
Votes: 15
Popularity: 0.65
First Submitted: 2021-06-02 18:30 (UTC)
Last Updated: 2024-11-09 22:47 (UTC)

Dependencies (26)

Required by (88)

Sources (11)

Latest Comments

« First ‹ Previous 1 .. 8 9 10 11 12 13

dbermond commented on 2020-03-03 01:50 (UTC)

@RubenKelevra I've fixed the avx2 patch, so that the package now builds when using the default generic architecture. Thanks for reporting this.

Still requires sse4 at runtime of course.

dbermond commented on 2020-03-03 01:28 (UTC)

@RubenKelevra There is no auto switch, as it should not be this way. Users wanting avx2 support should manually disable the corresponding patch on the PKGBUILD.

PKGBUILDs are not supposed to be like the way you suggested. There should not be exit calls based on hardware, and neither automatic patch file deletion.

RubenKelevra commented on 2020-03-02 20:58 (UTC)

You could just add something like this to your prepare script, to avoid even trying to compile the package with a CPU not able to handle sse4.

And to readd avx2 support dynamically if the CPU supports it.

if [ "$(cat /proc/cpuinfo | grep -E "^flags" | grep -e "sse4_2" | wc -l)" -eq 0 ]; then
    echo "this package requires SSE4 to work"
    exit 1
elif [  "$(cat /proc/cpuinfo | grep -E "^flags" | grep -e "avx2" | wc -l)" -gt 0 ];
    # avx2 detected, remove patch 
    rm '040-libjpeg-xl-git-disable-avx2-avx512.patch'
fi

RubenKelevra commented on 2020-03-02 20:47 (UTC) (edited on 2020-03-02 20:48 (UTC) by RubenKelevra)

Alright, I figured out what's going wrong on the second machine (which got AVX2).

The machine has the default arch settings for c/cpp compiler for the target set, which is just -march=x86_64 and -mtune=generic.

This package requires that -march is set to native and -mtune can be deleted.

This obviously makes more sense on package level, where you would need to overwrite the CFLAGS/CXXFLAGS accordingly.

RubenKelevra commented on 2020-03-02 19:35 (UTC)

@dbermond thanks!

SSE4 is extremely common in processors deployed in the field, but avx2 is not, since many SSE4 processors have still not reached their end of service life to be replaced by something new.

Is the switch dynamic? (Haven't looked at the pkgbuild) since avx2 capable processors should be able to use avx2, since it makes a huge difference.

dbermond commented on 2020-03-02 01:15 (UTC)

@RubenKelevra Thanks for appreciating this package. Regarding the errors, I cannot reproduce them. Package is building fine for me.

I've disabled avx2 support and it should now work in older cpus. Please note that upstream states that it needs the sse4 instruction set, so this will not run in a generic x86_64 cpu which lacks sse4.

RubenKelevra commented on 2020-02-26 19:55 (UTC)

I tried it on a different machine, which got an older processor. Looks like this processor isn't supported :/

https://pastebin.com/4UqWGh3B

Is there a chance that you add the ability to select at build time if the CPU can run AVX2 and patch the file according to documentation?

CPU requirements
When running on Intel/AMD CPUs the software currently requires AVX2 support
(introduced by Intel in 2013 and AMD in 2015). If not supported by the CPU or
VM, the software will print "CPU does not support all enabled targets =>
exiting". You can either run on a more recent CPU/VM, or instruct the software
to only use/require SSE4 by uncommenting the line near the bottom of
third_party/highway/hwy/target.h:
// #define HWY_DISABLE_AVX2

RubenKelevra commented on 2020-02-26 16:50 (UTC)

Thanks for this package!

Tried to compile it and run into an error:

https://pastebin.com/LY0Qw4KM