Closed climbfuji closed 4 years ago
So, what's the problem? Using MPI_Compiler doesn't work for wgrib2 but works for the other libraries?
So, what's the problem? Using MPI_Compiler doesn't work for wgrib2 but works for the other libraries?
I am just recording this as an issue so that one of us remembers and makes the update to the NCEPLIBS-wgrib2 CMakeLists.txt. Should be straightforward.
I see now, the same thing applies to UFS_UTILS. I the best solution would be to update FindNetCDF to detect if it's parallel and needs to link to MPI. Otherwise, you have to manually link to MPI every time you link to NetCDF.
Thoughts @aerorahul
Is FindNetCDF smart enough to find out if it's parallel and MPI is required?
In nc-config
, there's --has-parallel
which I think is what we want, and then run find_package(MPI) from there if that is true.
FindNetCDF reports that info.
Don't remember the details, but something like NETCDF_PARALLEL
I am using tag v2.0.8-cmake-v1.0.3 of NCEPLIBS-wgrib2 as part of the NCEPLIBS umbrella build (develop branch). Recently I changed the NCEPLIBS-external build to build HDF5 and netCDF with parallel I/O support. This requires using
${MPI_C_Compiler}
instead of${CMAKE_C_Compiler}
for compiling libraries or applications that link against this version of netCDF (same forCXX
,Fortran
). This works fine for all other NCEPLIBS-* that are shipped with the NCEPLIBS umbrella build, but not for wgrib2.I therefore temporarily turned off building NCEPLIBS-wgrib2 as part of the NCEPLIBS umbrella build (it is currently built as part of NCEPLIBS-external anyway).