Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoconf: netCDF flag fixes #1255

Merged
merged 2 commits into from
Nov 30, 2020
Merged

Conversation

marshallward
Copy link
Collaborator

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 LDFLAGS
and 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.

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 LDFLAGS
and 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.
@codecov-io
Copy link

codecov-io commented Nov 23, 2020

Codecov Report

Merging #1255 (5f05737) into dev/gfdl (e27cc0c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           dev/gfdl    #1255   +/-   ##
=========================================
  Coverage     46.03%   46.03%           
=========================================
  Files           224      224           
  Lines         70921    70921           
=========================================
  Hits          32648    32648           
  Misses        38273    38273           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e27cc0c...5f05737. Read the comment docs.

@adcroft adcroft merged commit 70382ed into mom-ocean:dev/gfdl Nov 30, 2020
@marshallward marshallward deleted the ac_ncflag_fix branch January 18, 2021 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants