<commit_before>class Libxc < Formula
  desc "Library of exchange and correlation functionals for codes"
  homepage "http://www.tddft.org/programs/libxc/"
  url "http://www.tddft.org/programs/octopus/down.php?file=libxc/3.0.1/libxc-3.0.1.tar.gz"
  sha256 "836692f2ab60ec3aca0cca105ed5d0baa7d182be07cc9d0daa7b80ee1362caf7"
  revision 2

  bottle do
    cellar :any
    sha256 "e3d95c1f73ad4dd2bbac39c0756e9da5cd77e6dd0761b04c8459147b2e367754" => :mojave
    sha256 "9ea81e66b245bde49b75db6707a2e6114eb83e393dbc25bcc07e81e2cf0d1c8d" => :high_sierra
    sha256 "8ac766961dcbb498caa01ca4a91a20dfadef0cba846ed82e02cc3da2f2bd41bc" => :sierra
    sha256 "7a0fc81d08b6e574d12a3b0b4a1bd033cb63a698e8b2ad508de1b84db94ed005" => :el_capitan
  end

  depends_on "gcc" # for gfortran

  def install
    system "./configure", "--prefix=#{prefix}",
                          "--enable-shared",
                          "FCCPP=gfortran -E -x c",
                          "CC=#{ENV.cc}"
    system "make", "install"
  end

  test do
    (testpath/"test.c").write <<~EOS
      #include <stdio.h>
      #include <xc.h><commit_msg>libxc 4.2.3<commit_after>class Libxc < Formula
  desc "Library of exchange and correlation functionals for codes"
  homepage "http://www.tddft.org/programs/libxc/"
  url "http://www.tddft.org/programs/octopus/download/libxc/4.2.3/libxc-4.2.3.tar.gz"
  sha256 "02e49e9ba7d21d18df17e9e57eae861e6ce05e65e966e1e832475aa09e344256"

  bottle do
    cellar :any
    sha256 "e3d95c1f73ad4dd2bbac39c0756e9da5cd77e6dd0761b04c8459147b2e367754" => :mojave
    sha256 "9ea81e66b245bde49b75db6707a2e6114eb83e393dbc25bcc07e81e2cf0d1c8d" => :high_sierra
    sha256 "8ac766961dcbb498caa01ca4a91a20dfadef0cba846ed82e02cc3da2f2bd41bc" => :sierra
    sha256 "7a0fc81d08b6e574d12a3b0b4a1bd033cb63a698e8b2ad508de1b84db94ed005" => :el_capitan
  end

  depends_on "gcc" # for gfortran

  def install
    system "./configure", "--prefix=#{prefix}",
                          "--enable-shared",
                          "FCCPP=gfortran -E -x c",
                          "CC=#{ENV.cc}"
    system "make", "install"
  end

  test do
    (testpath/"test.c").write <<~EOS
      #include <stdio.h>
      #include <xc.h>
{'fraction_non_alphanumeric': 0.10899182561307902, 'fraction_numerical': 0.18301544050862853, 'mean_word_length': 3.302734375, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 1}}
{'dir': 'git-commits-cleaned', 'id': '6462652', 'n_tokens_mistral': 1140, 'n_tokens_neox': 955, 'n_words': 126}