  This work concerns \emph{ab initio} calculations of the complete potential
energy curve and spectroscopic constants for the ground state $X^1\Sigma_g^+$
of the beryllium dimer, Be$_2$. High accuracy and reliability of the results is
one of the primary goals of the paper. To this end we apply large basis sets of
Slater-type orbitals combined with high-level electronic structure methods
including triple and quadruple excitations. The effects of the relativity are
also fully accounted for in the theoretical description. For the first time the
leading-order quantum electrodynamics effects are fully incorporated for a
many-electron molecule. Influence of the finite nuclear mass corrections
(post-Born-Oppenheimer effects) turns out to be completely negligible for this
system. The predicted well-depth ($D_e=934.5\pm2.5\,\mbox{cm}^{-1}$) and the
dissociation energy ($D_0=808.0\,\mbox{cm}^{-1}$) are in a very good agreement
with the most recent experimental data. We confirm the existence of the weakly
bound twelfth vibrational level [Patkowski et al., Science 326, 1382 (2009)]
and predict that it lies just about 0.5 $\mbox{cm}^{-1}$ below the onset of the
continuum.
