2

I want to build qemu from source in my Ubuntu 20.04. It seems ordinary to build QEMU by following the official instruction.

Execution of command make -j works well at the beginning, and slows down gradually after a period of compiling. Finally, the entire system hangs, keyboard and mouse freeze. The only way to recover from such a situation is pressing power button.

So, it that a compatibility problem of mismatch of gcc and the source code? Or is that I use -j option illegally?

Update:

  1. Removal of -j option makes the problem gone.
  2. Using parallel jobs less than the number of CPU cores by appending -jN option also eliminates the problem. Single -j option without an argument makes make command utilize the whole cores to do compiling.
2
  • Not very much info so I can only guess that you have no swap, and are running out of RAM. Read man mkswap swapon
    – waltinator
    Jun 16, 2020 at 16:26
  • @waltinator I am not very agree with you. I continuously inspect memory usage by watch -n 1 free -h, and before system halt, free reports that it is still unused memory available. Also, I have swap partition enabled as default.
    – Douglas Su
    Jun 17, 2020 at 4:42

1 Answer 1

0

Don't specify "-j" without a specific number, try to use "-j4".

-j [jobs], --jobs[=jobs]
Specifies the number of jobs (commands) to run simultaneously. If there is more than one -j option, the last one is effective. If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously. When make invokes a sub-make, all instances of make will coordinate to run the specified number of jobs at a time; see the section PARALLEL
MAKE AND THE JOBSERVER for details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .