<commit_before># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

# Legal Notice
# ------------
# OPENFOAM is a trademark owned by OpenCFD Ltd
# (producer and distributor of the OpenFOAM software via www.openfoam.com).
# The trademark information must remain visible and unadulterated in this
# file and via the "spack info" and comply with the term set by
# http://openfoam.com/legal/trademark-policy.php
#
# This file is not part of OpenFOAM, nor does it constitute a component of an
# OpenFOAM distribution.
#
##############################################################################
#
# Notes
# - The openfoam-org package is a modified version of the openfoam package.
#   If changes are needed here, consider if they should also be applied there.
#
# - Building with boost/cgal is not included, since some of the logic is not
#   entirely clear and thus untested.
# - Resolution of flex, zlib needs more attention (within OpenFOAM)
#
# - mpi handling: WM_MPLIB=SYSTEMMPI and use spack to populate prefs.sh for it.
#   Provide wmake rules for special purpose 'USER' and 'USERMPI'
#   mpi implementations, in case these are required.
#
# Known issues
# - Combining +zoltan with +int64 has not been tested, but probably won't work.
# - Combining +mgridgen with +int64 or +float32 probably won't work.
#
##############################################################################
import glob
import re
import os

import llnl.util.tty as tty

from spack import *
from spack.pkg.builtin.openfoam import add_extra_files
from spack.pkg.builtin.openfoam import write_environ
from spack.pkg.builtin.openfoam import rewrite_environ_files
from spack.pkg.builtin.openfoam import mplib_content
from spack.pkg.builtin.openfoam import OpenfoamArch


class OpenfoamOrg(Package):
    """OpenFOAM is a GPL-opensource C++ CFD-toolbox.
    The openfoam.org release is managed by the OpenFOAM Foundation Ltd as
    a licensee of the OPENFOAM trademark.
    This offering is not approved or endorsed by OpenCFD Ltd,
    producer and distributor of the OpenFOAM software via www.openfoam.com,
    and owner of the OPENFOAM trademark.
    """

    homepage = "http://www.openfoam.org/"
    baseurl  = "https://github.com/OpenFOAM"
    url      = "https://github.com/OpenFOAM/OpenFOAM-4.x/archive/version-4.1.tar.gz"
    git      = "https://github.com/OpenFOAM/OpenFOAM-dev.git"

    version('develop', branch='master')
    version('7', sha256='12389cf092dc032372617785822a597aee434a50a62db2a520ab35ba5a7548b5',
            url=baseurl + '/OpenFOAM-7/archive/version-7.tar.gz')
    version('6', sha256='32a6af4120e691ca2df29c5b9bd7bc7a3e11208947f9bccf6087cfff5492f025',
            url=baseurl + '/OpenFOAM-6/archive/version-6.tar.gz')
    version('5.0', sha256='9057d6a8bb9fa18802881feba215215699065e0b3c5cdd0c0e84cb29c9916c89',
            url=baseurl + '/OpenFOAM-5.x/archive/version-5.0.tar.gz')
    version('4.1', sha256='2de18de64e7abdb1b649ad8e9d2d58b77a2b188fb5bcb6f7c2a038282081fd31',
            url=baseurl + '/OpenFOAM-4.x/archive/version-4.1.tar.gz')
    version('2.4.0', sha256='9529aa7441b64210c400c019dcb2e0410fcfd62a6f62d23b6c5994c4753c4465',
            url=baseurl + '/OpenFOAM-2.4.x/archive/version-2.4.0.tar.gz')

    variant('int64', default=False,
            description='Compile with 64-bit label')
    variant('float32', default=False,
            description='Compile with 32-bit scalar (single-precision)')
    variant('source', default=True,
            description='Install library/application sources and tutorials')
    variant('metis', default=False,
            description='With metis decomposition')

    depends_on('mpi')
    depends_on('zlib')
    depends_on('flex',  type='build')
    depends_on('cmake', type='build')

    # Require scotch with ptscotch - corresponds to standard OpenFOAM setup
    depends_on('scotch~metis+mpi~int64', when='~int64')
    depends_on('scotch~metis+mpi+int64', when='+int64')

    depends_on('metis@5:', when='+metis')
    depends_on('metis+int64', when='+metis+int64')

    # General patches - foamEtcFile as per openfoam.com (robuster)
    common = ['spack-Allwmake', 'README-spack']
    assets = ['bin/foamEtcFile']

    # Version-specific patches<commit_msg>openfoam: modified flex to be a build + link dependency (#15917)<commit_after># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

# Legal Notice
# ------------
# OPENFOAM is a trademark owned by OpenCFD Ltd
# (producer and distributor of the OpenFOAM software via www.openfoam.com).
# The trademark information must remain visible and unadulterated in this
# file and via the "spack info" and comply with the term set by
# http://openfoam.com/legal/trademark-policy.php
#
# This file is not part of OpenFOAM, nor does it constitute a component of an
# OpenFOAM distribution.
#
##############################################################################
#
# Notes
# - The openfoam-org package is a modified version of the openfoam package.
#   If changes are needed here, consider if they should also be applied there.
#
# - Building with boost/cgal is not included, since some of the logic is not
#   entirely clear and thus untested.
# - Resolution of flex, zlib needs more attention (within OpenFOAM)
#
# - mpi handling: WM_MPLIB=SYSTEMMPI and use spack to populate prefs.sh for it.
#   Provide wmake rules for special purpose 'USER' and 'USERMPI'
#   mpi implementations, in case these are required.
#
# Known issues
# - Combining +zoltan with +int64 has not been tested, but probably won't work.
# - Combining +mgridgen with +int64 or +float32 probably won't work.
#
##############################################################################
import glob
import re
import os

import llnl.util.tty as tty

from spack import *
from spack.pkg.builtin.openfoam import add_extra_files
from spack.pkg.builtin.openfoam import write_environ
from spack.pkg.builtin.openfoam import rewrite_environ_files
from spack.pkg.builtin.openfoam import mplib_content
from spack.pkg.builtin.openfoam import OpenfoamArch


class OpenfoamOrg(Package):
    """OpenFOAM is a GPL-opensource C++ CFD-toolbox.
    The openfoam.org release is managed by the OpenFOAM Foundation Ltd as
    a licensee of the OPENFOAM trademark.
    This offering is not approved or endorsed by OpenCFD Ltd,
    producer and distributor of the OpenFOAM software via www.openfoam.com,
    and owner of the OPENFOAM trademark.
    """

    homepage = "http://www.openfoam.org/"
    baseurl  = "https://github.com/OpenFOAM"
    url      = "https://github.com/OpenFOAM/OpenFOAM-4.x/archive/version-4.1.tar.gz"
    git      = "https://github.com/OpenFOAM/OpenFOAM-dev.git"

    version('develop', branch='master')
    version('7', sha256='12389cf092dc032372617785822a597aee434a50a62db2a520ab35ba5a7548b5',
            url=baseurl + '/OpenFOAM-7/archive/version-7.tar.gz')
    version('6', sha256='32a6af4120e691ca2df29c5b9bd7bc7a3e11208947f9bccf6087cfff5492f025',
            url=baseurl + '/OpenFOAM-6/archive/version-6.tar.gz')
    version('5.0', sha256='9057d6a8bb9fa18802881feba215215699065e0b3c5cdd0c0e84cb29c9916c89',
            url=baseurl + '/OpenFOAM-5.x/archive/version-5.0.tar.gz')
    version('4.1', sha256='2de18de64e7abdb1b649ad8e9d2d58b77a2b188fb5bcb6f7c2a038282081fd31',
            url=baseurl + '/OpenFOAM-4.x/archive/version-4.1.tar.gz')
    version('2.4.0', sha256='9529aa7441b64210c400c019dcb2e0410fcfd62a6f62d23b6c5994c4753c4465',
            url=baseurl + '/OpenFOAM-2.4.x/archive/version-2.4.0.tar.gz')

    variant('int64', default=False,
            description='Compile with 64-bit label')
    variant('float32', default=False,
            description='Compile with 32-bit scalar (single-precision)')
    variant('source', default=True,
            description='Install library/application sources and tutorials')
    variant('metis', default=False,
            description='With metis decomposition')

    depends_on('mpi')
    depends_on('zlib')
    depends_on('flex')
    depends_on('cmake', type='build')

    # Require scotch with ptscotch - corresponds to standard OpenFOAM setup
    depends_on('scotch~metis+mpi~int64', when='~int64')
    depends_on('scotch~metis+mpi+int64', when='+int64')

    depends_on('metis@5:', when='+metis')
    depends_on('metis+int64', when='+metis+int64')

    # General patches - foamEtcFile as per openfoam.com (robuster)
    common = ['spack-Allwmake', 'README-spack']
    assets = ['bin/foamEtcFile']

    # Version-specific patches
{'fraction_non_alphanumeric': 0.13990877993158496, 'fraction_numerical': 0.0653363740022805, 'mean_word_length': 4.108328479906814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7056346', 'n_tokens_mistral': 3216, 'n_tokens_neox': 2896, 'n_words': 729}