spack/var/spack/repos/spack_repo/builtin/packages/cleverleaf/package.py
Harmen Stoppels 2929ea02a1
Move builders into builtin repo (#50452)
Builders and package classes refer to packages from the builtin package
repo and are often modified together with packages. That means that
these classes should move into `spack_repo.builtin`.

* move `spack.build_systems` -> `spack_repo.builtin.build_systems`

* Remove the following re-exports from the `spack.package` module:
  - `AspellDictPackage`                 - `LuaPackage`
  - `AutotoolsPackage`                  - `MakefilePackage`
  - `BundlePackage`                     - `MavenPackage`
  - `CachedCMakePackage`                - `MesonPackage`
  - `cmake_cache_filepath`              - `MSBuildPackage`
  - `cmake_cache_option`                - `NMakePackage`
  - `cmake_cache_path`                  - `OctavePackage`
  - `cmake_cache_string`                - `PerlPackage`
  - `CargoPackage`                      - `PythonExtension`
  - `CMakePackage`                      - `PythonPackage`
  - `generator`                         - `QMakePackage`
  - `CompilerPackage`                   - `RacketPackage`
  - `CudaPackage`                       - `RPackage`
  - `Package`                           - `ROCmPackage`
  - `GNUMirrorPackage`                  - `RubyPackage`
  - `GoPackage`                         - `SConsPackage`
  - `IntelPackage`                      - `SIPPackage`
  - `IntelOneApiLibraryPackageWithSdk`  - `SourceforgePackage`
  - `IntelOneApiLibraryPackage`         - `SourcewarePackage`
  - `IntelOneApiStaticLibraryList`      - `WafPackage`
  - `IntelOneApiPackage`                - `XorgPackage`
  - `INTEL_MATH_LIBRARIES`

* update mock packages to repo v2.0 and add copies of packages/build
  systems they use from builtin

* add missing imports to build systems in `package.py` from builtin
  and test repos

* update various tests

This PR is breaking because of removal of various names from
 `spack.package`, but breakage should be minimal thanks to #50496, which
 ensures the above names are always imported in repo v1 packages.

Specifically this PR breaks imports like the following in `package.py` files:

```python
from spack.package import Package
```

but if your repo is v1.0 (see `spack repo list`) and has the following
much more common pattern:

```python
from spack.package import *
```

nothing should break.
2025-05-18 20:31:20 -07:00

48 lines
1.6 KiB
Python

# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack_repo.builtin.build_systems.cmake import CMakePackage
from spack.package import *
from ..boost.package import Boost
class Cleverleaf(CMakePackage):
"""CleverLeaf is a hydrodynamics mini-app that extends CloverLeaf with
Adaptive Mesh Refinement using the SAMRAI toolkit from Lawrence
Livermore National Laboratory. The primary goal of CleverLeaf is
to evaluate the application of AMR to the Lagrangian-Eulerian
hydrodynamics scheme used by CloverLeaf.
"""
homepage = "https://uk-mac.github.io/CleverLeaf/"
git = "https://github.com/UK-MAC/CleverLeaf_ref.git"
license("LGPL-3.0-or-later")
version("develop", branch="develop")
depends_on("cxx", type="build") # generated
depends_on("fortran", type="build") # generated
depends_on("samrai@3.8.0:")
depends_on("hdf5+mpi")
# TODO: replace this with an explicit list of components of Boost,
# for instance depends_on('boost +filesystem')
# See https://github.com/spack/spack/pull/22303 for reference
depends_on(Boost.with_default_variants)
depends_on("cmake@3.1:", type="build")
# The Fujitsu compiler requires the '--linkfortran'
# option to combine C++ and Fortran programs.
patch("fujitsu_add_link_flags.patch", when="%fj")
def flag_handler(self, name, flags):
if self.spec.satisfies("%intel") and name in ["cppflags", "cxxflags"]:
flags.append(self.compiler.cxx11_flag)
return (None, None, flags)