Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Autoconf netCDF flag configuration was broken due to using nc-config for
Fortran flags, and assuming that C and Fortran files (modules,
libraries, etc) were installed in the same directory.
This patch replaces the lower level --includedir and --libdir flags with
the higher level --fflags and --flibs flags, which provide more
processed Fortran output.
One significant issue here is that --flibs combines the directory (-L)
and library (-l) flags into a single output, even though these should be
split when passed to
ld
, with autoconf passing the former to LDFLAGSand the latter to LIBS.
We resolve this by stripping the -l flags (via sed) and pass the
remaining flags (almost always -L) to LDFLAGS. We rely on autoconf
macros to assign the -l flags to LIBS.
This should resolve issues where nc-fortran and nf-fortran are installed
in separate directories. This was detected in a spack-based
environment, where this would be commonplace.