<commit_before>require 'formula'

class Mpich2 < Formula
  homepage 'http://www.mpich.org/'
  url 'http://www.mpich.org/static/tarballs/1.5/mpich2-1.5.tar.gz'
  sha1 'be7448227dde5badf3d6ebc0c152b200998421e0'

  head 'https://svn.mcs.anl.gov/repos/mpi/mpich2/trunk'

  # the HEAD version requires the autotools to be installed
  # (autoconf>=2.67, automake>=1.12.3, libtool>=2.4)
  if build.head?
    depends_on 'automake' => :build
    depends_on 'libtool'  => :build
  end

  option 'disable-fortran', "Do not attempt to build Fortran bindings"

  def install
    if build.head?
      # ensure that the consistent set of autotools built by homebrew is used to
      # build MPICH2, otherwise very bizarre build errors can occur
      ENV['MPICH2_AUTOTOOLS_DIR'] = (HOMEBREW_PREFIX+'bin')
      system "./autogen.sh"
    end

    args = [
      "--disable-dependency-tracking",
      "--disable-silent-rules",
      "--prefix=#{prefix}",
      "--mandir=#{man}"
    ]
    if build.include? 'disable-fortran'
      args << "--disable-f77" << "--disable-fc"
    else
      ENV.fortran
    end
<commit_msg>mpich2: Add option to re-enable shared libs<commit_after>require 'formula'

class Mpich2 < Formula
  homepage 'http://www.mpich.org/'
  url 'http://www.mpich.org/static/tarballs/1.5/mpich2-1.5.tar.gz'
  sha1 'be7448227dde5badf3d6ebc0c152b200998421e0'

  head 'https://svn.mcs.anl.gov/repos/mpi/mpich2/trunk'

  # the HEAD version requires the autotools to be installed
  # (autoconf>=2.67, automake>=1.12.3, libtool>=2.4)
  if build.head?
    depends_on 'automake' => :build
    depends_on 'libtool'  => :build
  end

  option 'disable-fortran', "Do not attempt to build Fortran bindings"
  option 'enable-shared', "Build shared libraries"

  # fails with clang from Xcode 4.5.1 on 10.7 and 10.8 (see #15533)
  fails_with :clang do
    build 421
    cause <<-EOS.undent
      Clang generates code that causes the linker to segfault when building
      MPICH2 with shared libraries.  Specific message:

          collect2: ld terminated with signal 11 [Segmentation fault: 11]
      EOS
  end if build.include? 'enable-shared'

  def install
    if build.head?
      # ensure that the consistent set of autotools built by homebrew is used to
      # build MPICH2, otherwise very bizarre build errors can occur
      ENV['MPICH2_AUTOTOOLS_DIR'] = (HOMEBREW_PREFIX+'bin')
      system "./autogen.sh"
    end

    args = [
      "--disable-dependency-tracking",
      "--disable-silent-rules",
      "--prefix=#{prefix}",
      "--mandir=#{man}"
    ]
    if build.include? 'disable-fortran'
      args << "--disable-f77" << "--disable-fc"
    else
      ENV.fortran
    end

    # MPICH2 configure defaults to "--disable-shared"
    if build.include? 'enable-shared'
      args << "--enable-shared"
    end

{'fraction_non_alphanumeric': 0.12606837606837606, 'fraction_numerical': 0.04095441595441596, 'mean_word_length': 2.87448275862069, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, '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': '1600424', 'n_tokens_mistral': 1052, 'n_tokens_neox': 966, 'n_words': 248}