Unidata / netcdf-c

Official GitHub repository for netCDF-C libraries and utilities.
BSD 3-Clause "New" or "Revised" License
511 stars 263 forks source link

nc_test4/tst_vars4.c is failing for me on main branch, with filter not found error due to not finding zstandard filter #2443

Closed edwardhartnett closed 2 years ago

edwardhartnett commented 2 years ago

In tst_vars4.c we have:

#ifdef HAVE_ZSTD
#define ZSTANDARD_LEVEL 10
    printf("**** testing zstandard filter...");
    {
        int varid, ncid, dims[NDIM2];
        int level_in, hasfilter;
    int ret;

        if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
        if (nc_def_dim(ncid, X_NAME, XDIM_LEN, &dims[0])) ERR;
        if (nc_def_dim(ncid, Y_NAME, YDIM_LEN, &dims[1])) ERR;
        if (nc_def_var(ncid, VAR_NAME, NC_FLOAT, 2, dims, &varid)) ERR;
        if ((ret = nc_def_var_zstandard(ncid, varid, ZSTANDARD_LEVEL)))
    {
        printf("netcdf error: %s\n", nc_strerror(ret));
        ERR;
    }
        if (nc_inq_var_zstandard(ncid, varid, &hasfilter, &level_in)) ERR;
    if (!hasfilter || level_in != ZSTANDARD_LEVEL) ERR;
        if (nc_close(ncid)) ERR;

        /* Open the file and check. */
        if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
        if (nc_inq_var_zstandard(ncid, varid, &hasfilter, &level_in)) ERR;
    if (!hasfilter || level_in != ZSTANDARD_LEVEL) ERR;
        if (nc_close(ncid)) ERR;
    }
    SUMMARIZE_ERR;
#endif  /* HAVE_ZSTD */

This is failing because the zstandard filter is not found.

What should be happening is that the test needs to add the build directory to the HDF5_PLUGIN_PATH before running the test, but it isn't.

I will take a look at fixing this...

edwardhartnett commented 2 years ago

And then this went away. I will close this issue and keep an eye on this...