Re: Can't Compile Stalin
- From: noisesmith@xxxxxxxxx
- Date: Tue, 29 Apr 2008 09:44:55 -0700 (PDT)
On Apr 27, 5:39 pm, Jeffrey Mark Siskind <q...@xxxxxxxxxx> wrote:
On Apr 27, 7:48 pm, deech <aditya.si...@xxxxxxxxx> wrote:
Stalin 0.11 fails to compile. It gets to this point:
^^^^Starting command^^^^
cord/cordtest
SUCCEEDED
gcc -o stalin -I./include -O3 -fomit-frame-pointer\
-fno-strict-aliasing -freg-struct-return\
stalin.c -L./include -lm -lgc
It stays at this compile step for about 10 minutes and then tells me
that it doesn't have any more virtual memory. I have reproduced this
on two machines both running linux 2.6.24-15-generic and gcc 4.2.3.
What am I doing wrong?
Recent versions of gcc require a lot more memory with high
optimization
settings.
Try:
1. increasing the amount of swap space you have,
2. using an older version of gcc,
3. changing -O3 to -O2 or -O1 or -O0,
4. installing a prebuilt packages such as the one in Debian, or
5. cross compiling the i686 version from an amd64 machine
another option (what I just did for my stalin compile, actually), is
creating a swap file (I had a swap
file sitting around from when I tried to edit a humongous scanned
image in the gimp, that just happened to be larger than the combined
ram and virtual memory on my system... not being one to give up
easily, I created a 3gig empty file, formatted it as a swap partition,
and activated it for the kernel to swap on).
Here are the instructions distilled from a google hit:
# replace 1000000 with the number of kilobytes you want to allocate
for swap
dd if=/dev/zero of=/swapfile bs=1024 count=1000000
mkswap /swapfile
swapon /swapfile
Of course, after the first time you do that, you can just skip to the
swapon step.
This performs very poorly, swap is bad enough, but a swap file is
atrocious. But. Linux memory management lies. malloc doesn't fail,
instead, it just kills off processes that use too much memory (even if
they successfully malloced that memory). So, if you want to do the
occasional huge task, and you don't want random unpredictable program
death, your ONLY alternative is a honking huge oversized inefficient
swap file. Complain to Linus if you want, but he refuses to change
this behavior. Systems like OSX and Windows create a swap file as
needed, and grow it as needed. Then you have the mysterious behaviour
of filling up your hard disk when you run a big task, the task
crashing because the disk is no longer usable, and then, immediately,
the disk is no longer full, since the application no longer exists,
and the OS shrank its swap file again. The Linux policy (encouraging
partition rather than file, not making a file when needed, but instead
reaping random programs) encourages higher performance and scales
better to extremely limited resources, but is much less user friendly.
Like just about everything else Linux (which is why I love Linux so).
By the way: kudos to gcc for knowing when it would be making your
whole system unstable, rather than potentially making other apps crash
(or is it always biggest ram user that goes first? I don't remember).
.
- Follow-Ups:
- Re: Can't Compile Stalin
- From: Alexander Schmolck
- Re: Can't Compile Stalin
- References:
- Can't Compile Stalin
- From: deech
- Re: Can't Compile Stalin
- From: Jeffrey Mark Siskind
- Can't Compile Stalin
- Prev by Date: Re: Easier Window Switching In Emacs
- Next by Date: Re: Which Scheme to choose?
- Previous by thread: Re: Can't Compile Stalin
- Next by thread: Re: Can't Compile Stalin
- Index(es):
Relevant Pages
|