Contact SalesSitemapCustomer Login

Compile ANY program

Contents

[edit]

Compile ANY Program

[edit]

Solution 1 - The Easy Way

Manually set the ggc-min-expand,ggc-min-heapsize variables. As the default gcc settings base these values on the total ram of the machine (4gigs) rather than what you're being limited to, see http://forums.vpslink.com/showthread.php?t=336

Snipped from jbtule post:

I actually have been testing out Gentoo on a VPSLINK1, compiling anything becomes a real challenge and ulimit doesn't help in that regard. Using -O0 (no optimizations) rathern than -O2 optimiziations does help getting more things to compile, however, being low on resources that may just cause more problems down the road. Looking in the gcc manual, gcc has a garbage collection scheme for the ram it uses.

The parameters ggc-min-expand,ggc-min-heapsize are used to determine when gcc should clean up and dealloc it's unused memory and their defaults are percentages of the total system memory (4gigs) so it's no wonder gcc is having problems.

Setting both to 0, causes compilation to be way too slow, however setting ggc-min-heapsize to 8MB and ggc-min-expand to 0 works pretty well on a VPSLINK1 and I haven't had problems emerging anything with -O2 since (other than things that are running other processes other than gcc such python or ruby then i pretty much have to stop all non necessary services, and then maybe I squeak by).

For clarification I added these flags to my CFLAGS in /etc/make.conf

--param ggc-min-expand=0 --param ggc-min-heapsize=8192
[edit]

Solution 1a

If the above doesn't work for you, I was able to compile lighttpd on a VPSLINK1 with the following:

--param ggc-min-expand=0 --param ggc-min-heapsize=4096 -fno-inline

If you still don't have any luck (eg. Postfix), try changing your ulimit as follows:

ulimit -v 16384
(then compile, afterwards remove the restriction):
ulimit -v unlimited
[edit]

Solution 2 - The Hard(er) Way

I've played around with ulimits in the hope to compile some programs from source (like, php/mysql...) No matter what I do, I'm always going to have too low of mem. An alternative method is to use distcc and pipe all the processes back to one of my personal computers.

Distcc HOWTO

Retrieved from "http://wiki.vpslink.com/Compile_ANY_program"
Recent Changes | RSS RSS Feed