paraview: add cdi support (#44222)

* add basic CDI package

* add CDI variant to paraview

* [@spackbot] updating style on behalf of albestro

---------

Co-authored-by: albestro <albestro@users.noreply.github.com>
This commit is contained in:
Alberto Invernizzi 2024-08-29 14:19:04 +02:00 committed by GitHub
parent 093b273f5c
commit 9a16927993
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,30 @@
# Copyright 2013-2024 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 Cdi(AutotoolsPackage):
"""
CDI is a C and Fortran Interface to access Climate and NWP model Data.
Supported data formats are GRIB, netCDF, SERVICE, EXTRA and IEG.
"""
homepage = "https://code.mpimet.mpg.de/projects/cdi"
url = "https://code.mpimet.mpg.de/attachments/download/29309/cdi-2.4.0.tar.gz"
version("2.4.0", sha256="91fca015b04c6841b9eab8b49e7726d35e35b9ec4350922072ec6e9d5eb174ef")
variant(
"netcdf", default=True, description="This is needed to read/write NetCDF files with CDI"
)
depends_on("netcdf-c", when="+netcdf")
def configure_args(self):
args = []
if "+netcdf" in self.spec:
args.append("--with-netcdf=" + self.spec["netcdf-c"].prefix)
return args

View File

@ -88,6 +88,7 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage):
variant("adios2", default=False, description="Enable ADIOS2 support", when="@5.8:")
variant("visitbridge", default=False, description="Enable VisItBridge support")
variant("raytracing", default=False, description="Enable Raytracing support")
variant("cdi", default=False, description="Enable CDI support")
variant(
"openpmd",
default=False,
@ -234,6 +235,8 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage):
depends_on("openimagedenoise", when="+raytracing")
depends_on("ospray +mpi", when="+raytracing +mpi")
depends_on("cdi", when="+cdi")
depends_on("bzip2")
depends_on("double-conversion")
depends_on("expat")
@ -706,6 +709,10 @@ def use_x11():
cmake_args.append(self.define_from_variant("VTK_ENABLE_OSPRAY", "raytracing"))
cmake_args.append(self.define_from_variant("VTKOSPRAY_ENABLE_DENOISER", "raytracing"))
# CDI
cmake_args.append(self.define_from_variant("PARAVIEW_PLUGIN_ENABLE_CDIReader", "cdi"))
cmake_args.append(self.define_from_variant("PARAVIEW_PLUGIN_AUTOLOAD_CDIReader", "cdi"))
return cmake_args
def test_smoke_test(self):