Sometimes compiling certain things from source I've received a "virtual memory exhausted: Cannot allocate memory" error. The following is a quick tip to maybe allow gcc/libtool/make/whatever to finish their duty.
Change the user’s limits.
ulimit -n
and it is current showing as 1024.
Increase limit from 1024 to 4084.
ulimit -n 2048