Repository: spack/spack

Issue:
ecp-data-vis-sdk: remove enforced `+fortran`
Hi,

the `ecp-data-vis-sdk` package enforces `+fortran` on a lot of packages, e.g., ADIOS2 and HDF5. This is not ideal for me, building a C++ stack where I like to avoid Fortran dependencies as much as possible to save compile time.

Can you please make the hard-coded `+fortran` forwards a variant? :)


Discussion:
This was a topic of discussion in our group before and I can bring it up again. I am very much on the fence on being able to specify extra language support from the SDK. The use case you present here seems like it may be a valid reason to be able to disable fortran at very least.

From our previous discussion, language extensions like this off of the core C/C++ libraries for fortran and python felt like they could be options, but they are also almost always required in many stacks. The general sentiment has also been to limit the variants for the SDK to only provide high level control, it is a slippery slope to providing too many customizations at the SDK level.
Thanks, to add another use case: half of our team are Mac users and I want to achieve a quick spack experience on new machines where I can keep FC and F77 to be null in compilers.yaml

I think I can achieve that already unless I use the SDK package
https://twitter.com/axccl/status/1560808524586061824

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py b/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py
--- a/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py
+++ b/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py
@@ -87,6 +87,9 @@ class EcpDataVisSdk(BundlePackage, CudaPackage, ROCmPackage):
     variant("vtkm", default=False, description="Enable VTK-m")
     variant("zfp", default=False, description="Enable ZFP")
 
+    # Language Options
+    variant("fortran", default=True, sticky=True, description="Enable fortran language features.")
+
     ############################################################
     # Dependencies
     ############################################################
@@ -94,9 +97,9 @@ class EcpDataVisSdk(BundlePackage, CudaPackage, ROCmPackage):
     amdgpu_target_variants = ["amdgpu_target={0}".format(x) for x in ROCmPackage.amdgpu_targets]
 
     dav_sdk_depends_on(
-        "adios2+shared+mpi+fortran+python+blosc+sst+ssc+dataman",
+        "adios2+shared+mpi+python+blosc+sst+ssc+dataman",
         when="+adios2",
-        propagate=["hdf5", "sz", "zfp"],
+        propagate=["hdf5", "sz", "zfp", "fortran"],
     )
 
     dav_sdk_depends_on("darshan-runtime+mpi", when="+darshan", propagate=["hdf5"])
@@ -104,9 +107,9 @@ class EcpDataVisSdk(BundlePackage, CudaPackage, ROCmPackage):
 
     dav_sdk_depends_on("faodel+shared+mpi network=libfabric", when="+faodel", propagate=["hdf5"])
 
-    dav_sdk_depends_on("hdf5@1.12: +shared+mpi+fortran", when="+hdf5")
+    dav_sdk_depends_on("hdf5@1.12: +shared+mpi", when="+hdf5", propagate=["fortran"])
 
-    dav_sdk_depends_on("parallel-netcdf+shared+fortran", when="+pnetcdf")
+    dav_sdk_depends_on("parallel-netcdf+shared", when="+pnetcdf", propagate=["fortran"])
 
     dav_sdk_depends_on("unifyfs", when="+unifyfs ")
 
@@ -158,7 +161,7 @@ class EcpDataVisSdk(BundlePackage, CudaPackage, ROCmPackage):
     )
 
     # +python is currently broken in sz
-    # dav_sdk_depends_on('sz+shared+fortran+python+random_access',
-    dav_sdk_depends_on("sz+shared+fortran+random_access", when="+sz", propagate=["hdf5"])
+    # dav_sdk_depends_on('sz+shared+python+random_access',
+    dav_sdk_depends_on("sz+shared+random_access", when="+sz", propagate=["hdf5", "fortran"])
 
     dav_sdk_depends_on("zfp", when="+zfp", propagate=["cuda"] + cuda_arch_variants)


Test patch: