Fix intermittent parallel build failure in lib/libnfu#406
Open
underwoo wants to merge 2 commits into
Open
Conversation
Under make -j, make scheduled two independent jobs that both compiled libnfu/nfu.F90: the .F90.o rule (producing nfu.o for libnfu.a) and the .F90.$(FC_MODEXT) suffix rule (producing nfu_mod.mod for nfu_compress.o's prerequisite). Because AM_FCFLAGS uses $(FC_MODOUT)$(@d), both gfortran processes wrote to the same libnfu/nfu_mod.mod0 temp file and raced to rename it, causing the intermittent error: f951: Fatal Error: Cannot rename module file 'libnfu/nfu_mod.mod0' to 'libnfu/nfu_mod.mod': No such file or directory Fix by adding an explicit no-op rule in lib/libnfu/local.mk: libnfu/nfu_mod.$(FC_MODEXT): libnfu/nfu.$(OBJEXT) @: This overrides the .F90.$(FC_MODEXT) suffix rule so nfu.F90 is compiled only once. nfu_mod.mod is treated as a side effect of building nfu.o, and nfu_compress.o waits for it via the existing prerequisite. Also replace the duplicate clean-local rule in local.mk (which produced a make warning) with CLEANFILES += entries, and add CLEANFILES = in lib/Makefile.am to initialise the variable before local.mk uses +=. Fix a typo in tools/simple_hydrog/lakes/Makefile.am: the prerequisite horiz_intrep.$(OBJEXT) did not match any source file; corrected to horiz_interp.$(OBJEXT). Closes: NOAA-GFDL#405
The Fortran compiler writes .mod files into .mods/ subdirectories (src/.mods/, src/plevel/.mods/) but clean-local never removed those directories, causing distcleancheck to report leftover files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ilaflott
reviewed
Jun 11, 2026
Member
|
i always find the CI here slippery because the branch/fork label doesn't get associated to the next jobs triggered, so making sure i'm viewing the right the latest commit triggered FRE-NCTools CI --> ✅ that triggers FRE-NCTools Check Expensive --> ✅ that triggered... this good run of |
This was referenced Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under make -j, make scheduled two independent jobs that both compiled$(FC_MODOUT)$ (@d),
libnfu/nfu.F90: the .F90.o rule (producing nfu.o for libnfu.a) and the
.F90.$(FC_MODEXT) suffix rule (producing nfu_mod.mod for
nfu_compress.o's prerequisite). Because AM_FCFLAGS uses
both gfortran processes wrote to the same libnfu/nfu_mod.mod0 temp file
and raced to rename it, causing the intermittent error:
Fix by adding an explicit no-op rule in lib/libnfu/local.mk:
This overrides the .F90.$(FC_MODEXT) suffix rule so nfu.F90 is compiled
only once. nfu_mod.mod is treated as a side effect of building nfu.o,
and nfu_compress.o waits for it via the existing prerequisite.
Also replace the duplicate clean-local rule in local.mk (which produced
a make warning) with CLEANFILES += entries, and add CLEANFILES = in
lib/Makefile.am to initialise the variable before local.mk uses +=.
Fix a typo in tools/simple_hydrog/lakes/Makefile.am: the prerequisite
horiz_intrep.$(OBJEXT) did not match any source file; corrected to
horiz_interp.$(OBJEXT).
Closes: #405
Description
Include a summary of the change and which issue is fixed. Please also include
relevant motivation and context. List any dependencies that are required for
this change.
Fixes # (issue)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note
any relevant details for your test configuration (e.g. compiler, OS). Include
enough information so someone can reproduce your tests.
Checklist:
make distcheckpasses