Hi Sylvestre

Had issues with the cpufreqtest

* sh didn't like the for loop syntax - too bashtastic I am guessing.
     In the attached patch I have changed it to a while loop which works

* the test for cupfrequitils failed because the command output got in the way
         test $$(cpufreq-info -p; echo $$?) ...
  changed it to:
         test $$(cpufreq-info -p > /dev/null; echo $$?) ...

I had a think about how you could skip the test if necessary. I added a couple of new rules
so that it works a such:

custom: custom-cpufreq custom-stamp
     test then build

custom-nocpufreqtest: custom-stamp
     bypass test and build

custom-cpufreqtest:
     moved the test here

custom-stamp:
     run build


Do you need me to put this through as a bug report?

Adrian



On 03/03/10 20:39, Debian Bug Tracking System wrote:
This is an automatic notification regarding your Bug report
which was filed against the atlas package:

#571322: [atlas] custom build improvements

It has been closed by Sylvestre Ledru<sylves...@debian.org>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Sylvestre 
Ledru<sylves...@debian.org>  by
replying to this email.




--- atlas-3.8.3/debian/rules	2010-03-04 14:44:42.000000000 +1300
+++ atlas-3.8.3_edit/debian/rules	2010-03-04 15:01:41.787916163 +1300
@@ -85,22 +85,46 @@
 	-v 2											\
 	-Si cputhrchk 0
 
-custom: custom-stamp
+#build custom with cpu frequency test to ensure 
+custom: custom-cpufreqtest custom-stamp
 
-# Build a custom package optimized for the current arch
-custom-stamp:
-		rm -f configure-stamp
+#build custom without cpu frequency test
+custom-nocpufreqtest: custom-stamp
 
+# run cpufreq-utils test
+custom-cpufreqtest:
+		# Ensure that cpu frequency scaling is switched off and cpu(s) are running 
+		# at max clock speed (i.e. governor=performance)
+		# This is required for ATLAS auto-tuning to work correctly
+		# and produce the most highly optimised libraries - the entire point 
+		# of building a custom package.
+		#
+		# If cpufreq-utils causes problems or is unavailable for a given
+		# architecture/hardware then run 'custom-nocpufreqtest' to skip this test
+		
 		ncpu=$$(LANG=C cpufreq-info | grep "analyzing CPU" -c); \
-		for (( cpu=0 ; cpu < $$ncpu ; cpu++)); do \
-		if test $$(cpufreq-info -p; echo $$?) -eq 0 -a -z "$$(LANG=C cpufreq-info -p -c $$cpu | grep performance)" ; then \
+		cpu=0; \
+		while test "$$cpu" -lt "$$ncpu"; do \
+		if test $$(cpufreq-info -p > /dev/null; echo $$?) -eq 0 -a -z "$$(LANG=C cpufreq-info -p -c $$cpu | grep performance)" ; then \
+			echo "###########################################################"; \
 			echo "frequency governor on cpu=$$cpu is not set to 'performance'"; \
+			echo "ATLAS auto-tuning requires the cpu clock speed(s) to be set at maximum"; \
+			echo " "; \
 			echo "run: 'sudo cpufreq-set -g governor -c cpu#' for each cpu"; \
+			echo " "; \
+			echo "If you wish to skip the cpu frequency test, then use the"; \
+			echo "make rule 'custom-nocpufreq' instead of 'custom'"; \
+			echo " "; \
 			echo "aborting atlas build"; \
 			exit 1; \
 		fi; \
+		cpu=$$(expr $$cpu + 1); \
 		done
 
+# Build a custom package optimized for the current arch
+custom-stamp:
+		rm -f configure-stamp
+		
 		# Here, the trick is pretty simple:
 		# * We don't want to build all the optimized version of Atlas. Just the
 		#   one for the current CPU
@@ -111,7 +135,7 @@
 		#   therefor, leaving the choice of the optimization to Atlas
 		# * After that, we fall back to the normal build procedure by calling
 		#   debian/rules itself (yep, recursively)
-
+		
 		# Remove all the other archs in this case
 		sed '/AFTER THAT/q' $(CURDIR)/debian/control.in > $(CURDIR)/debian/control
 		dch --local='+custom'  "custom build on: `uname -a`"
@@ -247,7 +271,7 @@
 		dh_installdeb -a
 		dh_shlibdeps -a -l $$(pwd)
 
-.PHONY: build build-indep build-indep-stamp build-arch build-arch-stamp check clean binary binary-indep binary-arch configure-stamp configure custom custom-stamp
+.PHONY: build build-indep build-indep-stamp build-arch build-arch-stamp check clean binary binary-indep binary-arch configure-stamp configure custom custom-stamp custom-nocpufreqtest custom-cpufreqtest
 
 
 get-orig-source:

Reply via email to