git clone https://gitee.com/linruoxuan/g2clib-image.git
cd g2clib-image/ tar -xvf g2clib-1.6.0-patch.tar.gz cd g2clib-1.6.0-patch/
sed -i '22c INC=-I/glade/p/work/haley/dev/external/gnu/4.7.2/include -I/usr/include/jasper' makefile
sed -i '221c bool inmem_;' /usr/include/jasper/jas_image.h
如不使用yum安装的jasper,步骤4应正确指定实际路径下的jasper,如:-I/path/to/jasper/include/jasper。
在其安装目录的include内修改jas_image.h文件(一般高版本默认不需要进行修改),查看显示为如下内容即代表修改完成。
make all mkdir -p /path/to/g2clib/lib mkdir -p /path/to/g2clib/include mv libgrib2c.a /path/to/g2clib/lib cp grib2.h /path/to/g2clib/include
export LD_LIBRARY_PATH=/path/to/g2clib/lib:$LD_LIBRARY_PATH export C_INCLUDE_PATH=/path/to/g2clib/include:$C_INCLUDE_PATH export CXX_INCLUDE_PATH=/path/to/g2clib/include:$CXX_INCLUDE_PATH