Hi Vani,
I think some more information really could be helpful. Beeing no solaris monk myself, I think some more general things are still required to be known before anyone can make more than a strong guess regarding your issue:
Which hardware platform do you use?
Could the available amount of memory (RAM) become an issue?
When the compile hangs, how does that manifest?
Are there any error messages or warnings in the compile logs? Please show them if so.