Use NCEPLIBS-g2c v2.1.0 + enable wgrib2 PNG decoder
The linker error from the previous attempt was actual symbol
references, not a flag-combination oddity:
undefined reference to `g2c_enc_jpeg2000'
undefined reference to `g2c_dec_jpeg2000'
Those live in g2c's "new" file-based API, built only when
BUILD_G2C=ON. In v1.9.0 the option defaulted OFF and was marked
"experimental until 2.0.0 release", so I had explicitly disabled
it. In v2.1.0 (released 2025-01-13, before wgrib2 v3.6.0 on
2025-02-19) it defaults ON and the API is stable. Bump
G2C_VERSION to 2.1.0 and drop the BUILD_G2C override.
With the new-API symbols now exported, wgrib2 can be compiled
with every decoder we care about in one shot:
-DUSE_PNG=ON -DUSE_OPENJPEG=ON -DUSE_AEC=ON
`wgrib2 -config` in the final runtime image now reports:
Supported decoding: simple, complex, rle, ieee, png, jpeg2000,
CCSDS AEC
Verified end-to-end by building the full image with podman and
running wgrib2 -config inside it. MrmsFetchWorker's packing
type 41 (PNG) messages will decode once the rolling deploy lands.
This commit is contained in:
parent
4167eb54c9
commit
7352d06ade
1 changed files with 14 additions and 13 deletions
27
Dockerfile
27
Dockerfile
|
|
@ -22,7 +22,12 @@ ARG RUNNER_IMAGE="docker.io/debian:${DEBIAN_VERSION}"
|
||||||
FROM ${RUNNER_IMAGE} AS wgrib2-builder
|
FROM ${RUNNER_IMAGE} AS wgrib2-builder
|
||||||
|
|
||||||
ARG WGRIB2_VERSION=3.6.0
|
ARG WGRIB2_VERSION=3.6.0
|
||||||
ARG G2C_VERSION=1.9.0
|
# g2c v2.1.0 is the first release where BUILD_G2C defaults ON, which
|
||||||
|
# is what wgrib2 v3.6.0 needs at link time (g2c_enc_jpeg2000 /
|
||||||
|
# g2c_dec_jpeg2000 come from the "new" file-based API). v1.9.0's
|
||||||
|
# same flag was OFF by default with a note about the API being
|
||||||
|
# experimental until 2.0.0.
|
||||||
|
ARG G2C_VERSION=2.1.0
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
|
@ -54,24 +59,20 @@ RUN wget -q --content-disposition "https://github.com/NOAA-EMC/NCEPLIBS-g2c/arch
|
||||||
|
|
||||||
WORKDIR /tmp/wgrib2
|
WORKDIR /tmp/wgrib2
|
||||||
|
|
||||||
# wgrib2 flag notes:
|
# wgrib2 flags:
|
||||||
# * USE_OPENJPEG is what wgrib2's own CI (Linux_options.yml) tests
|
# * USE_PNG / USE_OPENJPEG / USE_AEC each turn on the matching
|
||||||
# — it triggers the g2c linkage and is known to build cleanly. An
|
# encoder path inside wgrib2 and add the compression name to the
|
||||||
# earlier attempt with -DUSE_PNG=ON alone got all the way to
|
# -config output. With g2c v2.1.0 underneath (which exports the
|
||||||
# linking libwgrib2.so and then died with Error 2 on the wgrib2_exe
|
# g2c_enc_* / g2c_dec_* new-API symbols) all three can be enabled
|
||||||
# link step (wgrib2 doesn't gate every jpeg_pk.c path properly
|
# together — the earlier build failure was not about the flag
|
||||||
# when USE_PNG is set without USE_JASPER/USE_OPENJPEG).
|
# combination, it was g2c v1.9.0 shipping without BUILD_G2C.
|
||||||
# * wgrib2 delegates actual decompression to g2c, and g2c above was
|
|
||||||
# built with USE_PNG=ON, so PNG-packed GRIB2 (DRT 5.41, e.g. MRMS
|
|
||||||
# PrecipRate) still decodes correctly through this link even
|
|
||||||
# though wgrib2's own USE_PNG knob stays off.
|
|
||||||
RUN wget -q --content-disposition "https://github.com/NOAA-EMC/wgrib2/archive/refs/tags/v${WGRIB2_VERSION}.tar.gz" \
|
RUN wget -q --content-disposition "https://github.com/NOAA-EMC/wgrib2/archive/refs/tags/v${WGRIB2_VERSION}.tar.gz" \
|
||||||
-O wgrib2.tar.gz \
|
-O wgrib2.tar.gz \
|
||||||
&& tar xzf wgrib2.tar.gz \
|
&& tar xzf wgrib2.tar.gz \
|
||||||
&& cd wgrib2-${WGRIB2_VERSION} \
|
&& cd wgrib2-${WGRIB2_VERSION} \
|
||||||
&& mkdir build && cd build \
|
&& mkdir build && cd build \
|
||||||
&& cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
|
&& cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
|
||||||
-DUSE_OPENJPEG=ON -DUSE_AEC=ON \
|
-DUSE_PNG=ON -DUSE_OPENJPEG=ON -DUSE_AEC=ON \
|
||||||
&& make -j$(nproc) \
|
&& make -j$(nproc) \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& strip /usr/local/bin/wgrib2
|
&& strip /usr/local/bin/wgrib2
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue