The actual netcdf version used during compilation has to be pinned for the runtime (e.g. like in HDF5). There is version 18.0.0 available: https://github.com/Amber-MD/cpptraj/releases