Installing wgrib2 on macOS - greencoder/gfstext GitHub Wiki
Needed wget:
$ brew install wget
Needed gfortran: (this took forever!)
$ brew install gcc
Needed XCode command-line tools:
https://developer.apple.com/download/more/?=for%20Xcode
Download and make:
$ wget ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz
$ tar -xvf wgrib2.tgz
$ cd grib2
$ sudo make
Move the generated executable to your /usr/local/bin/:
$ sudo cp wgrib2/wgrib2 /usr/local/bin
Install Errors
I kept hitting an errors when trying to install libaec. Finally I found some changes on the project website:
https://gitlab.dkrz.de/k202009/libaec/commit/9bd2d0857cdc6375ad7570516f064eb264530378
I replaced the lines in libaec-0.3.3/tests/sampledata.sh with the ones noted in the OS X and clang fixes noted above.
You might just be able to grab the source and replace the whole sampledata.sh file:
https://gitlab.dkrz.de/k202009/libaec/uploads/631e85bcf877c2dcaca9b2e6d6526339/libaec-1.0.0.tar.gz