The top dimensional cohomology of a connected manifold is non-zero if and only if the manifold is compact, so the answer is "yes" for homology spheres.