From d959b110851ba89fad937535f79fca5674926b46 Mon Sep 17 00:00:00 2001 From: Ann Almgren Date: Fri, 22 Nov 2024 09:37:16 -0800 Subject: [PATCH] fix Make.ERF to find netcdf --- Exec/Make.ERF | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Exec/Make.ERF b/Exec/Make.ERF index b03ef317a..779e68b93 100644 --- a/Exec/Make.ERF +++ b/Exec/Make.ERF @@ -251,8 +251,14 @@ endif #turn on NetCDF macro define ifeq ($(USE_NETCDF), TRUE) DEFINES += -DERF_USE_NETCDF - includes += $(shell pkg-config --cflags netcdf) - LIBRARIES += $(shell pkg-config --libs netcdf) + has_netcdf_mpi := $(shell pkg-config --cflags netcdf-mpi > /dev/null 2>&1; echo $$?) + ifeq ($(has_netcdf_mpi),0) + includes += $(shell pkg-config --cflags netcdf-mpi) + LIBRARIES += $(shell pkg-config --libs netcdf-mpi) + else + includes += $(shell pkg-config --cflags netcdf) + LIBRARIES += $(shell pkg-config --libs netcdf) + endif endif ifeq ($(USE_HDF5), TRUE)