Versions Compared

Key

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

...

Code Block
cd grib_api
CC=gcc FC=gfortran  \
./configure --prefix=$(pwd)/myinstall --enable-pthread --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-pythonEnabling the python interface is recommended as some OpenIFS supplementary software makes use of Python e.g. plotting/analysis. If the make fails because of a missing numpy header file you should add the --disable-numpy option.--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.

The --help option to configure can be used to what other options are possible, though see the grib_api website for more detailed documentation.

The --enable-python option enables the python interface and is optional but might be useful if you intend to use/write software to access the GRIB output files. If the make fails because of a missing numpy header file you should add the --disable-numpy option.

Choice of compiler and options

...

Code Block
CC=icc FC=ifort  \
CFLAGS="-O" FCFLAGS="-O2 -fp-model precise"  \
./configure --prefix=$(pwd)/myinstall --enable-pthread --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-pthread --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.

...