<commit_before>{ stdenv, fetchurl, gfortran, perl, liblapack, config, coreutils }:

with stdenv.lib;

let local = config.openblas.preferLocalBuild or false;
    binary =
      {
        i686-linux = "32";
        x86_64-linux = "64";
        x86_64-darwin = "64";
      }."${stdenv.system}" or (throw "unsupported system: ${stdenv.system}");
    genericFlags =
      [
        "DYNAMIC_ARCH=1"
        "NUM_THREADS=64"
        "BINARY=${binary}"
      ];
    localFlags = config.openblas.flags or
      optionals (hasAttr "target" config.openblas) [ "TARGET=${config.openblas.target}" ];
in
stdenv.mkDerivation rec {
  version = "0.2.14";

  name = "openblas-${version}";
  src = fetchurl {
    url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
    sha256 = "0av3pd96j8rx5i65f652xv9wqfkaqn0w4ma1gvbyz73i6j2hi9db";
    name = "openblas-${version}.tar.gz";
  };

  preBuild = "cp ${liblapack.src} lapack-${liblapack.meta.version}.tgz";

  nativeBuildInputs = optionals stdenv.isDarwin [coreutils] ++ [gfortran perl];

  makeFlags =
    (if local then localFlags else genericFlags)
    ++
    optionals stdenv.isDarwin ["MACOSX_DEPLOYMENT_TARGET=10.9"]
    ++
    [
      "FC=gfortran"
      # Note that clang is available through the stdenv on OSX and
      # thus is not an explicit dependency.
      "CC=${if stdenv.isDarwin then "clang" else "gcc"}"
      ''PREFIX="''$(out)"''
      "INTERFACE64=1"
    ];<commit_msg>openblas: set NUM_THREADS and USE_OPENMP<commit_after>{ stdenv, fetchurl, gfortran, perl, liblapack, config, coreutils }:

with stdenv.lib;

let local = config.openblas.preferLocalBuild or false;
    binary =
      {
        i686-linux = "32";
        x86_64-linux = "64";
        x86_64-darwin = "64";
      }."${stdenv.system}" or (throw "unsupported system: ${stdenv.system}");
    genericFlags =
      [
        "DYNAMIC_ARCH=1"
        "NUM_THREADS=64"
        "BINARY=${binary}"
        "USE_OPENMP=1"
        "NUM_THREADS=64"
      ];
    localFlags = config.openblas.flags or
      optionals (hasAttr "target" config.openblas) [ "TARGET=${config.openblas.target}" ];
in
stdenv.mkDerivation rec {
  version = "0.2.14";

  name = "openblas-${version}";
  src = fetchurl {
    url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
    sha256 = "0av3pd96j8rx5i65f652xv9wqfkaqn0w4ma1gvbyz73i6j2hi9db";
    name = "openblas-${version}.tar.gz";
  };

  preBuild = "cp ${liblapack.src} lapack-${liblapack.meta.version}.tgz";

  nativeBuildInputs = optionals stdenv.isDarwin [coreutils] ++ [gfortran perl];

  makeFlags =
    (if local then localFlags else genericFlags)
    ++
    optionals stdenv.isDarwin ["MACOSX_DEPLOYMENT_TARGET=10.9"]
    ++
    [
      "FC=gfortran"
      # Note that clang is available through the stdenv on OSX and
      # thus is not an explicit dependency.
      "CC=${if stdenv.isDarwin then "clang" else "gcc"}"
      ''PREFIX="''$(out)"''
      "INTERFACE64=1"
    ];
{'fraction_non_alphanumeric': 0.14518871132267935, 'fraction_numerical': 0.03706222373342401, 'mean_word_length': 3.046767537826685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6034679', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1103, 'n_words': 208}