From e059a8db43d7aaceeed8b7da79621f0c41f95933 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 3 Apr 2019 14:46:00 -0600 Subject: [PATCH] NETCDF: Fix search of netcdf_meta To determine whether NetCDF is compiled for parallel, we search the `netcdf_meta.h` file for the setting of `NETCDF_PARALLEL`. The problem is that the NetCDF team recently added another setting which is named `NETCDF_PARALLEL4`. We want the `NETCDF_PARALLEL` so to make sure we get that one only, we add a space to the end of the symbol `NETCDF_PARALLEL ` --- tribits/common_tpls/find_modules/FindNetCDF.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tribits/common_tpls/find_modules/FindNetCDF.cmake b/tribits/common_tpls/find_modules/FindNetCDF.cmake index ce8a381b5..c9539cabe 100644 --- a/tribits/common_tpls/find_modules/FindNetCDF.cmake +++ b/tribits/common_tpls/find_modules/FindNetCDF.cmake @@ -193,7 +193,9 @@ else(NetCDF_LIBRARIES AND NetCDF_INCLUDE_DIRS) NO_DEFAULT_PATH) if(meta_path) # Search meta for NC_HAS_PARALLEL setting... - file(STRINGS "${meta_path}/netcdf_meta.h" netcdf_par_string REGEX "NC_HAS_PARALLEL") + # Note that there is both NC_HAS_PARALLEL4 and NC_HAS_PARALLEL, only want NC_HAS_PARALLEL + # so add a space to end to avoid getting NC_HAS_PARALLEL4 + file(STRINGS "${meta_path}/netcdf_meta.h" netcdf_par_string REGEX "NC_HAS_PARALLEL ") string(REGEX REPLACE "[^0-9]" "" netcdf_par_val "${netcdf_par_string}") # NOTE: The line for NC_HAS_PARALLEL has an hdf5 string in it which results # netcdf_par_val being set to 05 or 15 above...