Skip to content

Build error on both Master and Development branches #89

@blt-sl

Description

@blt-sl

I attempted to build cuSZ on my system today, but came across an error that I think is either linked to a bug in the code or insufficient build instructions. Here is details on my system:

gcc and g++: 10.5.0
cuda: 12.9
OS: Ubuntu 20.04
cmake:3.25.1

I attempted building on both the master and develop branch. I had to change the CMAKE call due to the C++ standard 17 not being used by the compiler for some reason. Here is how I called cmake:

cmake .. \
    -DPSZ_BACKEND=cuda \
    -DPSZ_BUILD_EXAMPLES=on \
    -DCMAKE_CUDA_ARCHITECTURES="80;86;89;90;100;120" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_COLOR_DIAGNOSTICS=on \
    -DCMAKE_INSTALL_PREFIX=$PWD/install \
    -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
    -DCMAKE_CXX_STANDARD=17 \
    -DCMAKE_CXX_STANDARD_REQUIRED=ON \
    -DCMAKE_CXX_EXTENSIONS=OFF \
    -DPSZ_BUILD_UTILS=OFF

This passes fine, but when I build I get the following error:

[ 29%] Building CUDA object test/CMakeFiles/l1_compact.dir/src/test_l1_compact.cu.o
/home/administrator/Downloads/cusz-latest/psz/src/utils/context.cc: In function ‘pszctx* pszctx_default_values()’:
/home/administrator/Downloads/cusz-latest/psz/src/utils/context.cc:876:11: error: too many initializers for ‘psz_header’
  876 |           },
      |           ^
make[2]: *** [CMakeFiles/psz_cu_utils.dir/build.make:163: CMakeFiles/psz_cu_utils.dir/psz/src/utils/context.cc.o] Error 1

Looking in detail, it appears that in psz/include/header.h the psz_header is defined as follows:

// @brief Memory alignment at 128 bytes for GPU if the archive is on device.
typedef struct psz_header {
  union {
    struct {
      psz_dtype dtype;
      psz_predtype pred_type;
      psz_histotype hist_type;
      psz_codectype codec1_type;
      psz_codectype _future_codec2_type;

      // pipeline config
      psz_mode mode;
      double eb;
      uint16_t radius;

      // codec config (coarse-HF)
      int vle_sublen;
      int vle_pardeg;

      uint32_t entry[PSZHEADER_END + 1];  // segment entries

      // runtime sizes
      uint32_t x, y, z, w;
      size_t splen;

      // internal loggin
      double user_input_eb;
      double logging_min, logging_max;
    };

    struct {
      uint8_t __[128];
    };
  };
} psz_header;

But when you look at the failing file, context.cc that uses the psz_header we instead have the following:

pszctx* pszctx_default_values()
{
  return new pszctx{
      .header =
          new psz_header{
              .dtype = F4,
              .pred_type = DEFAULT_PREDICTOR,
              .hist_type = DEFAULT_HISTOGRAM,
              .codec1_type = DEFAULT_CODEC,
              .mode = Rel,
              .eb = 0.1,
              .radius = 512,
              .vle_sublen = 512,
              .vle_pardeg = -1,
              .x = 1,
              .y = 1,
              .z = 1,
              .w = 1,
              .splen = 0,
          },
      .cli =
          new psz_cli_config{
              .dump_quantcode = false,
              .dump_hist = false,
              .task_construct = false,
              .task_reconstruct = false,
              .rel_range_scan = false,
              .use_gpu_verify = false,
              .skip_tofile = false,
              .skip_hf = false,
              .report_time = false,
              .report_cr = false,
              .verbose = false,
          },
      .dict_size = 1024,
      .data_len = 1,
      .ndim = -1,
      .there_is_memerr = false,
  };
}

The issue appears that the usage of the struct is missing 5 of the fields:

._future_codec2_type
.entry[PSZHEADER_END + 1] (the array)
.user_input_eb
.logging_min
.logging_max

Is this expected or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions