Error happened while running 'bash apollo.sh build'
after setting docker env use the following commands
bash docker/scripts/install_docker.sh
# logout and login to make sure to run docker command without sudo
docker ps # to verify docker works without sudo
bash docker/scripts/dev_start.sh
bash docker/scripts/dev_into.sh
I try to build apollo:
bash apollo.sh build
and got the following errors:
WARNING: Running Bazel server needs to be killed, because the startup options are different.
INFO: Found 189 targets...
ERROR: /apollo/modules/common/adapters/BUILD:16:1: C++ compilation of rule '//modules/common/adapters:adapter_manager' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g '-std=c++0x' '-DUSE_ESD_CAN=false' -MD -MF ... (remaining 96 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4.
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
INFO: Elapsed time: 1290.986s, Critical Path: 123.06s
============================
[ERROR] Build failed!
[INFO] Took 4081 seconds
============================
When I try to build apollo: bash apollo.sh build. I encountered the same question, looking forward to a solution.
Potentially same as #75. Please check if your machine has enough memory. We recommend at least 2G+ to build successfully.
Is the build on linux? Using the newest code, a warning should be printed out if the total memory is less than 2G. So this might be a different issue.
A quick check on whether it's caused by OOM is to use dmesg command.
You must run the build after run "bash docker/scripts/dev_into.sh", then it will enter into the docker env.
I got the warning which the building need at least 2G memory, but I omit it. I build the newest code using linux, but I have only 1G memory.
Please try to bump up your memory in order to build successfully.
I try dmesg and get some hint
[335290.862987] Out of memory: Kill process 25350 (cc1plus) score 309 or sacrifice child
[335290.863035] Killed process 25350 (cc1plus) total-vm:357508kB, anon-rss:312728kB, file-rss:0kB
It seems like OOM.