Skip to content

Conversation

@islas
Copy link
Collaborator

@islas islas commented Jan 27, 2025

TYPE: enhancement

KEYWORDS: cmake, netcdf, netcdf-fortran, nf-config

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
As nf-config does not provide an equivalent --libdir output we must derive the info ourselves. --flibs provided the info previously, but it may be more practical to use the --prefix output and search suspected suffixes instead as --flibs contains other libraries' link info.

Solution:
Use output of --prefix from nf-config as the primary source of library dir. To handle the cases where --prefix is empty, we still fall back to --flibs and if that proves insufficient then the as a last resort one directory above the include directory can be used as a substitute for the prefix.

TESTS CONDUCTED:

  1. Tested with netCDF-Fortran v4.6.2, modifying nf-config to emulate fallback if clauses

RELEASE NOTE: Better nf-config libdir detection in CMake build

As nf-config does not provide an equivalent --libdir output we must
derive the info ourselves. --flibs provided the info previously, but it
may be more practical to use the --prefix output and search suspected
suffixes instead as --flibs contains other libraries' link info. To
handle the cases where --prefix is empty, we still fall back to --flibs
and if that proves insufficient then the as a last resort one directory
above the include directory can be used as a substitute for the prefix.
@islas islas requested a review from a team as a code owner January 27, 2025 21:53
@islas islas requested review from abishekg7 and amstokely November 14, 2025 19:09
Copy link
Collaborator

@abishekg7 abishekg7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good and check that it configures + builds on Eris.

@islas islas requested review from dudhia and weiwangncar December 1, 2025 19:37
@islas islas requested review from mgduda and removed request for weiwangncar December 16, 2025 19:13
@islas
Copy link
Collaborator Author

islas commented Dec 16, 2025

When you can, @mgduda could you review this PR for secondary approval?

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.

4 participants