anchor.diff:  { stdenv, fetchurl, gfortran, perl, which, config, coreutils
  -# Most packages depending on openblas expect integer width to match pointer width,
  -# but some expect to use 32-bit integers always (for compatibility with reference BLAS).
  +# Most packages depending on openblas expect integer width to match
  +# pointer width, but some expect to use 32-bit integers always
  +# (for compatibility with reference BLAS).
   , blas64 ? null
   }:
   
  
positive.code: 
  let blas64_ = blas64; in
  
  let local = config.openblas.preferLocalBuild or false;
      binary =
        { i686-linux = "32";
          armv7l-linux = "32";
          x86_64-linux = "64";
          x86_64-darwin = "64";
        }."${stdenv.system}" or (throw "unsupported system: ${stdenv.system}");
      genericFlags =
        [ "DYNAMIC_ARCH=${if stdenv.system == "armv7l-linux" then "0" else "1"}"
          "NUM_THREADS=64"
        ];
      localFlags = config.openblas.flags or
        optionals (hasAttr "target" config.openblas) [ "TARGET=${config.openblas.target}" ];
      blas64 = if blas64_ != null then blas64_ else hasPrefix "x86_64" stdenv.system;
  
      version = "0.2.19";
  in
  stdenv.mkDerivation {
    name = "openblas-${version}";
  
negative.code:     "stackprotector" "pic"
      # don't alter index arithmetic
      "strictoverflow"
      # don't interfere with dynamic target detection
      "relro" "bindnow"
    ];
  
    nativeBuildInputs =
      [gfortran perl which]
      ++ optionals stdenv.isDarwin [coreutils];
  
    makeFlags =
      [
        "FC=gfortran"
        ''PREFIX="''$(out)"''
        "NUM_THREADS=64"
        "INTERFACE64=${if blas64 then "1" else "0"}"
      ]
      ++ mapAttrsToList (var: val: var + "=" + val) config;
  
    doCheck = true;
    checkTarget = "tests";
  