  Integrality in the Hodge theory of Calabi-Yau fourfolds is essential to find
the vacuum structure and the anomaly cancellation mechanism of four dimensional
F-theory compactifications. We use the Griffiths-Frobenius geometry and
homological mirror symmetry to fix the integral monodromy basis in the
primitive horizontal subspace of Calabi-Yau fourfolds. The Gamma class and
supersymmetric localization calculations in the 2d gauged linear sigma model on
the hemisphere are used to check and extend this method. The result allows us
to study the superpotential and the Weil-Petersson metric and an associated tt*
structure over the full complex moduli space of compact fourfolds for the first
time. We show that integral fluxes can drive the theory to N=1 supersymmetric
vacua at orbifold points and argue that fluxes can be chosen that fix the
complex moduli of F-theory compactifications at gauge enhancements including
such with U(1) factors. Given the mechanism it is natural to start with the
most generic complex structure families of elliptic Calabi-Yau 4-fold
fibrations over a given base. We classify these families in toric ambient
spaces and among them the ones with heterotic duals. The method also applies to
the creating of matter and Yukawa structures in F-theory. We construct two
SU(5) models in F-theory with a Yukawa point that have a point on the base with
an $E_8$-type singularity on the fiber and explore their embeddings in the
global models. The explicit resolution of the singularity introduce a higher
dimensional fiber and leads to novel features.
