diff --git a/Dockerfile b/Dockerfile index 742231e7..52de4e5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,20 +73,22 @@ RUN wget -q --content-disposition "https://github.com/NOAA-EMC/NCEPLIBS-g2c/arch WORKDIR /tmp/wgrib2 -# wgrib2 flags: -# * USE_PNG / USE_OPENJPEG / USE_AEC each turn on the matching -# encoder path inside wgrib2 and add the compression name to the -# -config output. With g2c v2.1.0 underneath (which exports the -# g2c_enc_* / g2c_dec_* new-API symbols) all three can be enabled -# together — the earlier build failure was not about the flag -# combination, it was g2c v1.9.0 shipping without BUILD_G2C. +# wgrib2 3.8.0 cmake flags: +# * USE_AEC turns on AEC compression decode for HRRR files. +# * USE_G2CLIB_LOW links wgrib2 to the external g2c lib for png + +# jpeg2000 decode. The previous USE_PNG / USE_OPENJPEG flags don't +# exist in wgrib2 3.8.0 — they were silently ignored, leaving +# wgrib2 unable to read GRIB2 packing type 40 (HRDPS uses it). +# Verified 2026-04-30 by ldd showing only libc/libm linked. +# * The g2c v2.1.0 build above carries the actual OpenJPEG support; +# wgrib2 dispatches to g2c via USE_G2CLIB_LOW. RUN wget -q --content-disposition "https://github.com/NOAA-EMC/wgrib2/archive/refs/tags/v${WGRIB2_VERSION}.tar.gz" \ -O wgrib2.tar.gz \ && tar xzf wgrib2.tar.gz \ && cd wgrib2-${WGRIB2_VERSION} \ && mkdir build && cd build \ && cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \ - -DUSE_PNG=ON -DUSE_OPENJPEG=ON -DUSE_AEC=ON \ + -DUSE_AEC=ON -DUSE_G2CLIB_LOW=ON \ && make -j$(nproc) \ && make install \ && strip /usr/local/bin/wgrib2 diff --git a/rust/prop_grid_rs/Dockerfile b/rust/prop_grid_rs/Dockerfile index a87ae4de..83a83014 100644 --- a/rust/prop_grid_rs/Dockerfile +++ b/rust/prop_grid_rs/Dockerfile @@ -51,13 +51,22 @@ RUN wget -q --content-disposition "https://github.com/NOAA-EMC/NCEPLIBS-g2c/arch && make install WORKDIR /tmp/wgrib2 +# JPEG2000 decode (GRIB2 packing type 40 — used by HRDPS) comes from the +# external g2c lib via USE_G2CLIB_LOW. Without that flag wgrib2's stock +# build links neither g2c nor any JPEG2000 backend (verified 2026-04-30 +# by `ldd /usr/local/bin/wgrib2` showing only libc/libm and a runtime +# `*** FATAL ERROR: packing type 40 not supported ***` from HRDPS files). +# +# wgrib2 3.8.0 does NOT have USE_OPENJPEG or USE_JASPER cmake options — +# the only knob is USE_G2CLIB_LOW for png/jpeg2000 decode. The g2c lib +# we built above carries the actual OpenJPEG support. RUN wget -q --content-disposition "https://github.com/NOAA-EMC/wgrib2/archive/refs/tags/v${WGRIB2_VERSION}.tar.gz" \ -O wgrib2.tar.gz \ && tar xzf wgrib2.tar.gz \ && cd wgrib2-${WGRIB2_VERSION} \ && mkdir build && cd build \ && cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \ - -DUSE_PNG=ON -DUSE_OPENJPEG=ON -DUSE_AEC=ON \ + -DUSE_AEC=ON -DUSE_G2CLIB_LOW=ON \ && make -j$(nproc) \ && make install \ && strip /usr/local/bin/wgrib2