Skip to content

Commit fe3537d

Browse files
committed
run chunk_compress.c only when compression is enabled
1 parent 98443b7 commit fe3537d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

configure.ac

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2307,9 +2307,12 @@ fi
23072307
AC_SUBST(ENABLE_SZ)
23082308
AM_CONDITIONAL(ENABLE_SZ, [test x$enable_sz = xyes])
23092309

2310+
has_compression=0
23102311
if test "x${have_zlib}" = xyes || test "x$enable_sz" = "xyes" ; then
2311-
AC_DEFINE(ENABLE_COMPRESSION, [1], [Defined if compression is enabled])
2312+
has_compression=1
23122313
fi
2314+
AC_DEFINE(ENABLE_COMPRESSION, [$has_compression], [Defined if compression is enabled])
2315+
AM_CONDITIONAL(ENABLE_COMPRESSION, [test x$has_compression = x1])
23132316

23142317
if test "x$enable_sz" = "xyes" ; then
23152318
SZ_INSTALL=""

examples/C/Makefile.am

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ check_PROGRAMS = collective_write \
3737
ghost_cell \
3838
req_all \
3939
vard_mvars \
40-
time_var \
41-
chunk_compress
40+
time_var
41+
42+
if ENABLE_COMPRESSION
43+
check_PROGRAMS += chunk_compress
44+
endif
4245

4346
if INSTALL_EXAMPLES
4447
example_execbin_PROGRAMS = $(check_PROGRAMS)

examples/C/chunk_compress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pnetcdf_io(MPI_Comm comm, char *filename, int cmode)
177177
/* check the current record dimension size */
178178
MPI_Offset dim_len;
179179
err = ncmpi_inq_dimlen(ncid, 0, &dim_len); ERR
180-
if (rank == 0)
180+
if (verbose && rank == 0)
181181
printf("Time dimension length = %lld\n", dim_len);
182182

183183
err = ncmpi_close(ncid); ERR

0 commit comments

Comments
 (0)