Gentoo, gcc 4.1.1 and linode 100

I've been trying to compile GCC 4.1.1 on my linode 100, but I quickly start to trash the swap and run out of IO tokens. Anyone has a solution?

For now, I added gcc 4.1.1 and glibc 2.4 to my package.mask, but I guess that eventually, other gentoo packages will require it.

3 Replies

I compiled the packages on my home computer and then uploaded the package to the Linode and installed it. That was the only way I can get some of the packages installed. It works really good.

You could also just let it run. It'll take an ungodly amount of time, but it will compile.

But the best solution, I think, is to use distcc if you can devote the resources to it. Use at least one other system to pass off some of the compilation.

The problem with GCC is the amount of memory it takes to compile the DFAs. What I've done is set up a script to check /proc/iostatus and when iotokens falls below a certain level I killall -STOP the gcc processes on the system. When the level rises again, I killall -CONT the processes. It takes longer because of all the swapping but the system is usually responsive..

#!/usr/bin/ruby
###############
def io_status (token=nil)
    hash = {}
    File.open("/proc/io_status","r").each do |line|
      line.split.each do |item|
        key,value = item.split("=")
        hash.update( { key=>value } )
      end
    end
    return hash if not token
    return hash[token]
end

print Time.new, " * ", io_status('io_tokens'), "\n"
system('killall -STOP cc1')
system('killall -STOP cc1plus')
system('killall -STOP xgcc')

while true

  while io_status('io_tokens').to_i <  160000 ; sleep 6 ; end
  print Time.new, " + ", io_status('io_tokens'), "\n"
  system('killall -CONT cc1')
  system('killall -CONT cc1plus')
  system('killall -CONT xgcc')

  while io_status('io_tokens').to_i >  80000 ; sleep 6 ; end
  print Time.new, " - ", io_status('io_tokens'), "\n"
  system('killall -STOP cc1')
  system('killall -STOP cc1plus')
  system('killall -STOP xgcc')

end

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct