Closed DJDavies2 closed 1 year ago
Hi @DJDavies2 , I don't have the same problem:
-- [atlas-orca] (0.1.1) [9e96b12]
-- Feature TESTS enabled
-- Feature INSTALL_ORCA_DATA enabled
-- FindNetCDF defines targets:
-- - NetCDF::NetCDF_C [/opt/homebrew/lib/libnetcdf.dylib]
-- - NetCDF::NetCDF_CXX [/opt/homebrew/lib/libnetcdf-cxx4.dylib]
-- atlas-orca FOUND NetCDF (found version "4.9.2")
-- Found package NetCDF required for feature NETCDF
-- Feature NETCDF enabled
ecbuild_find_package
will print the NETCDF_LIBRARIES only if it is defined.
The ecbuild-provided FindNetCDF.cmake will not define this variable.
Furthermore this variable is never used as the executable that links with NetCDF uses the NetCDF::NetCDF_CXX target, which in your case seems correct.
My hunch is that you are using a different (or older?) "FindNetCDF.cmake" somehow?
Yes, it is possible that this is due to a different FindNetCDF.cmake, I will investigate and confirm.
So what is happening is that a) a different FindNetCDF.cmake is being used (from jedi-cmake) and also this is being used in a bundle where the NetCDF library has already been detected prior to atlas-orca. I shall have to think of something else.
What happened?
Things seem to be working for me, but doing incremental builds of atlas-orca results in the NETCDF_LIBRARIES cmake variable being appended, and so it keeps growing with each incremental build. The builds still work, but it would be nice if it didn't happen.
What are the steps to reproduce the bug?
atlas-orca is included in a bundle, the bundle isn't public unfortunately.
There is a find_package( NetCDF REQUIRED COMPONENTS C CXX Fortran ) in the bundle CMakelists.txt, I don't know if that makes a difference?
Version
develop
Platform (OS and architecture)
Cray
Relevant log output
Accompanying data
No response
Organisation
Met Office