<commit_before>require 'formula'

class Scalapack < Formula
  homepage 'http://www.netlib.org/scalapack/'
  url 'http://www.netlib.org/scalapack/scalapack-2.0.2.tgz'
  sha1 'ff9532120c2cffa79aef5e4c2f38777c6a1f3e6a'
  head 'https://icl.cs.utk.edu/svn/scalapack-dev/scalapack/trunk', :using => :svn

  option 'without-check', 'Skip build-time tests (not recommended)'

  depends_on :mpi => [:cc, :f90]
  depends_on 'cmake' => :build
  depends_on 'openblas' => :optional
  depends_on 'dotwrp' if build.without? 'openblas'
  depends_on :fortran

  def install
    if build.with? 'openblas'
      args = std_cmake_args + [
        '-DBLAS_LIBRARIES=-lopenblas',
        '-DLAPACK_LIBRARIES=-lopenblas',
      ]
    else
      args = std_cmake_args + [
        '-DBLAS_LIBRARIES=-ldotwrp -Wl,-framework -Wl,Accelerate',
        '-DLAPACK_LIBRARIES=-ldotwrp -Wl,-framework -Wl,Accelerate',
      ]
    end

    mkdir "build" do<commit_msg>Scalapack: option to build shared libs.<commit_after>require 'formula'

class Scalapack < Formula
  homepage 'http://www.netlib.org/scalapack/'
  url 'http://www.netlib.org/scalapack/scalapack-2.0.2.tgz'
  sha1 'ff9532120c2cffa79aef5e4c2f38777c6a1f3e6a'
  head 'https://icl.cs.utk.edu/svn/scalapack-dev/scalapack/trunk', :using => :svn

  option 'with-shared-libs', 'Build shared libs (some tests may fail)'
  option 'without-check', 'Skip build-time tests (not recommended)'

  depends_on :mpi => [:cc, :f90]
  depends_on 'cmake' => :build
  depends_on 'openblas' => :optional
  depends_on 'dotwrp' if build.without? 'openblas'
  depends_on :fortran

  def install
    args = std_cmake_args
    args << "-DBUILD_SHARED_LIBS=ON" if build.with? "shared-libs"
    blaslib = (build.with? "openblas") ? "-L#{Formula['openblas'].lib} -lopenblas" : "-ldotwrp -Wl,-framework -Wl,Accelerate"
    args += ["-DBLAS_LIBRARIES=#{blaslib}", "-DLAPACK_LIBRARIES=#{blaslib}"]

    mkdir "build" do
{'fraction_non_alphanumeric': 0.14882506527415143, 'fraction_numerical': 0.029242819843342035, 'mean_word_length': 3.8261964735516374, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '4387208', 'n_tokens_mistral': 808, 'n_tokens_neox': 778, 'n_words': 136}