What are the prerequisite for generating 64 bit binary after code compilation on a 64 bit server

According to this article the OS-included compiler is only good for recompiling the kernel.
You must install/use a different compiler, either one from HP/Intel (certainly for some $$) or the free gcc.
gcc can be downloaded from the HP-UX Porting and Archive Center. See our HP-UX links