Building Wgrib2 from Sources

From OpenGrADS
Jump to: navigation, search

Quick Instructions[edit]

Here is the quickest way to build wgrib2 from sources:

  • Choose a working directory and make sure you have GNU make.
  • Get the supplibs v2.0.1 or later, either pre-compiled or compile it yourself.
Pre-compiled: Download the binary Supplemental Libraries (Supplibs) from our site, and untar them in this working directory:
    % gunzip supplibs-2.x.y.tar.gz
    % tar xvf supplibs-2.x.y.tar
The compiled libraries along with binaries and header files are contained in a platform dependent subdirectory; e.g. i686-pc-linux-gnu in case of a Linux build. Provide a symbolic link named supplibs to that directory:
    % ln -s supplibs-2.x.y/i686-pc-linux-gnu supplibs
If your platform specific name is different, modify the above line accordingly.
Building from source: Download the mini_supplibs sources from our site, untar them in the same location, and build them:
    % cd mini_supplibs-2.x.y/src
    % gmake install     
Do not configure or issue a simple make; just do a gmake install as indicated above. Once the build has finished successfully, provide a symbolic link named 'supplibs' pointing to the platform dependent directory which contains the newly build libraries:
    % cd ../..
    % ln -s mini_supplibs-2.0.0/i686-pc-linux-gnu supplibs
The name of the installation directory for the supplementary libraries (i686-pc-linux-gnu on a typical Linux PC) depends on the build machine's architecture and operating system. You therefore might have to modify the above line accordingly.
  • Download the wgrib2 sources from, untar them in this same working directory, configure and make:
    % cd wgrib2-<version>
    % ./configure
    % gmake 
    % gmake check
    % gmake bin-dist   (to create binary tarball)
    % gmake install