fftw: minor update and major refactoring

- Unify the "single" and "float" variants, which are the same thing.
- Enable threads and openmp wrapper by default (they are very small).
- Don't use sse on i686, as I'm quite sure we have no warrant for that.
Cf. http://en.wikipedia.org/wiki/Pentium_Pro
- Disable static libs (big, no indication we need them).
- I tested most builds using fftw (they build OK).

+33 -43
+1 -2
pkgs/applications/graphics/gimp/plugins/default.nix
··· 146 146 gmic = 147 147 let 148 148 imagemagick = pkgs.imagemagickBig; # maybe the non big version is enough? 149 - fftw = pkgs.fftw.override {pthreads = true;}; 150 149 in pluginDerivation rec { 151 150 name = "gmic-1.5.7.2"; 152 - buildInputs = [imagemagick pkgconfig fftw gimp] ++ gimp.nativeBuildInputs; 151 + buildInputs = [imagemagick pkgconfig pkgs.fftw gimp] ++ gimp.nativeBuildInputs; 153 152 src = fetchurl { 154 153 url = mirror://sourceforge/gmic/gmic_1.5.7.2.tar.gz; 155 154 sha256 = "1cpbxb3p2c8bcv2cbr150whapzjc7w09i3jza0z9x3xj8c0vdyv1";
+27 -24
pkgs/development/libraries/fftw/default.nix
··· 1 - {fetchurl, stdenv, builderDefs, stringsWithDeps, singlePrecision ? false, pthreads ? false, float ? false}: 1 + { fetchurl, stdenv, builderDefs, precision ? "double" }: 2 + 3 + assert stdenv.lib.elem precision [ "single" "double" "long-double" "quad-precision" ]; 4 + 5 + with { inherit (stdenv.lib) optional; }; 6 + 2 7 let 3 - version = "3.3.2"; 4 - localDefs = builderDefs.passthru.function { 5 - src = 6 - fetchurl { 7 - url = "ftp://ftp.fftw.org/pub/fftw/fftw-${version}.tar.gz"; 8 - sha256 = "b1236a780ca6e66fc5f8eda6ef0665d680e8253d9f01d7bf211b714a50032d01"; 9 - }; 10 - buildInputs = []; 11 - configureFlags = ["--enable-shared"] 12 - # some distros seem to be shipping both versions within the same package? 13 - # why does --enable-float still result in ..3f.so instead of ..3.so? 14 - ++ (if singlePrecision then [ "--enable-single" ] else [ ]) 15 - ++ (if float then [ "--enable-float" ] else [ ]) 16 - ++ (stdenv.lib.optional (!pthreads) "--enable-openmp") 17 - ++ (stdenv.lib.optional pthreads "--enable-threads") 18 - # I think all i686 has sse 19 - ++ (if (stdenv.isi686 || stdenv.isx86_64) && singlePrecision then [ "--enable-sse" ] else [ ]) 20 - # I think all x86_64 has sse2 21 - ++ (if stdenv.isx86_64 && ! singlePrecision then [ "--enable-sse2" ] else [ ]); 22 - 8 + version = "3.3.3"; 9 + localDefs = builderDefs.passthru.function { 10 + src = 11 + fetchurl { 12 + url = "ftp://ftp.fftw.org/pub/fftw/fftw-${version}.tar.gz"; 13 + sha256 = "1wwp9b2va7vkq3ay7a9jk22nr4x5q6m37rzqy2j8y3d11c5grkc5"; 14 + }; 15 + buildInputs = []; 16 + configureFlags = [ 17 + "--enable-shared" "--disable-static" 18 + "--enable-threads" "--enable-openmp" # very small wrappers 19 + ] 20 + ++ optional (precision != "double") "--enable-${precision}" 21 + # all x86_64 have sse2 22 + ++ optional stdenv.isx86_64 "--enable-sse2"; 23 23 }; 24 + 24 25 in with localDefs; 25 - stdenv.mkDerivation { 26 - name = "fftw-3.3.2" + ( if singlePrecision then "-single" else "-double" ); 27 - builder = writeScript "fftw-3.3.2-builder" 26 + 27 + stdenv.mkDerivation rec { 28 + name = "fftw-${precision}-${version}"; 29 + builder = writeScript "${name}-builder" 28 30 (textClosure localDefs [doConfigure doMakeInstall doForceShare]); 29 31 meta = { 30 32 description = "Fastest Fourier Transform in the West library"; ··· 34 36 inherit src; 35 37 }; 36 38 } 39 +
+5 -17
pkgs/top-level/all-packages.nix
··· 2867 2867 julia = callPackage ../development/compilers/julia { 2868 2868 liblapack = liblapack.override {shared = true;}; 2869 2869 mpfr = mpfr_3_1_2; 2870 - fftw = fftw.override {pthreads = true;}; 2871 - fftwSinglePrec = fftwSinglePrec.override {pthreads = true;}; 2872 2870 }; 2873 2871 2874 2872 lazarus = builderDefsPackage (import ../development/compilers/fpc/lazarus.nix) { ··· 4169 4167 4170 4168 ffms = callPackage ../development/libraries/ffms { }; 4171 4169 4172 - fftw = callPackage ../development/libraries/fftw { 4173 - singlePrecision = false; 4174 - }; 4175 - 4176 - fftwFloat = callPackage ../development/libraries/fftw { 4177 - float = true; 4178 - }; 4179 - 4180 - fftwSinglePrec = callPackage ../development/libraries/fftw { 4181 - singlePrecision = true; 4182 - }; 4170 + fftw = callPackage ../development/libraries/fftw { }; 4171 + fftwSinglePrec = fftw.override { precision = "single"; }; 4172 + fftwFloat = fftwSinglePrec; # the configure option is just an alias 4183 4173 4184 4174 flann = callPackage ../development/libraries/flann { }; 4185 4175 ··· 8748 8738 ratpoison = callPackage ../applications/window-managers/ratpoison { }; 8749 8739 8750 8740 rawtherapee = callPackage ../applications/graphics/rawtherapee { 8751 - fftw = fftw.override {float = true;}; 8741 + fftw = fftwSinglePrec; 8752 8742 }; 8753 8743 8754 8744 rcs = callPackage ../applications/version-management/rcs { }; ··· 8840 8830 libpng = libpng12; 8841 8831 }; 8842 8832 8843 - smartdeblur = callPackage ../applications/graphics/smartdeblur { 8844 - fftw = fftw.override {pthreads = true;}; 8845 - }; 8833 + smartdeblur = callPackage ../applications/graphics/smartdeblur { }; 8846 8834 8847 8835 sndBase = lowPrio (builderDefsPackage (import ../applications/audio/snd) { 8848 8836 inherit fetchurl stdenv stringsWithDeps lib fftw;