facebook / mcrouter

Mcrouter is a memcached protocol router for scaling memcached deployments.
MIT License
3.26k stars 535 forks source link

Compiler Errors during installation #17

Closed max-abramowitz-reif-ck closed 9 years ago

max-abramowitz-reif-ck commented 9 years ago

I'm attempting to install mcrouter on an out-of-the-box vagrant vm found on www.vagrantbox.es, a build of Ubuntu 14.04. Running the installation script produces a compiler error when attempting to compile Folly, and kills the build.

I get compilation errors after the following 2 commands: libtool: compile: g++ -DHAVE_CONFIG_H -I./.. -pthread -I/usr/include -I/home/vagrant/mcrouter-install//install/include -I/home/vagrant/mcrouter-install//pkgs/double-conversion -std=gnu++0x -g -O2 -MT FileUtil.lo -MD -MP -MF .deps/FileUtil.Tpo -c FileUtil.cpp -fPIC -DPIC -o .libs/FileUtil.o g++: internal compiler error: Killed (program cc1plus)

libtool: compile: g++ -DHAVE_CONFIG_H -I./.. -pthread -I/usr/include -I/home/vagrant/mcrouter-install//install/include -I/home/vagrant/mcrouter-install//pkgs/double-conversion -std=gnu++0x -g -O2 -MT Bits.lo -MD -MP -MF .deps/Bits.Tpo -c Bits.cpp -o Bits.o >/dev/null 2>&1 g++: internal compiler error: Killed (program cc1plus)

Is there a possible workaround for folly compilation? Or a fix in the pipeline?

alikhtarov commented 9 years ago

@maxar-ck I've seen this error before due to g++ running out of memory, it's possible that your vm just doesn't have enough RAM. If you have enough disk space, one trick that worked for me is to add swap space, i.e. to add 1GB:

sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=1048576 sudo chown root:root /swapfile1 sudo chmod 0600 /swapfile1 sudo mkswap /swapfile1 sudo swapon /swapfile1

(link: http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/)

max-abramowitz-reif-ck commented 9 years ago

Thanks for the help! Upped the RAM on the machine and everything installed fine