[Pkg-phototools-devel] Bug#857147: darktable builds with -msse2 on i386

Roman Lebedev lebedev.ri at gmail.com
Thu Mar 9 06:20:37 UTC 2017


On Thu, Mar 9, 2017 at 1:07 AM, Adrian Bunk <bunk at debian.org> wrote:
> On Wed, Mar 08, 2017 at 04:25:18PM +0300, Roman Lebedev wrote:
>> On Wed, Mar 8, 2017 at 3:38 PM, Adrian Bunk <bunk at debian.org> wrote:
>> > Source: darktable
>> > Version: 2.2.1-2
>> > Severity: serious
>> >
>> > https://buildd.debian.org/status/fetch.php?pkg=darktable&arch=i386&ver=2.2.1-2&stamp=1483383078&raw=0
>> >
>> > ...
>> > -- Performing Test _MSSE2
>> > -- Performing Test _MSSE2 - Success
>> > -- Building SSE2-optimized codepaths: ON
>> > ...
>> > [  4%] Building C object src/external/LuaAutoC/CMakeFiles/lautoc.dir/lautoc.c.o
>> > cd /«PKGBUILDDIR»/obj-i686-linux-gnu/src/external/LuaAutoC && /usr/bin/cc  -DGDK_DISABLE_DEPRECATED -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_14 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_MIN_REQUIRED -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES -DHAVE_BUILTIN_CPU_SUPPORTS -DHAVE_CONFIG_H -DHAVE_GPHOTO2 -DHAVE_GPHOTO_25_OR_NEWER -DHAVE_GRAPHICSMAGICK -DHAVE_HTTP_SERVER -DHAVE_KWALLET -DHAVE_LENSFUN -DHAVE_LIBSECRET -DHAVE_OPENCL -DHAVE_OPENEXR -DHAVE_OPENJPEG -DUSE_LUA -D_RELEASE -D_XOPEN_SOURCE=700 -D__GDK_KEYSYMS_COMPAT_H__ -I/«PKGBUILDDIR»/src -I/«PKGBUILDDIR»/src/external -isystem /usr/include/glib-2.0 -isystem /usr/lib/i386-linux-gnu/glib-2.0/include -isystem /usr/include/gtk-3.0 -isystem /usr/include/at-spi2-atk/2.0 -isystem /usr/include/at-spi-2.0 -isystem /usr/include/dbus-1.0 -isystem /usr/lib/i386-linux-gnu/dbus-1.0/include -isystem /usr/include/gio-unix-2.0 -isystem /usr/include/cairo -isystem /usr/include/pango-1.0 -isystem /usr/include/harfbuzz -isystem /usr/include/atk-1.0 -isystem /usr/include/pixman-1 -isystem /usr/include/freetype2 -isystem /usr/include/libpng16 -isystem /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/libxml2 -isystem /usr/include/libsoup-2.4 -isystem /usr/include/OpenEXR -isystem /usr/include/lensfun -isystem /usr/include/librsvg-2.0 -isystem /usr/include/i386-linux-gnu -isystem /usr/include/json-glib-1.0 -isystem /usr/include/openjpeg-2.1 -isystem /usr/include/libsecret-1 -isystem /usr/include/GraphicsMagick -I/«PKGBUILDDIR»/obj-i686-linux-gnu/src -isystem /usr/include/lua5.2 -I/«PKGBUILDDIR»/src/external/LuaAutoC -I/«PKGBUILDDIR»/src/external/LuaAutoC/include  -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -fno-strict-aliasing -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wold-style-declaration -Wno-error=varargs -Wframe-larger-than=32768 -Wstack-usage=32768 -Wlarger-than=524288 -std=c99 -fopenmp -pthread -mtune=generic -msse2 -g -mfpmath=sse -std=gnu99 -Wall -Wno-unused -O3 -g  -fPIC   -o CMakeFiles/lautoc.dir/lautoc.c.o   -c /«PKGBUILDDIR»/src/external/LuaAutoC/lautoc.c
>> > ...
>> >
>> > These are not SSE2 codepaths with autodetection,
>> > the package seems to be built in a way that it
>> > won't run on hardware without SSE2.
>> Hi.
>>
>> Given that arm64 is now 'supported', it is certainly possible to build
>> without SSE2.

> What is actually the reason why arm64 is declared supported but
> mips64el and ppc64el are not?
Patches welcomed.
1. upstream, do not really care about those.
2. in all this time, no one ever asked upstream about support for those
3. first tell gdk-pixbuf-2.0 to fix their ppc64le build:
>From OBS, openSUSE_Tumbleweed_PowerPC/ppc64le:

[  144s] cd /home/abuild/rpmbuild/BUILD/darktable-2.3.0+git385.baec33f/build/src
&& /usr/bin/cc  -DGDK_DISABLE_DEPRECATED
-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_14
-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_MIN_REQUIRED
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGTK_DISABLE_DEPRECATED
-DGTK_DISABLE_SINGLE_INCLUDES -DHAVE_CONFIG_H -DHAVE_GPHOTO2
-DHAVE_GPHOTO_25_OR_NEWER -DHAVE_GRAPHICSMAGICK -DHAVE_HTTP_SERVER
-DHAVE_KWALLET -DHAVE_LENSFUN -DHAVE_LIBSECRET -DHAVE_MAP
-DHAVE_OPENCL -DHAVE_OPENEXR -DHAVE_OPENJPEG
-DHAVE_OSMGPSMAP_110_OR_NEWER -DHAVE_PRINT -DUSE_COLORDGTK -DUSE_LUA
-D_RELEASE -D_XOPEN_SOURCE=700 -D__GDK_KEYSYMS_COMPAT_H__
-Dlib_darktable_EXPORTS
-I/home/abuild/rpmbuild/BUILD/darktable-2.3.0+git385.baec33f/src
-isystem /home/abuild/rpmbuild/BUILD/darktable-2.3.0+git385.baec33f/src/external
-isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include
-isystem /usr/include/gtk-3.0 -isystem /usr/include/at-spi2-atk/2.0
-isystem /usr/include/at-spi-2.0 -isystem /usr/include/dbus-1.0
-isystem /usr/lib64/dbus-1.0/include -isystem
/usr/include/gio-unix-2.0 -isystem /usr/include/pkg/libxkbcommon
-isystem /usr/include/wayland -isystem /usr/include/cairo -isystem
/usr/include/pango-1.0 -isystem /usr/include/harfbuzz -isystem
/usr/include/atk-1.0 -isystem /usr/include/pixman-1 -isystem
/usr/include/freetype2 -isystem /usr/include/libdrm -isystem
/usr/include/libpng16 -isystem /usr/include/gdk-pixbuf-2.0 -isystem
/usr/include/libxml2 -isystem /usr/include/libsoup-2.4 -isystem
/usr/include/OpenEXR -isystem /usr/include/lensfun -isystem
/usr/include/librsvg-2.0 -isystem /usr/include/json-glib-1.0 -isystem
/usr/include/openjpeg-2.1 -isystem /usr/include/libsecret-1 -isystem
/usr/include/GraphicsMagick
-I/home/abuild/rpmbuild/BUILD/darktable-2.3.0+git385.baec33f/build/src
-I/home/abuild/rpmbuild/BUILD/darktable-2.3.0+git385.baec33f/src/external/LuaAutoC
-isystem /usr/include/osmgpsmap-1.0 -isystem /usr/include/colord-1
-isystem /home/abuild/rpmbuild/BUILD/darktable-2.3.0+git385.baec33f/build/src/external/rawspeed/src
-isystem /home/abuild/rpmbuild/BUILD/darktable-2.3.0+git385.baec33f/src/external/rawspeed/src/librawspeed
 -fmessage-length=0 -grecord-gcc-switches -O2 -Wall
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables
-fasynchronous-unwind-tables -g -DNDEBUG -Wall -fno-strict-aliasing
-Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla
-Wold-style-declaration -Wno-error=varargs -Wframe-larger-than=32768
-Wstack-usage=32768 -Wlarger-than=524288 -std=c99 -fopenmp   -g -O3
-DNDEBUG -O3 -ffast-math -fno-finite-math-only
-fexpensive-optimizations -fPIC   -o
CMakeFiles/lib_darktable.dir/common/bilateralcl.c.o   -c
/home/abuild/rpmbuild/BUILD/darktable-2.3.0+git385.baec33f/src/common/bilateralcl.c
[  144s] /usr/include/gtk-3.0/gdk/deprecated/gdkcolor.h:56:11: error:
two or more data types in declaration specifiers
[  144s]    guint32 pixel;
[  144s]            ^
[  144s] /usr/include/gtk-3.0/gdk/deprecated/gdkcolor.h:56:11: error:
two or more data types in declaration specifiers
[  144s]    guint32 pixel;
[  144s]            ^
[  144s] /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h:364:56:
error: two or more data types in declaration specifiers
[  144s]                                           guint32       pixel);
[  144s]                                                         ^
[  144s] /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h:364:56:
error: two or more data types in declaration specifiers
[  144s]                                           guint32       pixel);
[  144s]                                                         ^
[  145s] make[2]: ***
[src/CMakeFiles/lib_darktable.dir/build.make:176:
src/CMakeFiles/lib_darktable.dir/common/bilateralcl.c.o] Error 1

pixel is a type on ppc, so it can not be used as variable identifier.

> Even if the package works properly only on 64bit little endian,
> all of them should work equally well.
Maybe yes, maybe no. I have no such hardware/means/interest to
build/port/debug for these arches.

>> However, there is a run-time detection, and if there is no SSE2,
>> darktable will (should?) nicely refuse to start.
>
> It is just a warning.
Ah right, it was changed when adding SSE-less support.

> And the file where the detection code is is itself built with
> "-msse2 -mfpmath=sse"...
>
> Upstream seems to have the bug of first implementing proper
> autodetection and (at least partially with ->funcsse) runtime
> selection, and then building *everything* with -msse2.
>
>> Given the nature of the program - computationally-intensive - it makes
>> very little sense to run it on
>> ancient hardware.
>
> And it does not make sense to run i386 on non-ancient hardware.
>
> Netbooks with older Intel Atoms or the OLPC XO are basically the most
> recent machines where amd64 cannot be used.
>
> It is also dangerous to make the supported CPUs a per-package decision:
> You would quickly end up with some packages requiring AVX, or using
> features that are only present on recent Intel (and not AMD) CPUs.
>
>> As of 2.0 release, non-64bit build is pretty much deprecated.
>> It prints noisy GUI message, and frequently crashes.
>>...
>> So if this is so serous, I'd propose to just kill i386 build for dt.

> Even ignoring the SSE2 question, aren't you basically saying that the
> i386 package is known broken - and upstream doesn't give a damn?
Exactly, it was pretty much intentional decision.
It *will* be broken on 32-bit, due to to limited virtual address space.
https://github.com/darktable-org/darktable/blob/8c50aa303a3b7d0ef0035614dba6a1ff9d12363b/src/common/cache.c#L217-L218

And i can tell you even more - i'm part of upstream.

>> Roman.
>
> cu
> Adrian
Roman.

> --
>
>        "Is there not promise of rain?" Ling Tan asked suddenly out
>         of the darkness. There had been need of rain for many days.
>        "Only a promise," Lao Er said.
>                                        Pearl S. Buck - Dragon Seed
>



More information about the Pkg-phototools-devel mailing list