tag 954917 + patch
user [email protected]
usertag 954917 + cpu
thanks

On Wed, 25 Mar 2020 10:39:36 +0100 Laurent Bigonville <[email protected]> wrote:

> Hello,
>
> I see that the configure is autodetecting at buildtime whether several
> CPU optimisations (SSE, SSE3, AVX) should be enabled or not.
>
> I feel this is not OK as building the package on different hardware
> would result in different binaries being generated.
>
> AFAICS, the code is detecting at runtime if the CPU is supporting these
> features, so I think that it's fine to force enable these 3 on i386 and
> amd64 and not rely on autodetection in the configure (and force disable
> them on the other architectures).
>
> On x32 port, the package FTBFS due to an issue related to this.

Please find here a patch that fixes all of this

diff -Nru gdal-3.0.4+dfsg/debian/rules gdal-3.0.4+dfsg/debian/rules
--- gdal-3.0.4+dfsg/debian/rules	2020-01-08 07:12:56.000000000 +0100
+++ gdal-3.0.4+dfsg/debian/rules	2020-04-12 10:36:03.000000000 +0200
@@ -45,6 +45,16 @@
   WITH_HDF5:=
 endif
 
+# Always enable the CPU optimizations on x86(_64) architectures as their
+# presence is detected at runtime. This avoid relying on the CPU of the buildd.
+# On x32 the optimizations should be enabled too, but the pkg FTBFS with them
+# enabled, so keep them disabled for now
+ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386))
+  X86_CPU_OPTIMIZATIONS:=--with-sse=yes --with-ssse3=yes --with-avx=yes
+else
+  X86_CPU_OPTIMIZATIONS:=--with-sse=no --with-ssse3=no --with-avx=no
+endif
+
 NJOBS := -j1
 ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
 NJOBS := -j$(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
@@ -110,6 +120,7 @@
 			--with-rename-internal-libgeotiff-symbols=yes \
 			--with-threads \
 			--with-armadillo=yes \
+			$(X86_CPU_OPTIMIZATIONS) \
 			--with-cfitsio=yes \
 			--with-charls \
 			--with-curl \

Reply via email to