When do real analytic functions form a coherent sheaf? It is known that, in general, the sheaf of real analytic functions on a real analytic manifold is not coherent. However, there are some examples, where we have coherence: for example, if $X$ is a complex analytic manifold, then the sheaf of real analytic functions $A^{\omega}_X$ is the restriction to the diagonal of 
the sheaf $\mathcal O_{X \times \bar X}$ of complex analytic functions on the product of $X$ and its complex conjugate $\bar X$, so $A^{\omega}_X$ is coherent.
Are there other examples of real analytic manifolds for which we can prove the coherence of the structure sheaf? 
I am especially interested in the case where $X$ has the metric with special holonomy, for example, when it is a $G_2$ manifold.
 A: For real-analytic manifolds, coherence of the structure sheaf always holds. The 1-sentence reason is that one can pass to real and imaginary parts on Oka's coherence theorem in several complex variables.  
Before discussing a proper proof of that 1-sentence executive summary, I should address that in the real-analytic setting however an analogue of one of Oka's "coherence" results over $\mathbf{C}$ can fail (leading one to see phrases in the literature such as "non-coherent real-analytic spaces"):  there is no real counterpart to the "analytic Nullstellensatz" of Oka. To explain this, recall Oka's result that for a complex-analytic set $X$ in a complex manifold $V$ (i.e., a closed subset that is locally on $V$ given by the vanishing of finitely many holomorphic functions) the ideal sheaf of sections of $O_V$ vanishing on $X$ is always locally finitely generated (or equivalently a coherent $O_V$-module, since $O_V$ is coherent by Oka's big theorem).  But this fails in the real-analytic case. In contrast, there exist real-analytic sets $Z$ in real-analytic manifolds $U$ (i.e., a closed subset that is locally on $U$ given by the vanishing of finitely many real-analytic functions) such that the ideal sheaf $I_Z$ of sections of $O_U$ vanishing on $Z$ is not locally finitely generated; such a $Z$ is called "non-coherent" in $U$ (because in such cases the subsheaf $A = O_U/I_Z$ of the sheaf of $\mathbf{R}$-valued continuous functions on $Z$ can fail to be a coherent sheaf of rings, though I have never cared enough to check up on a proof of this consequence in some cases).  An explicit example of $Z$ and $U$ with $I_Z$ not coherent inside $O_U$ is given near the start of https://arxiv.org/pdf/math/0612829.pdf.
To be more detailed about the proof of coherence of the structure sheaf of a real-analytic manifold, the assertion is of local nature and so only depends on the (local) dimension; i.e., for manifolds of (pure) dimension $n$ it is equivalent to showing that the sheaf $O_U$ of real-analytic functions on every small open ball $U$ around the origin in $\mathbf{R}^n$ is coherent.  By definition, this coherence amounts to local finite generation for the kernel of any $O_U$-linear map $\varphi:O_U^{\oplus N} \rightarrow O_U$ for any small $U$.  This map locally "extends" over an open in $\mathbf{C}^n$; i.e., by working locally on $U$ we can arrange that that exists an open $V \subset \mathbf{C}^n$ satisfying $V \cap \mathbf{R}^n = U$ and holomorphic $F_1, \dots, F_N$ on $V$ whose restriction to $U$ recovers the $N$ components $f_1, \dots, f_N$ of $\varphi$. 
By Oka's big coherence theorem (not the analytic Nullstellensatz above), the resulting map $\Phi: O_V^{\oplus N} \rightarrow O_V$ extending $\varphi$ has kernel that is locally finitely generated.  Working locally on $V$ around points of $U$, we can thereby arrange that there exist $s_1, \dots, s_r \in O(V)^{\oplus N}$ generating $\ker \Phi$.  We claim that the real and imaginary parts of the restrictions to $U$ of these $N$-tuples belong to $\ker \varphi$ and generate it.
Our problem is local on $V$ near $U$, so for generation we can focus on
$(g_1,\dots,g_N) \in (\ker \varphi)(U)$. By working locally on $V$ around a point in $U$ we can arrange that $V$ is connected and that each $g_j$ extends (necessarily uniquely) to a holomorphic $G_j$ on $V$.  Then the global section $\sum G_j F_j \in O(V)$ has restriction to $U$ equal to $\sum g_j f_j = \varphi(g_1,\dots,g_N)=0$, so $\Phi(G_1,\dots,G_N)=\sum G_j F_j = 0$ by connectedness of $V$ and analyticity considerations.  Thus, working locally on $V$ some more we can arrange that $(G_1,\dots,G_N) = \sum_{k=1}^r a_k s_k$ for some $a_{1}, \dots, a_{r} \in O(V)$, so restricting to $U$ gives
$$(g_1,\dots,g_N) = \sum_{k=1}^r a_{k}|_U \cdot s_k|_U.$$
Each function $g_j$ is $\mathbf{R}$-valued, whereas $a_{k}|_U$ and the $N$ components of $s_k|_U$ are $\mathbf{C}$-valued, and the real and imaginary parts of these various $\mathbf{C}$-valued functions are real-analytic on $U$.  Thus, 
$$(g_1,\dots,g_N) = \sum_{k=1}^r ({\rm{Re}}(a_{k}|_U){\rm{Re}}(s_k|_U) - 
{\rm{Im}}(a_{jk}|_U) {\rm{Im}}(s_k|_U)).$$
Finally, the condition $s_k \in (\ker \Phi)(V) \subset O(V)^{\oplus N}$ says that the $N$ components $s_{k1},\dots,s_{kN} \in O(V)$ satisfy $\sum F_j s_{kj} = 0$, so $\sum f_j \cdot s_{kj}|_U = 0$ as $\mathbf{C}$-valued functions on $U$.  But each $f_j$ is $\mathbf{R}$-valued, so
$\sum f_j {\rm{Re}}(s_{kj}|_U)$ and $\sum f_j {\rm{Im}}(s_{kj}|_U)$ both vanish on $U$; i.e., ${\rm{Re}}(s_k|_U)$ and ${\rm{Im}}(s_k|_U)$ belong to $(\ker \varphi)(U)$. Thus, ${\rm{Re}}(s_1|_U), \dots, {\rm{Re}}(s_r|_U), {\rm{Im}}(s_1|_U), \dots, {\rm{Im}}(s_r|_U)$ generate $\ker \varphi$ over the (now shrunken) $U$. This shows that in the initial setup (before we began shrinking $U$) the kernel of $\varphi$ is locally finitely generated. 
