diff --git a/var/spack/repos/builtin/packages/feelpp/package.py b/var/spack/repos/builtin/packages/feelpp/package.py index d0f929f66d2b7b..fc70b89fbb63c7 100644 --- a/var/spack/repos/builtin/packages/feelpp/package.py +++ b/var/spack/repos/builtin/packages/feelpp/package.py @@ -14,89 +14,88 @@ class Feelpp(CMakePackage): the development of applications. """ - homepage = "https://docs.feelpp.org" - url = "https://github.com/feelpp/feelpp/archive/v0.110.2.tar.gz" - git = "https://github.com/feelpp/feelpp.git" + url = "https://github.com/feelpp/feelpp/archive/v0.110.2.tar.gz" + git = "https://github.com/feelpp/feelpp.git" license("LGPL-3.0-or-later AND GPL-3.0-or-later") maintainers( "prudhomm", "vincentchabannes" ) - version('develop', branch='develop') - version('preset', branch='2284-add-spack-environment-to-the-main-ci') + version("develop", branch="develop") + version("preset", branch="2284-add-spack-environment-to-the-main-ci") # Define variants - variant('toolboxes', default=False, description="Enable the Feel++ toolboxes") - variant('mor', default=False, description="Enable Model Order Reduction (MOR)") - variant('python', default=False, description="Enable Python wrappers") - variant('quickstart', default=False, description="Enable the quickstart examples") - variant('tests', default=False, description="Enable the tests") + variant("toolboxes", default=False, description="Enable the Feel++ toolboxes") + variant("mor", default=False, description="Enable Model Order Reduction (MOR)") + variant("python", default=False, description="Enable Python wrappers") + variant("quickstart", default=False, description="Enable the quickstart examples") + variant("tests", default=False, description="Enable the tests") # Add variants for C++ standards - variant('cpp17', default=False, description="Use C++17 standard") - variant('cpp20', default=True, description="Use C++20 standard") - variant('cpp23', default=False, description="Use C++23 standard") + variant("cpp17", default=False, description="Use C++17 standard") + variant("cpp20", default=True, description="Use C++20 standard") + variant("cpp23", default=False, description="Use C++23 standard") # Define conflicts between the C++ standard variants - conflicts('+cpp17', when='+cpp20', msg="Cannot enable both C++17 and C++20") - conflicts('+cpp17', when='+cpp23', msg="Cannot enable both C++17 and C++23") - conflicts('+cpp20', when='+cpp23', msg="Cannot enable both C++20 and C++23") + conflicts("+cpp17", when="+cpp20", msg="Cannot enable both C++17 and C++20") + conflicts("+cpp17", when="+cpp23", msg="Cannot enable both C++17 and C++23") + conflicts("+cpp20", when="+cpp23", msg="Cannot enable both C++20 and C++23") # Specify dependencies with the required versions - depends_on('cmake@3.21:', type='build') # Require CMake > 3.21 - depends_on('boost@1.74: +regex+date_time+filesystem+iostreams+mpi+multithreaded+program_options+serialization+shared+system+test') - depends_on('petsc@3.20 +mumps+hwloc+ptscotch +suite-sparse+hdf5 +hypre+kokkos') - depends_on('llvm@18:',type='build') # Require LLVM (Clang) version 18 or higher - depends_on('slepc') - depends_on('mpi') - depends_on('cln@1.3.6') - depends_on('fftw') - depends_on('libunwind') - depends_on('libzip') - depends_on('bison') - depends_on('flex') - depends_on('pugixml') - depends_on('gsl') - depends_on('glpk') - depends_on('gl2ps') - depends_on('ruby') - depends_on('gmsh +opencascade+mmg+fltk') - depends_on('ruby') - depends_on('curl') + depends_on("cmake@3.21:", type="build") # Require CMake > 3.21 + depends_on("boost@1.74: +regex+date_time+filesystem+iostreams+mpi+multithreaded+program_options+serialization+shared+system+test") + depends_on("petsc@3.20 +mumps+hwloc+ptscotch +suite-sparse+hdf5 +hypre+kokkos") + depends_on("llvm@18:",type="build") # Require LLVM (Clang) version 18 or higher + depends_on("slepc") + depends_on("mpi") + depends_on("cln@1.3.6") + depends_on("fftw") + depends_on("libunwind") + depends_on("libzip") + depends_on("bison") + depends_on("flex") + depends_on("pugixml") + depends_on("gsl") + depends_on("glpk") + depends_on("gl2ps") + depends_on("ruby") + depends_on("gmsh +opencascade+mmg+fltk") + depends_on("ruby") + depends_on("curl") # Python dependencies if +python variant is enabled - depends_on('py-pytest', when='+python') - depends_on('py-pandas', when='+python') - depends_on('py-petsc4py', when='+python') - depends_on('py-slepc4py', when='+python') - depends_on('py-numpy', when='+python') - depends_on('py-pybind11', when='+python') - depends_on('py-sympy', when='+python') - depends_on('py-plotly', when='+python') - depends_on('py-scipy', when='+python') - depends_on('py-tabulate', when='+python') - depends_on('py-ipykernel', when='+python') - depends_on('py-mpi4py', when='+python') - depends_on('python@3.7:', when='+python', type=('build', 'run')) + depends_on("py-pytest", when="+python") + depends_on("py-pandas", when="+python") + depends_on("py-petsc4py", when="+python") + depends_on("py-slepc4py", when="+python") + depends_on("py-numpy", when="+python") + depends_on("py-pybind11", when="+python") + depends_on("py-sympy", when="+python") + depends_on("py-plotly", when="+python") + depends_on("py-scipy", when="+python") + depends_on("py-tabulate", when="+python") + depends_on("py-ipykernel", when="+python") + depends_on("py-mpi4py", when="+python") + depends_on("python@3.7:", when="+python", type=("build", "run")) def get_cpp_version(self): """Helper function to determine the C++ standard preset.""" - if '+cpp17' in self.spec: - return 'cpp17' - elif '+cpp20' in self.spec: - return 'cpp20' - elif '+cpp23' in self.spec: - return 'cpp17' + if "+cpp17" in self.spec: + return "cpp17" + elif "+cpp20" in self.spec: + return "cpp20" + elif "+cpp23" in self.spec: + return "cpp17" else: - return 'cpp20' # default + return "cpp20" # default def get_preset_name(self): cpp_version = self.get_cpp_version() - preset_name = f'feelpp-clang-{cpp_version}-default-release' + preset_name = f"feelpp-clang-{cpp_version}-default-release" return preset_name def cmake_args(self): @@ -104,7 +103,7 @@ def cmake_args(self): # Add options based on the variants args = [ - f'--preset={self.get_preset_name()}', + f"--preset={self.get_preset_name()}", self.define_from_variant("FEELPP_ENABLE_QUICKSTART", "quickstart"), self.define_from_variant("FEELPP_ENABLE_TESTS", "tests"), self.define_from_variant("FEELPP_ENABLE_TOOLBOXES", "toolboxes"), @@ -115,17 +114,17 @@ def cmake_args(self): def build(self, spec, prefix): """Override the default build command to use CMake presets.""" - cmake = which('cmake') + cmake = which("cmake") - cmake('--build', '--preset', self.get_preset_name()) + cmake("--build", "--preset", self.get_preset_name()) def install(self, spec, prefix): """Override the default install command to use CMake presets.""" - cmake = which('cmake') - cmake('--build', '--preset', self.get_preset_name(), '-t', 'install') + cmake = which("cmake") + cmake("--build", "--preset", self.get_preset_name(), "-t", "install") def test(self, spec, prefix): """Override the default test command to use CMake presets.""" - ctest = which('ctest') - ctest('--preset', self.get_preset_name(), '-R', 'qs_laplacian') + ctest = which("ctest") + ctest("--preset", self.get_preset_name(), "-R", "qs_laplacian")