
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
88 lines
3.8 KiB
Python
88 lines
3.8 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 Albany(CMakePackage):
|
|
"""Albany is an implicit, unstructured grid, finite element code for the
|
|
solution and analysis of multiphysics problems. The Albany repository
|
|
on the GitHub site contains hundreds of regression tests and examples
|
|
that demonstrate the code's capabilities on a wide variety of problems
|
|
including fluid mechanics, solid mechanics (elasticity and plasticity),
|
|
ice-sheet flow, quantum device modeling, and many other applications."""
|
|
|
|
homepage = "http://gahansen.github.io/Albany"
|
|
git = "https://github.com/gahansen/Albany.git"
|
|
|
|
maintainers = ['gahansen']
|
|
|
|
version('develop', branch='master')
|
|
|
|
variant('lcm', default=True,
|
|
description='Enable LCM')
|
|
variant('aeras', default=False,
|
|
description='Enable AERAS')
|
|
variant('qcad', default=False,
|
|
description='Enable QCAD')
|
|
variant('hydride', default=False,
|
|
description='Enable HYDRIDE')
|
|
variant('lcm_spec', default=False,
|
|
description='Enable LCM_SPECULATIVE')
|
|
variant('lame', default=False,
|
|
description='Enable LAME')
|
|
variant('debug', default=False,
|
|
description='Enable DEBUGGING')
|
|
variant('fpe', default=False,
|
|
description='Enable CHECK_FPE')
|
|
variant('scorec', default=False,
|
|
description='Enable SCOREC')
|
|
variant('felix', default=False,
|
|
description='Enable FELIX')
|
|
variant('mor', default=False,
|
|
description='Enable MOR')
|
|
variant('confgui', default=False,
|
|
description='Enable Albany configuration (CI) GUI')
|
|
variant('ascr', default=False,
|
|
description='Enable ALBANY_ASCR')
|
|
variant('perf', default=False,
|
|
description='Enable PERFORMANCE_TESTS')
|
|
variant('64bit', default=True,
|
|
description='Enable 64BIT')
|
|
|
|
# Add dependencies
|
|
depends_on('mpi')
|
|
depends_on('trilinos~superlu-dist+isorropia+tempus+rythmos+teko+intrepid+intrepid2+minitensor+phalanx+nox+piro+rol+shards+stk+superlu@master')
|
|
|
|
def cmake_args(self):
|
|
spec = self.spec
|
|
trilinos_dir = spec['trilinos'].prefix
|
|
options = []
|
|
|
|
options.extend([
|
|
'-DALBANY_TRILINOS_DIR:FILEPATH={0}'.format(trilinos_dir),
|
|
'-DINSTALL_ALBANY:BOOL=ON'
|
|
])
|
|
|
|
options.extend([
|
|
self.define_from_variant('ENABLE_LCM', 'lcm'),
|
|
self.define_from_variant('ENABLE_AERAS', 'aeras'),
|
|
self.define_from_variant('ENABLE_QCAD', 'qcad'),
|
|
self.define_from_variant('ENABLE_HYDRIDE', 'hydride'),
|
|
self.define_from_variant('ENABLE_LCM_SPECULATIVE', 'lcm_spec'),
|
|
self.define_from_variant('ENABLE_LAME', 'lame'),
|
|
self.define_from_variant('ENABLE_DEBUGGING', 'debug'),
|
|
self.define_from_variant('ENABLE_CHECK_FPE', 'fpe'),
|
|
self.define_from_variant('ENABLE_SCOREC', 'scorec'),
|
|
self.define_from_variant('ENABLE_FELIX', 'felix'),
|
|
self.define_from_variant('ENABLE_MOR', 'mor'),
|
|
self.define_from_variant('ENABLE_ALBANY_CI', 'ci'),
|
|
self.define_from_variant('ENABLE_ASCR', 'ascr'),
|
|
self.define_from_variant('ENABLE_PERFORMANCE_TESTS', 'perf'),
|
|
self.define_from_variant('ENABLE_64BIT_INT', '64bit')
|
|
])
|
|
|
|
return options
|