NOAA-EMC / NCEPLIBS

Top level repo containing submodules for NCEPLIBS and associated dependencies for superproject builds
Other
43 stars 18 forks source link

Cannot find NetCDF #188

Closed afernandezody closed 3 years ago

afernandezody commented 3 years ago

Hello, The NCEPLIBS installation is not finding netCDF:

[ 28%] Performing configure step for 'w3emc'
-- Found bacio: /opt/praetorium/NCEP/bacio-2.4.1/lib/libbacio_4.a (found version "2.4.0")
-- Found w3nco: /opt/praetorium/NCEP/w3nco-2.4.1/lib/libw3nco_4.a (found version "2.4.0")
-- Found nemsio: /opt/praetorium/NCEP/nemsio-2.5.2/lib/libnemsio.a (found version "2.5.1")
-- Found sigio: /opt/praetorium/NCEP/sigio-2.3.2/lib/libsigio.a (found version "2.3.0")
CMake Error at CMakeModules/Modules/FindNetCDF.cmake:225 (message):
  Unable to properly find NetCDF.  Found static libraries at:
  /opt/praetorium/NCEPLIBS/download/nceplibs-w3emc/NetCDF_C_LIBRARY-NOTFOUND
  but could not run nc-config:
Call Stack (most recent call first):
  CMakeLists.txt:29 (find_package)

CMake Error at CMakeModules/Modules/FindNetCDF.cmake:225 (message):
  Unable to properly find NetCDF.  Found static libraries at:
  /opt/praetorium/NCEPLIBS/download/nceplibs-w3emc/NetCDF_Fortran_LIBRARY-NOTFOUND
  but could not run nc-config:
Call Stack (most recent call first):
  CMakeLists.txt:29 (find_package)

CMake Error at /usr/local/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find NetCDF (missing: NetCDF_INCLUDE_DIRS NetCDF_LIBRARIES
  Fortran)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  CMakeModules/Modules/FindNetCDF.cmake:291 (find_package_handle_standard_args)
  CMakeLists.txt:29 (find_package)

-- Configuring incomplete, errors occurred!

The command nc-config is up and running (netCDF 4.8.0-development). I have tried to declare the netCDF lib(rary) and include paths as either cmake variables or regular environmental variables, but maybe I'm just not using the right names. Thanks.

edwardhartnett commented 3 years ago

Did you set CMAKE_PREFIX_PATH to include the netCDF install directory?

afernandezody commented 3 years ago

It seems that that was the missing piece. Thank you!