From f765d5d8bb8119a0c5bf58e74bfcd2519e031fb1 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 5 Nov 2024 13:49:49 -0700 Subject: [PATCH] EXODUS: Better error message for misconfigured netcdf library --- packages/seacas/libraries/exodus/include/exodusII.h | 8 ++++---- packages/seacas/libraries/exodus/src/ex_open.c | 8 ++++++++ packages/seacas/libraries/exodus/src/ex_open_par.c | 12 ++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/seacas/libraries/exodus/include/exodusII.h b/packages/seacas/libraries/exodus/include/exodusII.h index ce2a6f21b9..600383c790 100644 --- a/packages/seacas/libraries/exodus/include/exodusII.h +++ b/packages/seacas/libraries/exodus/include/exodusII.h @@ -55,12 +55,12 @@ #endif /* EXODUS version number */ -#define EXODUS_VERSION "9.03" +#define EXODUS_VERSION "9.04" #define EXODUS_VERSION_MAJOR 9 -#define EXODUS_VERSION_MINOR 3 -#define EXODUS_RELEASE_DATE "October 2, 2024" +#define EXODUS_VERSION_MINOR 4 +#define EXODUS_RELEASE_DATE "November 5, 2024" -#define EX_API_VERS 9.03f +#define EX_API_VERS 9.04f #define EX_API_VERS_NODOT (100 * EXODUS_VERSION_MAJOR + EXODUS_VERSION_MINOR) #define EX_VERS EX_API_VERS diff --git a/packages/seacas/libraries/exodus/src/ex_open.c b/packages/seacas/libraries/exodus/src/ex_open.c index baac050f4a..91901eb62b 100644 --- a/packages/seacas/libraries/exodus/src/ex_open.c +++ b/packages/seacas/libraries/exodus/src/ex_open.c @@ -190,6 +190,8 @@ int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *ver "issue.\n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #else /* This is an hdf5 (netcdf4) file. If NC_HAS_HDF5 is not defined, then we either don't have hdf5 support in this netcdf version, @@ -206,6 +208,8 @@ int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *ver "other issue.\n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #endif } else if (type == 4) { @@ -217,6 +221,8 @@ int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *ver "issue \n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #else /* This is an cdf5 (64BIT_DATA) file. If NC_64BIT_DATA is not defined, then we either don't have cdf5 support in this netcdf version, @@ -233,6 +239,8 @@ int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *ver "other issue \n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #endif } diff --git a/packages/seacas/libraries/exodus/src/ex_open_par.c b/packages/seacas/libraries/exodus/src/ex_open_par.c index 6d44fba06b..8b91169b5c 100644 --- a/packages/seacas/libraries/exodus/src/ex_open_par.c +++ b/packages/seacas/libraries/exodus/src/ex_open_par.c @@ -222,6 +222,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float "issue \n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #else /* This is an hdf5 (netcdf4) file. If NC_HAS_HDF5 is not defined, then we either don't have hdf5 support in this netcdf version, @@ -238,6 +240,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float "other issue \n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #endif } else if (type == 4) { @@ -249,6 +253,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float "issue \n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #else /* This is an cdf5 (64BIT_DATA) file. If NC_64BIT_DATA is not defined, then we either don't have cdf5 support in this netcdf version, @@ -265,6 +271,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float "other issue \n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #endif } else if (type == 1 || type == 2) { @@ -277,6 +285,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float "issue \n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #else /* This is an normal NetCDF format file, for parallel reading, the PNetCDF library is required but that is not compiled into this version. @@ -287,6 +297,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float "built with PNetCDF support as required for parallel access to this file.\n", canon_path); ex_err(__func__, errmsg, status); + free(canon_path); + EX_FUNC_LEAVE(EX_FATAL); #endif }