harvard-acc / gem5-aladdin

End-to-end SoC simulation: integrating the gem5 system simulator with the Aladdin accelerator simulator.
BSD 3-Clause "New" or "Revised" License
223 stars 59 forks source link

compilation error in the docker image #9

Open tomaslaz opened 5 years ago

tomaslaz commented 5 years ago

Hello,

I am trying to compile a gem5 in the docker image but it is unsuccessful. My workflow is as follows:

Getting the docker image and accessing it:

docker pull xyzsam/gem5-aladdin docker run -it --rm --mount source=gem5-aladdin-workspace,target=/workspace xyzsam/gem5-aladdin

Updating submodules and aladdin

cd /workspace/gem5-aladdin/; git pull; git submodule update --init --recursive cd /workspace/gem5-aladdin/src/aladdin; git pull origin master

Finally compiling gem5:

cd /workspace/gem5-aladdin/; scons build/X86/gem5.opt

First it asks about the missing hook

scons: Reading SConscript files ...

You're missing the gem5 style or commit message hook. These hooks help
to ensure that your code follows gem5's style rules on git commit.
This script will now install the hook in your .git/hooks/ directory.
Press enter to continue, or ctrl-c to abort:

Then it fails with the following message:

{standard input}: Assembler messages:
{standard input}:6254574: Warning: end of file not at end of a line; newline inserted
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
scons: *** [build/X86/arch/x86/generated/inst-constrs.o] Error 4
scons: building terminated because of errors.

Please find the log attached. log.txt

Any help would be much appreciated,

Tomas

tomaslaz commented 5 years ago

An update on this.

The issue occurs only when I am trying to build on OSX. If I pre-build on a Ubuntu VM and use that image on OSX - it works. I am not sure what is causing this but it would be great to know.

xyzsam commented 5 years ago

I have very little experience with building on OSX, unfortunately. Does this issue also happen with just plain gem5?

One thing you can try to do is to get scons to print out the command line for every command it's running to identify exactly which file the assembler is tripping up on.

samialabed commented 3 years ago

Tl;dr increase the CPU and RAM limit of the docker VM.

Apologise for bumping this up after two years. But I had the same issue and resolved it by increasing the CPU and RAM limits of the docker desktop. As this might still be useful to anyone not on Linux.

Longer description: In both OSX and Windows docker runs inside a VM and not natively as it does in Linux. and because of that, there is a limit on the CPU usage, lack of memory and small swap makes it impossible to finish compiling some of the flags. Setting RAM to 16gm and CPU to 10 cores was enough to finish compiling.

Worth updating the documentation for this and might be good idea to also provide pre-built images.