Write pgid.c and compile