How to enable JPG feature in ecCodes on MacOS

kanpiaoxue 2019-09-06

Grid point fields in some grib files are encoded into the JPEG 2000 code. To process these fields with eccodes, you need to enable the JPG feature. On MacOS, there are some details should be showed.

According to the wiki page about ecCodes installation, ecCodes uses CMake for compilation and installation. If you wish to enable JPG feature of ecCodes, you are advised to configure the build with:

cmake -DENABLE_JPG=ON ...

This option of cmake should look for Jasper or OpenJPG. Install openjpeg package with Homebrew for MacOS:

brew install openjpeg

openjpeg has been installed at /usr/local/Cellar/openjpeg/2.3.1.

Then we need to make cmake recognize the installed openjpeg.

cmake -DENABLE_JPG=ON -DOPENJPEG_INCLUDE_DIR=/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3

In the printed debug information, you will see:

-- The following OPTIONAL packages have been found:

 * Git
 * HDF5
 * NumPy
 * CMath
 * JPEG
 * OpenJPEG

You have enabled JPG feature successfully.

相关推荐

超算小站 / 0评论 2019-10-24

TimelessFaith / 0评论 2017-06-29