binary packages and CPU-features

Mikhail T. mi+thun at
Fri Jul 15 15:10:33 UTC 2016


What is the general approach to porting software, which uses advanced
CPU-features (like SSE), but has no run-time detection of them?

I just added graphics/lepton, for example, which has some functions
implemented with AVX2 intrinsics -- but whether or not to use them is
determined at compile-time... The original code also required SSE4, but
I managed to patch it to lower the requirements to SSSE3.

Typically, pre-built packages target the lowest, but this particular
program will not build without at least SSSE3 available at all.

Should there be three separate packages: lepton-avx2, lepton-ssse3, and
lepton-sse4? Maybe, our package-building infrastructure should
automatically produce different packages from ports expressing such a
desire by declaring, for example:

    CPUSPECIFIC=        avx2 ssse3 sse4
    CPUSPECIFIC_AVX2=   -mavx2
    CPUSPECIFIC_SSSE3=  -mssse3
    CPUSPECIFIC_SSE4=   -msse4.1

Should I simply set NO_PACKAGE -- to avoid a situation when a prebuilt
binary will not even start for some users (such as on older Opterons)?



More information about the freebsd-ports mailing list