wgrib2模块编译报Could NOT find JPEG和Could NOT find Jasper错

问题现象描述

NCEPLIBS构建安装中wgrib2模块报Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)和Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES)错,详细信息如下:

关键过程、根本原因分析

无。

结论、解决方案及效果

相应文件中未添加JASPER和JPEG的安装路径。

  1. 修改“CMakeCache.txt”文件。

    1. 打开“CMakeCache.txt”文件。
      vi /path/to/NCEPLIBS/NCEPLIBS-1.2.0/build/wgrib2/src/wgrib2-build/CMakeCache.txt
    2. 按“i”进入编辑模式,添加JASPER和JPEG的安装路径。
      //Path to a file.
      JASPER_INCLUDE_DIR:PATH=/path/to/JASPER/include/
      //Path to a library.
      JASPER_LIBRARY_DEBUG:FILEPATH=/path/to/JASPER/lib/
      //Path to a library.
      JASPER_LIBRARY_RELEASE:FILEPATH=/path/to/JASPER/lib/libjasper.so
      
      //Path to a file.
      JPEG_INCLUDE_DIR:PATH=/path/to/JPEG/include
      //Path to a library.
      JPEG_LIBRARY_DEBUG:FILEPATH=/path/to/JPEG/lib
      //Path to a library.
      JPEG_LIBRARY_RELEASE:FILEPATH=JPEG_LIBRARY_RELEASE-NOTFOUND
    3. 修改后按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。

  2. 重新编译。

    make