File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 292292 & - patch_icpp(1 )%x_centroid)** 2.0 - (y_cc(j) - patch_icpp(1 )%y_centroid)** 2.0 )))** 1.4
293293 q_prim_vf(eqn_idx%mom%beg + 0 )%sf(i, j, &
294294 & 0 ) = patch_icpp(1 )%vel(1 ) + (y_cc(j) - patch_icpp(1 )%y_centroid)* (5.0 / (2.0 * pi))* exp (1.0 * (1.0 - (x_cc(i) &
295- & - patch_icpp(1 ) %x_centroid)** 2.0 - (y_cc(j) - patch_icpp(1 )%y_centroid)** 2.0 ))
295+ & - patch_icpp(1 )%x_centroid)** 2.0 - (y_cc(j) - patch_icpp(1 )%y_centroid)** 2.0 ))
296296 q_prim_vf(eqn_idx%mom%beg + 1 )%sf(i, j, &
297297 & 0 ) = patch_icpp(1 )%vel(2 ) - (x_cc(i) - patch_icpp(1 )%x_centroid)* (5.0 / (2.0 * pi))* exp (1.0 * (1.0 - (x_cc(i) &
298- & - patch_icpp(1 ) %x_centroid)** 2.0 - (y_cc(j) - patch_icpp(1 )%y_centroid)** 2.0 ))
298+ & - patch_icpp(1 )%x_centroid)** 2.0 - (y_cc(j) - patch_icpp(1 )%y_centroid)** 2.0 ))
299299 end if
300300 case (281 ) ! Acoustic pulse
301301 ! This is patch is hard- coded for test suite optimization used in the 2D_acoustic_pulse case: This analytic patch uses
Original file line number Diff line number Diff line change @@ -408,3 +408,20 @@ if ! cmp "$(pwd)/toolchain/pyproject.toml" "$(pwd)/build/pyproject.toml" > /dev/
408408
409409 fi # end of USE_UV=0 (pip) block
410410fi
411+
412+
413+ # Apply patches to installed packages.
414+ # fypp: always emit a resync linemarker after single-line $: macro calls so
415+ # that the compiler attributes the following Fortran statement to the correct
416+ # source line rather than the call-site line (off-by-1 in backtraces).
417+ FYPP_PY=" $( python3 -c " import fypp; print(fypp.__file__)" 2> /dev/null) "
418+ FYPP_PATCH=" $( pwd) /toolchain/patches/fypp-linemarker-resync.patch"
419+ if [ -n " $FYPP_PY " ] && [ -f " $FYPP_PATCH " ]; then
420+ if ! grep -q " Always emit a resync marker" " $FYPP_PY " 2> /dev/null; then
421+ if patch -p1 --forward --silent " $FYPP_PY " < " $FYPP_PATCH " 2> /dev/null; then
422+ ok " (venv) Applied$MAGENTA fypp$COLOR_RESET linemarker-resync patch."
423+ else
424+ warn " (venv) Failed to apply$MAGENTA fypp$COLOR_RESET linemarker-resync patch (fypp version may have changed)."
425+ fi
426+ fi
427+ fi
Original file line number Diff line number Diff line change 1+ --- a/fypp.py
2+ +++ b/fypp.py
3+ @@ -1842,11 +1842,16 @@ class _Renderer:
4+ if self._linenums:
5+ # Last line was folded, but no linenums were generated for
6+ # the continuation lines -> current line position is not
7+ # in sync with the one calculated from the last line number
8+ unsync = (
9+ len(foldedlines) and len(foldedlines[-1]) > 1
10+ and not self._contlinenums)
11+ # Eval directive in source consists of more than one line
12+ multiline = span[1] - span[0] > 1
13+ - if unsync or multiline:
14+ + # Always emit a resync marker after a $: call. Without this,
15+ + # single-line $: calls that expand to multi-line #if/#endif
16+ + # blocks (e.g. GPU_PARALLEL_LOOP) cause the compiler to
17+ + # attribute the next Fortran statement to the call-site line
18+ + # rather than the following source line, producing off-by-1
19+ + # errors in backtraces and debugger line info.
20+ + if unsync or multiline or True:
21+ # For inline eval directives span[0] == span[1]
22+ # -> next line is span[0] + 1 and not span[1] as for
23+ # line eval directives
24+ nextline = max(span[1], span[0] + 1)
25+ trailing += self._linenumdir(nextline, fname)
You can’t perform that action at this time.
0 commit comments