[Pkg-octave-commit] [octave-interval] 01/02: Fix build errors on archs w/o SSE2

Oliver Heimlich oheim-guest at moszumanska.debian.org
Tue Jan 17 09:22:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

oheim-guest pushed a commit to branch master
in repository octave-interval.

commit 52261d6e202f7be525f2e3f112a9a77641350983
Author: Oliver Heimlich <oheim at posteo.de>
Date:   Tue Jan 17 10:11:35 2017 +0100

    Fix build errors on archs w/o SSE2
    
    * d/p/detect-sse2.patch: Allow external customization of SSE2 compilation
    * d/rules: Use SSE2 only on supported archs
---
 debian/patches/detect-sse2.patch | 24 ++++++++++++++++++++++++
 debian/patches/series            |  1 +
 debian/rules                     |  8 ++++++++
 3 files changed, 33 insertions(+)

diff --git a/debian/patches/detect-sse2.patch b/debian/patches/detect-sse2.patch
new file mode 100644
index 0000000..9f8d49d
--- /dev/null
+++ b/debian/patches/detect-sse2.patch
@@ -0,0 +1,24 @@
+diff --git a/src/Makefile b/src/Makefile
+index 4f36196..17a9dfa 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -17,6 +17,10 @@ OBJ            = crlibm_function.oct \
+ LDFLAGS_MPFR   =-lmpfr
+ ## Use important flags in XTRA_CFLAGS for OpenMP (workaround for bug #45280)
+ CFLAG_OPENMP   =$(findstring -fopenmp,$(shell $(MKOCTFILE) -p XTRA_CFLAGS))
++HAS_SSE2       =$(findstring sse2,$(shell cat /proc/cpuinfo))
++ifdef HAS_SSE2
++CONF_FLAG_SSE2 ?=--enable-sse2
++endif
+ 
+ all: $(OBJ)
+ 
+@@ -37,7 +41,7 @@ crlibm_function.o: crlibm_function.cc
+ crlibm/crlibm_private.o: crlibm/crlibm_config.h
+ 	$(MAKE) -C crlibm CFLAGS+="$(shell $(MKOCTFILE) -p CPICFLAG) -Wno-div-by-zero -Wno-unused-variable -Wno-unused-but-set-variable"
+ crlibm/crlibm_config.h:
+-	(cd crlibm && ./configure --disable-dependency-tracking --enable-sse2)
++	(cd crlibm && ./configure --disable-dependency-tracking $(CONF_FLAG_SSE2))
+ 
+ ## GNU MPFR api oct-files
+ mpfr_matrix_mul_d.oct mpfr_matrix_sqr_d.oct : mpfr_%.oct: mpfr_%.cc mpfr_commons.cc
diff --git a/debian/patches/series b/debian/patches/series
index 578de0b..b6fc6a9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 fix-external-css.patch
+detect-sse2.patch
diff --git a/debian/rules b/debian/rules
index 8926595..6ef197b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,6 +22,14 @@ include /usr/share/cdbs/1/class/octave-pkg.mk
 pkg = $(shell awk '/^Name:/ {print $$2; exit 0}' DESCRIPTION)
 pkg_version = $(shell awk '/^Version:/ {print $$2; exit 0}' DESCRIPTION)
 
+# For reproducibility and portability,
+# enable SSE2 only on architectures where it is supported by all processors.
+ifeq ($(DEB_HOST_ARCH_CPU),amd64)
+export CONF_FLAG_SSE2 = --enable-sse2
+else
+export CONF_FLAG_SSE2 = --disable-sse2
+endif
+
 # Don't install NEWS.gz, octave-pkg-dev will handle this
 DEB_INSTALL_DOCS_ALL =
 doc_dir = $(CURDIR)/$(debpkg)-doc/usr/share/doc/$(package)

-- 
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/octave-interval.git



More information about the Pkg-octave-commit mailing list