Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For more information about grib_api, please visit the grib_api website.

...

width65%

Before you start

Decide where you will put the grib_api package.

For a single user, we recommend installing grib_api in the same directory as the model distribution. For a multi-user environment, say a cluster or High Performance Computing Facility (HPCF), we suggest installing the grib_api package centrally once only and pointing your build configuration to this location.

In the walk-through example that follows, we assume a single-user download and install.

...

borderColorblue
bgColorlightblue
borderWidth1
titleQuick start
borderStylesolid

...

Download grib_api

...

...

but read this page if you encounter problems.

Download grib_api

In this example, assume you have created a directory called 'oifs' in which you will download and compile grib_api and the OpenIFS code.

...

Code Block
cd grib_api
CC=gcc FC=gfortran  \
./configure --prefix=$(pwd)/myinstall --enable-static --enable-pthread   \
                               --disable-shared --disable-jpeg --disable-omp-packing --disable-vector --enable-python

Note the use of the backslash '\' to allow the command to use two lines.

...

--prefix=$(pwd)/myinstallThis specifies where you want the grib_api files to be installed. In our example here, we will put the compiled grib_api libraries in our example directory oifs/grib_api/myinstall. If you are on a shared high performance computer facility, the install path would most likely be somewhere central. If you specify nothing for --prefix, by default grib_api will install in /usr/local.
--enable-static
--disable-shared
python
Enabling the python interface is recommended as some OpenIFS supplementary software makes use of Python e.g. plotting/analysisOpenIFS needs to link with a static library for grib_api (i.e. libgrib.a), so a shared library version is not required. By default both are built but in case defaults change in future releases, better enforce them.
--disable-jpegOpenIFS does not need to support JPEG and PNG for data compression. This removes the need to link OpenIFS against the Jasper library (libjasper.a).
--disable-omp-packingOpenMP enabled packing is removed as the model needs to have control over OpenMP multithreading. This is usually disabled by default but it's best to enforce it in case the default changes for future releases.
--disable-vectorLikewise, on vector computer hardware (e.g. NEC), you can enable this option and grib_api will use a more efficient packing/unpacking method suitable for vector machines.
--enable-pthreadThis option ensures that grib_api is thread-safe. Again, this is normally the default but we enforce it here as OpenIFS will call grib_api from parallel threads.

...

Code Block
CC=icc FC=ifort  \
CFLAGS="-O" FCFLAGS="-O2 -fp-model precise"  \
./configure --prefix=$(pwd)/myinstall --enable-static --enable-pthread --disable-shared --disable-jpeg --disable-omp-packing --disable-vector --enable-python

IBM compiler:

Code Block
CC=xlc_r FC=xlf90_r  \
CFLAGS="-O" FCFLAGS="-g -O3 -qstrict -qarch=auto -qtune=auto" \
./configure --prefix=$(pwd)/myinstall --enable-static --enable-pthread --disable-shared --disable-jpeg --disable-omp-packing --disable-vector --enable-python
Info

In this example, note the use of the '_r' form of the IBM compiler to ensure grib_api is compiled 'thread-safe'. This is important as grib_api will be called by multiple threads with OpenIFS.

...

Info
titleNOTE!

Some HPC systems have a different architecture for their login (or frontend node) to the batch node, but the frontend compilation system is targeted at the batch nodes. If this is the case you may see failures in the 'make check' stage because the checks, although compiled for the backend batch nodes, are being run on the frontend nodes and therefore may not work correctly. If this is the case on your system, we recommend running the 'make check' step in a small batch job to verify grib_api works correctly.

Finally (smile), to install grib_api do:

...