Learning Globally Smooth Functions on Manifolds