Does software compilation continue even if I close the lid of my MacBook Pro (7,1)? My specific case is that I am installing something from MacPorts and it's taking a very long time. I just want to close the lid of my laptop.

Will the compilation still continue?

I do not want to install the NoSleep app.
As mentioned before, closing the lid of a portable Mac causes it to sleep, and not to dream of compilations as-yet unfinished.


  What happens when I close the lid on my MacBook Pro running OS X?


If (and only if, apparently) your Mac is connected to: 


an external display,  
an external keyboard or mouse or trackpad
a power adapter,


your laptop will operate in "clamshell mode", as outlined here:  


  http://support.apple.com/en-ca/HT201834


and your compilation will continue.