一、各个包安装下载地址

1. wgrib2 最新版本下载地址

https://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz.v3.1.2

2. cmake 编译好的二进制包下载地址

https://cmake.org/files/v3.15/cmake-3.15.7-Linux-x86_64.tar.gz

3. 安装基本编译环境&依赖库

// gcc-c++

yum install gcc-c++
// 百度安装过程,顺便安装了这些依赖库
yum install zlib
yum install libpng
yum install libjpeg 
yum install gcc-gfortran.x86_64

二、安装过程  

安装wgrib2

1.进入wgrib2解压包里grib2,直接make, 报错

makefile:274: *** ERROR, Need cmake for AEC support, install cmake or set USE_AEC = 0.  Stop.

2.安装cmake,历经下载编译各种失败,于是下载好了编译好的包,下载地址如上, wgrib2要求cmake版本 3.13-3.19

// 进入到包下,找到bin文件,将可运行文件复制到/usr/bin下
cd /opt/cmake-3.15.7-Linux-x86_64/bin/
cp ./cmake /usr/bin/
// 验证可行性
cmake --version # 发现ok

3. 进入grib2里,再make,又报错

mkdir: cannot create directory ‘build’: File exists
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/local/share/cmake-3.15
CMake Error: Error executing cmake::LoadCache(). Aborting.

make[1]: Entering directory `/opt/grib2/libaec-master/build'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory `/opt/grib2/libaec-master/build'
make: *** [/opt/grib2/lib/libaec.a] Error 2
// 缺少CMAKE_ROOT 变量

// 进入cmake的安装目录,到share,找到cmake-3.15,复制到/usr/share下
cp ./cmake-3.15 /usr/share/
export $CMAKE_ROOT=‘/usr/share/cmake-3.15’

// 再次make 成功

 

posted on 2023-05-22 16:13  not-found-404  阅读(567)  评论(0编辑  收藏  举报