Valence full configuration interaction calculations are reported for t
he beryllium dimer using an ANO-type contraction and including up to g
functions. It is shown that very large contracted basis sets are requ
ired in order to obtain a good value of the dissociation energy. The e
lectronic energy curve is repulsive in the bond region if only s and p
orbitals are used, and f and g orbitals account for about one half of
the total dissociation energy. It is also shown that the use of molec
ular orbitals specifically optimized for the dimer can lead to a subst
antial improvement of bond distance and dissociation energy values.