atlas: update to version 3.10.1

This patch fixes issue #297.

+35 -9
+13 -9
pkgs/development/libraries/science/math/atlas/default.nix
··· 1 1 { stdenv, fetchurl, gfortran, tolerateCpuTimingInaccuracy ? true, shared ? false }: 2 2 3 3 let 4 + version = "3.10.1"; 5 + 4 6 optionalString = stdenv.lib.optionalString; 7 + optional = stdenv.lib.optional; 5 8 in 6 9 7 10 stdenv.mkDerivation { 8 - name = "atlas-3.9.67"; 11 + name = "atlas-${version}"; 9 12 10 13 src = fetchurl { 11 - url = mirror://sourceforge/math-atlas/atlas3.9.67.tar.bz2; 12 - sha256 = "06xxlv440z8a3qmfrh17p28girv71c6awvpw5vhpspr0pcsgk1pa"; 14 + url = "mirror://sourceforge/math-atlas/atlas${version}.tar.bz2"; 15 + sha256 = "11ncgdc7kzb2y2gqb3sgarm5saj9fr07r3h2yh2h5bja429b85d2"; 13 16 }; 14 17 18 + # Atlas aborts the build if it detects that some kind of CPU frequency 19 + # scaling is active on the build machine because that feature offsets the 20 + # performance timings. We ignore that check, however, because with binaries 21 + # being pre-built on Hydra those timings aren't accurate for the local 22 + # machine in the first place. 23 + patches = optional tolerateCpuTimingInaccuracy ./disable-timing-accuracy-check.patch; 24 + 15 25 # Configure outside of the source directory. 16 26 preConfigure = '' mkdir build; cd build; configureScript=../configure; ''; 17 27 18 28 # * -fPIC allows to build atlas inside shared objects, as octave does. 19 29 # 20 - # * Atlas aborts the build if it detects that some kind of CPU frequency 21 - # scaling is active on the build machine because that feature offsets the 22 - # performance timings. We ignore that check, however, because with binaries 23 - # being pre-built on Hydra those timings aren't accurate for the local 24 - # machine in the first place. 25 30 # * Atlas detects the cpu and does some tricks. For example, notices the 26 31 # hydra AMD Family 10h computer, and uses a SSE trick for it (bit 17 of MXCSR) 27 32 # available, for what I know, only in that family. So we hardcode K7 ··· 33 38 configureFlags = "-Fa alg -fPIC -t 0" 34 39 + optionalString stdenv.isi686 " -b 32 -A 18 -V 1" 35 40 + optionalString stdenv.isx86_64 " -A 31 -V 192" 36 - + optionalString tolerateCpuTimingInaccuracy " -Si cputhrchk 0" 37 41 + optionalString shared " --shared " 38 42 ; 39 43
+22
pkgs/development/libraries/science/math/atlas/disable-timing-accuracy-check.patch
··· 1 + diff -ubr ATLAS-orig/CONFIG/src/config.c ATLAS/CONFIG/src/config.c 2 + --- ATLAS-orig/CONFIG/src/config.c 2013-02-06 11:23:47.078036878 +0100 3 + +++ ATLAS/CONFIG/src/config.c 2013-02-06 11:24:16.481120888 +0100 4 + @@ -711,17 +711,7 @@ 5 + 6 + int ProbeCPUThrottle(int verb, char *targarg, enum OSTYPE OS, enum ASMDIA asmb) 7 + { 8 + - int i, iret; 9 + - char *ln; 10 + - i = strlen(targarg) + 22 + 12; 11 + - ln = malloc(i*sizeof(char)); 12 + - assert(ln); 13 + - sprintf(ln, "%s -O %d -s %d -t", targarg, OS, asmb); 14 + - iret = GetIntProbe(verb, ln, "arch", "CPU THROTTLE", 0); 15 + - free(ln); 16 + - if (iret) printf("CPU Throttling apparently enabled!\n"); 17 + - else printf("Cannot detect CPU throttling.\n"); 18 + - return(iret); 19 + + return 0; 20 + } 21 + 22 + char *NewAppendedString_SFLAG(char *old, char *flag, char *str)