Numerical solution of the generalized Kadomtsev-Petviashvili equations with compact finite difference schemes