一、各個包安裝下載地址
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 變量
4. 缺少CMAKE_ROOT變量
解決辦法: 進入cmake的安裝目錄,到share,找到cmake-3.15,復制到/usr/share下 cp ./cmake-3.15 /usr/share/ export $CMAKE_ROOT=‘/usr/share/cmake-3.15’ 再次make 成功
本文來自博客園,作者:not-found-404,轉載請注明原文鏈接:http://www.rzrgm.cn/lxp5/p/17420936.html
浙公網安備 33010602011771號