<commit_before># Omnibus::Software definition to build the GNU Compiler Collection.
# Copyright 2017 Codethink Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name "gcc"
default_version "sam/fortran-legacy-support-7_0-20170222"

source git: "https://github.com/CodethinkLabs/gcc/"

dependency "gmp"
dependency "mpfr"
dependency "mpc"
dependency "libiconv"

build do
  # Setup a default environment from Omnibus - you should use this Omnibus
  # helper everywhere. It will become the default in the future.
  env = with_standard_compiler_flags(with_embedded_path)

  configure_command = [
    "./configure",
    "--prefix=#{install_dir}/embedded",
    "--disable-nls",
    "--enable-languages=c,c++,fortran",
    "--disable-multilib"]

  if solaris?
    # Only the GNU version of M4 can be used
    env["M4"] = "gm4"
    # The Solaris packages for GMP and MPFR put the headers in non-standard
    # places.
    configure_command += [
      "--with-gmp-include=/usr/include/gmp",
      "--with-mpfr-include=/usr/include/mpfr"]

    # The with_standard_compiler_flags function sets:
    #     CC=gcc -m64 -static-libgcc
    # It sets nothing for C++, so the build fails when trying to link some 32-bit C++
    # code against 64-bit C libraries.
    # This could possibly be upstreamed in Omnibus itself.
    # May also need doing for Fortran.
    env["CXX"] = "g++ -m64"
  end

  command configure_command.join(" "), env: env
  make "-j #{workers}", env: env, timeout: 14400
  make "-j #{workers} install", env: env
end
<commit_msg>Update to latest GCC master + Fortran extras<commit_after># Omnibus::Software definition to build the GNU Compiler Collection.
# Copyright 2017 Codethink Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name "gcc"
default_version "sam/fortran-legacy-support-7_0-20170322"

source git: "https://github.com/CodethinkLabs/gcc/"

dependency "gmp"
dependency "mpfr"
dependency "mpc"
dependency "libiconv"

build do
  # Setup a default environment from Omnibus - you should use this Omnibus
  # helper everywhere. It will become the default in the future.
  env = with_standard_compiler_flags(with_embedded_path)

  configure_command = [
    "./configure",
    "--prefix=#{install_dir}/embedded",
    "--disable-nls",
    "--enable-languages=c,c++,fortran",
    "--disable-multilib"]

  if solaris?
    # Only the GNU version of M4 can be used
    env["M4"] = "gm4"
    # The Solaris packages for GMP and MPFR put the headers in non-standard
    # places.
    configure_command += [
      "--with-gmp-include=/usr/include/gmp",
      "--with-mpfr-include=/usr/include/mpfr"]

    # The with_standard_compiler_flags function sets:
    #     CC=gcc -m64 -static-libgcc
    # It sets nothing for C++, so the build fails when trying to link some 32-bit C++
    # code against 64-bit C libraries.
    # This could possibly be upstreamed in Omnibus itself.
    # May also need doing for Fortran.
    env["CXX"] = "g++ -m64"
  end

  command configure_command.join(" "), env: env
  make "-j #{workers}", env: env, timeout: 14400
  make "-j #{workers} install", env: env
end

{'fraction_non_alphanumeric': 0.10509631797122652, 'fraction_numerical': 0.016581321628871007, 'mean_word_length': 3.5376106194690267, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1320360', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1212, 'n_words': 466}