From c9527c6a09f57f9d19202ff3f2a09a09a4d02cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 2 Oct 2024 19:54:58 +0200 Subject: [PATCH] Fix linking order of netCDF libraries. The netCDF Fortran library depends on the netCDF library. For some linkers (e.g., ld.bfd), the linking order matters. Make sure to have the netCDF Fortran library *before* the netCDF library in the linker flags. --- cmake/Modules/FindNETCDF.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/FindNETCDF.cmake b/cmake/Modules/FindNETCDF.cmake index 4c583f49a0..e839448f88 100644 --- a/cmake/Modules/FindNETCDF.cmake +++ b/cmake/Modules/FindNETCDF.cmake @@ -64,7 +64,7 @@ IF (NETCDF_INCLUDE_DIR AND NETCDF_LIBRARY AND NETCDFF_LIBRARY) UNSET(NETCDF_FAILMSG) SET(NETCDFLIB_FOUND TRUE) SET(NETCDF_INCLUDE_DIR ${NETCDF_INCLUDE_DIR}) - SET(NETCDF_LIBRARIES "${NETCDF_LIBRARY};${NETCDFF_LIBRARY}") + SET(NETCDF_LIBRARIES "${NETCDFF_LIBRARY};${NETCDF_LIBRARY}") ELSE() SET(NETCDF_FAILMSG "NETCDF libraries not found.") ENDIF()