我要评分
获取效率
正确性
完整性
易理解

Error "Could NOT find NetCDF (missing: NetCDF_INCLUDE_DIRS)" Reported When Compiling the wgrib2 Module

Symptom

During the NCEPLIBS compilation and installation, the wgrib2 module reports the following error:

Key Process and Cause Analysis

None

Conclusion and Solution

The NetCDF installation path is not added to the used file.

  1. Modify the CMakeCache.txt file.
    1. Open the CMakeCache.txt file.
      vi /path/to/NCEPLIBS/NCEPLIBS-1.2.0/build/wgrib2/src/wgrib2-build/CMakeCache.txt
    2. Press i to enter the edit mode and modify the file as follows:
      //NetCDF Include directory paths
      NetCDF_INCLUDE_DIRS:STRING=/path/to/NETCDF/include
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  2. Perform the compilation again.
    make