Skip to content

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

Open
MHBalsmeier wants to merge 1 commit into
wrf-model:developfrom
MHBalsmeier:cmake_netcdf_fix
Open

CMake build: Add lib/CMAKE_LIBRARY_ARCHITECTURE to PATH_SUFFIXES to restore multiarch detection.#2350
MHBalsmeier wants to merge 1 commit into
wrf-model:developfrom
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
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.

1 participant