I get this error trying to build petsc-dev with cusp:

petsc-dev/include/../src/vec/vec/utils/vpscat.h(41): error: identifier "n" is undefined
    if (!n || ((xin->map->n > 10000) && (sstarts[nsends]*bs < 0.05*xin->map->n) && (xin->valid_GPU_array == PETSC_CUSP_GPU) && !(to->local.n))) {
         ^

Thanks,
John