NCAR / ParallelIO

A high-level Parallel I/O Library for structured grid applications
Apache License 2.0
134 stars 52 forks source link

Use PkgConfig as a fallback for finding `NetCDF` #1940

Closed kieranricardo closed 1 year ago

kieranricardo commented 1 year ago

Hi there,

I had some trouble installing ParallelIO on the HPC system I'm on, and I was able fix it by replacing

https://github.com/NCAR/ParallelIO/blob/157e559ffd3dcd3db69102dc19f56fa422e795fe/CMakeLists.txt#L259

with

  find_package (NetCDF COMPONENTS C Fortran)
  if (NOT NetCDF_Fortran_FOUND)
    include(FindPkgConfig)
    pkg_check_modules(NetCDF_Fortran REQUIRED IMPORTED_TARGET "netcdf-fortran")
  endif()

It's a non breaking change that'll make ParallelIO more portable so I thought I'd see if there'd be interest in adding this in.

jedwards4b commented 1 year ago

Sure, A PR would be welcome.