[openblas] 02/04: debian/rules: pass the same make options to all make invocations.
Sébastien Villemot
sebastien at debian.org
Fri Aug 8 12:47:50 UTC 2014
This is an automated email from the git hooks/post-receive script.
sebastien pushed a commit to branch master
in repository openblas.
commit 77c2b8550e0d456905ef39d05c2d4df600d0b00d
Author: Sébastien Villemot <sebastien at debian.org>
Date: Thu Aug 7 15:47:34 2014 +0200
debian/rules: pass the same make options to all make invocations.
Fixes FTBFS on armhf.
Git-Dch: Full
---
debian/rules | 65 +++++++++++++++++++++++++++++++-----------------------------
1 file changed, 34 insertions(+), 31 deletions(-)
diff --git a/debian/rules b/debian/rules
index 4ece377..f65e4bc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,56 +2,59 @@
include /usr/share/dpkg/buildflags.mk
-COMMON_MAKE_OPTIONS = NO_LAPACKE=1 NO_AFFINITY=1 NO_WARMUP=1 CFLAGS="$(CPPFLAGS) $(CFLAGS)" FFLAGS="$(FFLAGS)"
+MAKE_OPTIONS := NO_LAPACKE=1 NO_AFFINITY=1 NO_WARMUP=1 CFLAGS="$(CPPFLAGS) $(CFLAGS)" FFLAGS="$(FFLAGS)"
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ MAKE_OPTIONS += DEBUG=1
+endif
+
+# Build generic package with hardcoded max number of threads of 64
+GENERIC_OPTIONS := NUM_THREADS=64
+
+# On x86 archs, enable dynamic arch selection and select GENERIC target
ENABLE_DYNAMIC_ARCHS := amd64 i386 kfreebsd-amd64 kfreebsd-i386
ifneq (,$(findstring $(DEB_HOST_ARCH),$(ENABLE_DYNAMIC_ARCHS)))
- DYNAMIC_ARCH_ARG="DYNAMIC_ARCH=1"
- TARGET_GENERIC_ARG="TARGET=GENERIC"
+ GENERIC_OPTIONS += DYNAMIC_ARCH=1 TARGET=GENERIC
endif
+# We cannot use the ARMv7 profile on armhf, because it requires a 32-register FP unit.
+# See kernel/arm/KERNEL.ARMv7: it loads some *_vfpv3.S files, which use 32 registers.
+# Also, it FTBFS if GCC flag -mvfpv3 is removed (see arm-gcc-flags.patch), because GCC
+# refuses asm files with 32 FP registers in that case.
+# Issue discussed in https://github.com/xianyi/OpenBLAS/issues/388
ifeq ($(DEB_HOST_ARCH),armhf)
- # We cannot use the ARMv7 profile on armhf, because it requires a 32-register FP unit.
- # See kernel/arm/KERNEL.ARMv7: it loads some *_vfpv3.S files, which use 32 registers.
- # Also, it FTBFS if GCC flag -mvfpv3 is removed (see arm-gcc-flags.patch), because GCC
- # refuses asm files with 32 FP registers in that case.
- # Issue discussed in https://github.com/xianyi/OpenBLAS/issues/388
- TARGET_GENERIC_ARG="TARGET=ARMV6"
+ GENERIC_OPTIONS += TARGET=ARMV6
endif
+# There is no dynamic arch selection on PowerPC. To avoid selecting a
+# target based on the buildd hardware, we enforce a generic-enough
+# target.
ifeq ($(DEB_HOST_ARCH),powerpc)
- # There is no dynamic arch selection on PowerPC. To avoid selecting a
- # target based on the buildd hardware, we enforce a generic-enough
- # target.
- TARGET_GENERIC_ARG="TARGET=PPCG4"
+ GENERIC_OPTIONS += TARGET=PPCG4
endif
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- DEBUG_ARG="DEBUG=1"
+
+ifeq ($(TARGET),)
+ # Generic package
+ MAKE_OPTIONS += $(GENERIC_OPTIONS)
+else ifeq ($(TARGET),custom)
+ # Custom package, leave the arch detection to OpenBLAS
+else
+ # Use the TARGET value provided by the user
+ MAKE_OPTIONS += TARGET=$(TARGET)
endif
+
%:
dh $@
override_dh_auto_build:
- if test "$(TARGET)" = ""; then \
- echo "Support multiple architectures"; \
- $(MAKE) $(COMMON_MAKE_OPTIONS) $(DYNAMIC_ARCH_ARG) $(TARGET_GENERIC_ARG) $(DEBUG_ARG) NUM_THREADS=64; \
- fi
-
- if test "$(TARGET)" = "custom"; then \
- echo "Leave the detection to GotoBLAS / OpenBLAS"; \
- $(MAKE) $(COMMON_MAKE_OPTIONS) $(DEBUG_ARG); \
- fi
-
- if test "$(TARGET)" != "" -a "$(TARGET)" != "custom"; then \
- echo "Use the value '$(TARGET)' provided by the user"; \
- $(MAKE) $(COMMON_MAKE_OPTIONS) TARGET=$(TARGET) $(DEBUG_ARG); \
- fi
+ $(MAKE) $(MAKE_OPTIONS)
- make -C interface shared-blas-lapack
+ $(MAKE) -C interface shared-blas-lapack $(MAKE_OPTIONS)
override_dh_auto_install:
- make install DESTDIR=debian/tmp/ PREFIX=/usr
+ $(MAKE) install $(MAKE_OPTIONS) DESTDIR=debian/tmp/ PREFIX=/usr
custom:
dch --local='+custom' "custom build on: `uname -a`"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/openblas.git
More information about the debian-science-commits
mailing list