From 5da231969e932c2ca132be88754ebe8828b646e5 Mon Sep 17 00:00:00 2001 From: Alex Richert <82525672+AlexanderRichert-NOAA@users.noreply.github.com> Date: Tue, 4 Apr 2023 01:01:21 -0700 Subject: esmf: add static netcdf-c support (#34579) --- var/spack/repos/builtin/packages/esmf/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/esmf/package.py b/var/spack/repos/builtin/packages/esmf/package.py index a874213901..77bfe8fac7 100644 --- a/var/spack/repos/builtin/packages/esmf/package.py +++ b/var/spack/repos/builtin/packages/esmf/package.py @@ -343,6 +343,11 @@ class Esmf(MakefilePackage): # NetCDF format. env.set("ESMF_NETCDF", "nc-config") env.set("ESMF_NFCONFIG", "nf-config") + netcdfc = spec["netcdf-c"] + if netcdfc.satisfies("~shared"): + nc_config = which(os.path.join(netcdfc.prefix.bin, "nc-config")) + nc_flags = nc_config("--libs", output=str).strip() + env.set("ESMF_NETCDF_LIBS", nc_flags) ################### # Parallel-NetCDF # -- cgit v1.2.3-70-g09d2