[atlas] 02/08: Further simplification of the build system for the custom package.

Sébastien Villemot sebastien at debian.org
Sat Aug 5 15:02:36 UTC 2017


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

sebastien pushed a commit to branch master
in repository atlas.

commit a94ce86bad1dfb42b4a7e9cf2dfbf9c030a654c8
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Wed Aug 2 14:24:54 2017 +0200

    Further simplification of the build system for the custom package.
    
    Gbp-Dch: Ignore
---
 debian/control |  3 +-
 debian/rules   | 96 +++++++++++++++++++++++++---------------------------------
 2 files changed, 43 insertions(+), 56 deletions(-)

diff --git a/debian/control b/debian/control
index bd16f17..60be106 100644
--- a/debian/control
+++ b/debian/control
@@ -10,8 +10,7 @@ Build-Depends: debhelper (>= 10),
                liblapack-pic,
                libblas-test,
                texlive-latex-base,
-               ghostscript,
-               cpufrequtils
+               ghostscript
 Standards-Version: 3.9.8
 Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/atlas.git
 Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/atlas.git
diff --git a/debian/rules b/debian/rules
index f74cfa8..6ba0150 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,17 +1,41 @@
 #!/usr/bin/make -f
 
+# Some ATLAS code uses improper format strings, so disable this
+export DEB_BUILD_MAINT_OPTIONS=hardening=-format
+
 include /usr/share/dpkg/buildflags.mk
 include /usr/share/dpkg/architecture.mk
 
-ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
-UBUNTU := yes
+# Parallel make variable, used by ATLAS build system
+PMAKE := make
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+PMAKE += -j $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 endif
 
-# If we are not building the custom package, force the MACHTYPE and ASMDIA
+GFORTRAN_LIB_PATH := $(shell $(CC) -print-search-dirs | grep ^install: | awk '{print $$2}')
+
+# Flags common to both the generic and custom packages
+CONFIGURE_FLAGS := --prefix="$(CURDIR)/debian/tmp"			 	\
+	--incdir="$(CURDIR)/debian/tmp/usr/include/"				\
+	--libdir="$(CURDIR)/debian/tmp/usr/lib/atlas-base/"			\
+	-D c -DWALL 								\
+	-Ss f77lib "-L$(GFORTRAN_LIB_PATH) -lgfortran -lgcc_s -lpthread"	\
+	-Ss pmake '$(PMAKE)'							\
+	-Ss flapack /usr/lib/liblapack_pic.a 					\
+	-v 2
+
 ifeq (,$(filter custom,$(DEB_BUILD_OPTIONS)))
+# Building the generic package, so enforce more configuration settings to make
+# the package independent of the build host hardware.
+
+# In particular, force the MACHTYPE and ASMDIA.
+# The following strings and numbers come from xprint_enums (compilable
+# with "make -C build xprint_enums").
+# N.B.: They can change across releases!
 
-# NB: the following strings and numbers come from xprint_enums (compilable from the build
-# directory with "make xprint_enums); they can change across releases
+ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
+UBUNTU := yes
+endif
 
 # Select the machine type
 ifeq ($(DEB_HOST_ARCH),s390x)
@@ -31,7 +55,7 @@ else
 MACHTYPE := GENERIC
 endif
 
-# ASMDIA corresponds the asm dialect (aka instruction set, ISA):
+# ASMDIA corresponds to the asm dialect (a.k.a. ISA, instruction set architecture):
 # - 1 means no instruction set extension
 # - 768 means SSE1+SSE2 (always available on amd64)
 ifeq ($(DEB_HOST_ARCH_CPU),amd64)
@@ -40,30 +64,6 @@ else
 ASMDIA := 1
 endif
 
-endif
-
-# Parallel make variable, used by ATLAS build system
-PMAKE := make
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-PMAKE += -j $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-endif
-
-# Some ATLAS code uses improper format strings, so disable this
-export DEB_BUILD_MAINT_OPTIONS=hardening=-format
-
-GFORTRAN_LIB_PATH := $(shell $(CC) -print-search-dirs | grep ^install: | awk '{print $$2}')
-
-# Flags common to both the generic and custom packages
-COMMON_CONFIG_PARAMS := --prefix="$(CURDIR)/debian/tmp"			 	\
-	--incdir="$(CURDIR)/debian/tmp/usr/include/"				\
-	--libdir="$(CURDIR)/debian/tmp/usr/lib/atlas-base/"			\
-	-D c -DWALL 								\
-	-Ss f77lib "-L$(GFORTRAN_LIB_PATH) -lgfortran -lgcc_s -lpthread"	\
-	-Ss pmake '$(PMAKE)'							\
-	-Ss flapack /usr/lib/liblapack_pic.a 					\
-	-v 2
-
-# Flags used only for the generic package.
 # - the cripple-atlas-performance flag is needed for disabling the CPU
 #   throttling check, because on some buildds CPU throttling is enabled and we
 #   have no way of disabling it;
@@ -71,7 +71,7 @@ COMMON_CONFIG_PARAMS := --prefix="$(CURDIR)/debian/tmp"			 	\
 #   single-processor machines;
 # - enforce gcc as the compiler for all uses (except for compiling probes,
 #   in --cc), because otherwise architectural defaults do not work.
-GENERIC_CONFIG_PARAMS := 					\
+CONFIGURE_FLAGS +=	 					\
 	-b $(DEB_HOST_ARCH_BITS)				\
 	-A $(MACHTYPE) 						\
 	-V $(ASMDIA) 						\
@@ -85,35 +85,23 @@ GENERIC_CONFIG_PARAMS := 					\
 	-Ss ADdir ../../debian/archdefs/$(DEB_HOST_ARCH_CPU)	\
 	--cripple-atlas-performance
 
-CUSTOM_CONFIG_PARAMS := -Fa alg '-fPIC'
+else
+# Flags specific to the custom package
+
+CONFIGURE_FLAGS += -Fa alg '-fPIC'
+
+# Uncomment the following if the ATLAS build system still complains after you
+# have set all the CPU governors to "performance"
+#CONFIGURE_FLAGS += --cripple-atlas-performance
+endif
+
 
 %:
 	dh $@
 
 override_dh_auto_configure:
-ifneq (,$(filter custom,$(DEB_BUILD_OPTIONS)))
-	# If building custom package, verify that CPU frequency governors are ok
-	set -e; 										\
-	ncpu=$$(LANG=C cpufreq-info | grep "analyzing CPU" -c);					\
-	cpu=0;											\
-	while test $$cpu -lt $$ncpu; do								\
-	if test $$(cpufreq-info -p 2>&1 > /dev/null; echo $$?)					\
-		-eq 0 -a -z "$$(LANG=C cpufreq-info -p -c $$cpu | grep performance)"; then	\
-		echo "frequency governor on cpu=$$cpu is not set to 'performance'";		\
-		echo "run: 'sudo cpufreq-set -g performance -c cpu#' for each cpu";		\
-		echo "aborting atlas build";							\
-		exit 1;										\
-	fi;											\
-	cpu=$$((cpu+1));									\
-	done
-endif
 	mkdir -p build/
-ifeq (,$(filter custom,$(DEB_BUILD_OPTIONS)))
-	cd build && ../configure $(COMMON_CONFIG_PARAMS) $(GENERIC_CONFIG_PARAMS)
-else
-	cd build && ../configure $(COMMON_CONFIG_PARAMS) $(CUSTOM_CONFIG_PARAMS)
-
-endif
+	cd build && ../configure $(CONFIGURE_FLAGS)
 	@echo "=============================================="
 	@echo -n "Configured arch: "
 	@grep ARCH < build/Make.inc | head -1 | awk '{print $$3}'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/atlas.git



More information about the debian-science-commits mailing list