spack/var/spack/repos/builtin/packages/goma/package.py
Tom Scogland 18c2f1a57a
refactor: packages import spack.package explicitly (#30404)
Explicitly import package utilities in all packages, and corresponding fallout.

This includes:

* rename `spack.package` to `spack.package_base`
* rename `spack.pkgkit` to `spack.package`
* update all packages in builtin, builtin_mock and tutorials to include `from spack.package import *`
* update spack style
  * ensure packages include the import
  * automatically add the new import and remove any/all imports of `spack` and `spack.pkgkit`
    from packages when using `--fix`
  * add support for type-checking packages with mypy when SPACK_MYPY_CHECK_PACKAGES
    is set in the environment
* fix all type checking errors in packages in spack upstream
* update spack create to include the new imports
* update spack repo to inject the new import, injection persists to allow for a deprecation period

Original message below:
 
As requested @adamjstewart, update all packages to use pkgkit.  I ended up using isort to do this,
so repro is easy:

```console
$ isort -a 'from spack.pkgkit import *' --rm 'spack' ./var/spack/repos/builtin/packages/*/package.py
$ spack style --fix
```

There were several line spacing fixups caused either by space manipulation in isort or by packages
that haven't been touched since we added requirements, but there are no functional changes in here.

* [x] add config to isort to make sure this is maintained going forward
2022-05-28 12:55:44 -04:00

82 lines
3.7 KiB
Python

# Copyright 2013-2022 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)
from spack.package import *
class Goma(CMakePackage):
"""A Full-Newton Finite Element Program for Free and Moving Boundary Problems with
Coupled Fluid/Solid Momentum, Energy, Mass, and Chemical Species Transport """
homepage = "https://www.gomafem.com"
url = "https://github.com/goma/goma/archive/v7.0.0.tar.gz"
git = "https://github.com/goma/goma.git"
maintainers = ['wortiz']
version('7.0.4', commit='27b2cb2477fa92f9457597f588c137de2572ef69')
version('7.0.0', commit='5166896f273e5853e1f32885e20f68317b24979c')
version('main', branch='main')
version('develop', branch='develop')
# Problem size variants
variant('max_conc', default='4', values=('4', '8', '10', '15', '20'),
description="Set internal maximum number of species")
variant('max_external_field', default='4', values=('4', '8', '10', '15', '20'),
description="Set internal maximum number of external fields")
variant('max_prob_var', default='15', values=('10', '15', '20', '25', '28', '34', '40', '46', '64'),
description="Set internal maximum number of active equations")
variant('mde', default='27', values=('8', '9', '10', '16', '20', '27', '54'),
description="Set internal maximum DOF per element")
# Floating point checks
variant('check_finite', default=True, description="Enable finite computation check")
variant('fpe', default=False, description="Enable floating point exception")
# Optional third party libraries
variant('arpack-ng', default=True, description="Build with ARPACK support")
variant('metis', default=True, description="Build with metis decomposition")
variant('omega-h', default=True, description="Build with Omega_h support")
variant('petsc', default=True, description="Build with PETSc solver support")
variant('sparse', default=True, description="Build with legacy sparse solver")
variant('suite-sparse', default=True, description="Build with UMFPACK support")
# Required dependencies
depends_on('mpi')
depends_on('seacas+applications')
depends_on('trilinos+mpi+epetra+aztec+amesos+stratimikos+teko+mumps+superlu-dist+ml~exodus')
# Optional dependencies
depends_on('arpack-ng', when='+arpack-ng')
depends_on('metis', when='+metis')
depends_on('omega-h+mpi', when='+omega-h')
depends_on('petsc+hypre+mpi~exodusii', when='+petsc')
depends_on('sparse', when='+sparse')
depends_on('suite-sparse', when='+suite-sparse')
def cmake_args(self):
args = []
# Problem sizes
args.append(self.define_from_variant('MAX_CONC', 'max_conc'))
args.append(
self.define_from_variant('MAX_EXTERNAL_FIELD', 'max_external_field'))
args.append(self.define_from_variant('MAX_PROB_VAR', 'max_prob_var'))
args.append(self.define_from_variant('MDE', 'mde'))
# Floating point error checks
args.append(self.define_from_variant('CHECK_FINITE', 'check_finite'))
args.append(self.define_from_variant('FP_EXCEPT', 'fpe'))
# Configure optional libraries
args.append(self.define_from_variant('ENABLE_ARPACK', 'arpack-ng'))
args.append(self.define_from_variant('ENABLE_METIS', 'metis'))
args.append(self.define_from_variant('ENABLE_OMEGA_H', 'omega-h'))
args.append(self.define_from_variant('ENABLE_PETSC', 'petsc'))
args.append(self.define_from_variant('ENABLE_SPARSE', 'sparse'))
args.append(self.define_from_variant('ENABLE_UMFPACK', 'suite-sparse'))
return args