Skip to content

CMake build: Add lib/CMAKE_LIBRARY_ARCHITECTURE to PATH_SUFFIXES to restore multiarch detection. - #2350

Merged
islas merged 2 commits into
wrf-model:release-v4.8.1from
MHBalsmeier:cmake_netcdf_fix
Sep 9, 2026
Merged

islas merged 2 commits into
wrf-model:release-v4.8.1from
MHBalsmeier:cmake_netcdf_fix

Conversation

@MHBalsmeier

Copy link
Copy Markdown
Contributor

CMake: Add lib/${CMAKE_LIBRARY_ARCHITECTURE}/ to PATH_SUFFIXES to restore multiarch detection.

TYPE: bug fix

KEYWORDS: CMake, Ubuntu, architecture, build, Netcdf

SOURCE: Max H. Balsmeier

DESCRIPTION OF CHANGES:
Problem:
PR #2161 switched netCDF-Fortran library detection to use nf-config --prefix plus lib/ and lib64/ suffixes. On Debian/Ubuntu multiarch systems libnetcdff.so lives in /lib// (e.g. /usr/lib/x86_64-linux-gnu/), so find_library fails with Could NOT find netCDF-Fortran (missing: netCDF-Fortran_LIBRARY) even though netCDF-Fortran is correctly installed.

Solution:
Add lib/${CMAKE_LIBRARY_ARCHITECTURE}/ to PATH_SUFFIXES.

LIST OF MODIFIED FILES: cmake/modules/FindnetCDF-Fortran.cmake

TESTS CONDUCTED:

  1. With this fix, I am able to compile the model with CMake on Ubuntu again.
  2. Are the Jenkins tests all passing?

RELEASE NOTE: Restored multiarch detection of Netcdf library in CMake builds.

@MHBalsmeier
MHBalsmeier requested a review from a team as a code owner June 8, 2026 23:43
@islas
islas changed the base branch from develop to release-v4.8.1 September 3, 2026 20:26

@islas islas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Thank you for fixing this!

@islas
islas merged commit 341f5fe into wrf-model:release-v4.8.1 Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants