geoschem / geos-chem

GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
http://geos-chem.org
Other
164 stars 157 forks source link

Technical Inquiry: Issue Encountered While Running CMake Command #2446

Open ChenBHXMU opened 1 week ago

ChenBHXMU commented 1 week ago

Your name

Baihua Chen

Your affiliation

Xiamen University

Please provide a clear and concise description of your question or discussion topic.

Dear @yantosca

I hope this message finds you well.

When I run the command cmake ../CodeDir -DRUNDIR=.., I encounter the following problem, but I am not sure how to solve this problem.

Thank you for your time and assistance.

Best regards, Baihua Chen

cmake ../CodeDir -DRUNDIR=..
-- The Fortran compiler identification is GNU 11.4.1
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/f95 - skipped

GCClassic 14.4.3 (superproject wrapper)
Current status: 14.4.3

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):

  Counldn't find one or more of NetCDF's files! The following
  files/directories weren't found:

      NETCDF_F_LIBRARY: Path to "libnetcdff.so"
      NETCDF_C_LIBRARY: Path to "libnetcdf.so"
      NETCDF_C_INCLUDE_DIR: Directory containing "netcdf.h"
      NETCDF_F90_INCLUDE_DIR: Directory containing "netcdf.mod"
      NETCDF_F77_INCLUDE_DIR: Directory containing "netcdf.inc"

  Find the directories/files that are listed above.  Specify the directories
  you want CMake to search with the CMAKE_PREFIX_PATH variable (or the
  NetCDF_ROOT environment variable).

   (missing: NETCDF_F_LIBRARY NETCDF_C_LIBRARY NETCDF_C_INCLUDE_DIR NETCDF_F90_INCLUDE_DIR NETCDF_F77_INCLUDE_DIR) 
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  CMakeScripts/FindNetCDF.cmake:138 (find_package_handle_standard_args)
  CMakeLists.txt:170 (find_package)
yantosca commented 1 week ago

Thanks for writing @ChenBHXMU. CMake could not find your netCDF and netCDF-Fortran libraries. Do you know if you have the netCDF libraries installed as software modules (i.e. loadable with module load ...)? Or are they directly installed in a path such as /usr/lib/...? If you can ask someone at your institution to clarify that, then we can figure out how to proceed.

Also see the following chapters of our ReadTheDocs for more information about software libraries:

ChenBHXMU commented 1 week ago

Dear @yantosca

If you can figure out how to proceed, I think I can solve it.

Thank you for your time and assistance.

Best regards, Baihua Chen

yantosca commented 1 week ago

@ChenBHXMU: You would need to locate the path to the netCDF libraries on your system. Or if you don't have them, to build them with Spack as described in our installation guide: