Closed mathomp4 closed 3 months ago
Change requested broke the UFS build
ld: cannot find -lesmf
make[5]: *** [sorc/sfc_climo_gen.fd/CMakeFiles/sfc_climo_gen.dir/build.make:101: sorc/sfc_climo_gen.fd/sfc_climo_gen] Error 1
make[4]: *** [CMakeFiles/Makefile2:1401: sorc/sfc_climo_gen.fd/CMakeFiles/sfc_climo_gen.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
Change requested broke the UFS build
ld: cannot find -lesmf make[5]: *** [sorc/sfc_climo_gen.fd/CMakeFiles/sfc_climo_gen.dir/build.make:101: sorc/sfc_climo_gen.fd/sfc_climo_gen] Error 1 make[4]: *** [CMakeFiles/Makefile2:1401: sorc/sfc_climo_gen.fd/CMakeFiles/sfc_climo_gen.dir/all] Error 2 make[4]: *** Waiting for unfinished jobs....
Well, huh. We might need to ask @AlexanderRichert-NOAA for some advice and help...
I'm testing some more scenarios. Not every FindESMF.cmake file within the ufs-weather-model was consistent. It's possible that I clobbered a FindESMF.cmake file that was customized for a component. I would like to figure this out before making changes to the default library name of ESMF.
I'm testing some more scenarios. Not every FindESMF.cmake file within the ufs-weather-model was consistent. It's possible that I clobbered a FindESMF.cmake file that was customized for a component. I would like to figure this out before making changes to the default library name of ESMF.
In GEOS one thing I've had to do (locally) is add aliases for esmf
as well. But that was due to a long-ago choice local to us. Maybe UFS will need to move to ESMF::ESMF
internally with this change? I am not sure.
I know from spack testing that if you build with spack, it doesn't seem to matter how many other FindESMF.cmake
files I have around in GEOS, the one from the ESMF install wins!
The issue is related to changing one of these three modules, which are already outdated.
I was able to build the ufs-weather-model with this newer version of the FindESMF module.
Please copy these changes to the following files:
- src/addon/ESMX/Comps/ESMX_Data/cmake/FindESMF.cmake
- src/addon/ESMX/Driver/cmake/FindESMF.cmake
This should be done.
As detailed in #225, our UFS collaborators would like MAPL to provide a
MAPL-targets.cmake
file that usesESMF::ESMF
as the target within. From my testing, this can only seem to work ifESMF::ESMF
is the main target provided byFindESMF.cmake
and not anALIAS
.So this PR does that, it essentially makes
ESMF::ESMF
the target the "main"add_library()
call is run on and then makesESMF
the alias.As far as I can tell, this works. All other needed changes are in GEOS and MAPL.