First compile time slow down on Linux

Problem : The first time the compiler is run after a login or after not being run for several minutes, this initial compilation can take dramatically longer than subsequent compilations. Subsequent compilations are significantly faster

Environment : RedHat Enterprise Linux and its derivatives

Root Cause : Full look up of multiple directories causes timeout.

Resolution1 : Remove as many files and directory as you can from /tmp 
The slowness of the first compilation is due to the license manager examining every file on /tmp. This can initially take several seconds as this information is not iniitally cached by the OS. To avoid long delays, remove all unnecessary files from /tmp to speed up this process. Or see Resolution 2 below to improve the speed of the 'stat' operation on /tmp.

Resolution2 : Modify you $LS_OPTIONS environment variable to --color=none -U
This is one of the faster ls option settings. It will prevent you from grabbing all inode information unless you explicitly want it.

For more complete information about compiler optimizations, see our Optimization Notice.