Skip to content

Instantly share code, notes, and snippets.

@bruceh48
Created April 15, 2017 08:26
Show Gist options
  • Save bruceh48/b5c67f6db6e4ee161ed6364a97c81d9f to your computer and use it in GitHub Desktop.
Save bruceh48/b5c67f6db6e4ee161ed6364a97c81d9f to your computer and use it in GitHub Desktop.
Compile and install WGRIB2
#!/bin/bash
apt-get update
apt-get install -y build-essential libaec-dev zlib1g-dev libcurl4-openssl-dev libboost-dev curl wget zip unzip bzip2 gfortran gcc g++
rm -rf /usr/local/grib2/
mkdir -p /usr/local/grib2/
cd /code/
if [ ! -f "/tmp/wgrib2.tgz" ]; then
wget ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz.v2.0.6c -O /tmp/wgrib2.tgz
fi
tar -xf /tmp/wgrib2.tgz
mv /tmp/grib2/ /usr/local/grib2/
cd /usr/local/grib2/grib2
export FC=gfortran && export CC=gcc
make && rm -rf /usr/local/bin/wgrib2
ln -s /usr/local/grib2/grib2/wgrib2/wgrib2 /usr/local/bin/wgrib2
rm /tmp/wgrib2.tgz
@tomholford
Copy link

@bruceh48 FYI the latest version is now 2.0.8, per this index:

ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment