eos icon indicating copy to clipboard operation
eos copied to clipboard

Building does not success complete

Open heretic13 opened this issue 8 years ago • 20 comments

Hello.

I used the following configurations:

  1. Intel I7 3.4 GHz (8 cores) + 16 GB RAM + 2GB swap file. Ubuntu 18.04. Compilation is unsuccessful. Out of memory.

  2. Intel I7 3.4 GHz (4 cores) + 8 GB RAM + unknown size of the swap file. Ubuntu 16.04. Compilation is unsuccessful. Out of memory.

Good. Suppose we do not have enough memory (this is contrary to your documentation - that should be enough 8 GB of RAM).

  1. Intel I7 3.4 GHz (8 cores) + 16 GB RAM + 2GB swap file + 30 GB swap file. Ubuntu 18.04. Compilation is unsuccessful. Out of memory. The swap file and RAM are fully used.

This is unacceptable for a project of this level. I suspect that the matter is in excessive paralleling of the compilation process

heretic13 avatar May 08 '18 23:05 heretic13

I run with make -j20 on my machine all of the time.

Running with make (without an -j) should not require much RAM. We build across a wide range of platforms as part of every commit. I think you are using make wrong.

bytemaster avatar May 09 '18 02:05 bytemaster

I do not use make directly.

" Run the build script Run the build script from the eos folder.

cd eos ./eosio_build.sh "

This is a part of your official documentation. Looks that you have logic error's in your build script documentation or somewere else. Problem is not solved!

My advice to you: Do not hurry to close the issue without understanding. I understand that you are a developer and can do whatever you want with your project. But this does not adorn you. Do not act like most developers boost c ++, that they prefer to "close your eyes" to the existence of the problem, than to solve it.

heretic13 avatar May 09 '18 07:05 heretic13

Installations Ubuntu 18.04 / 16.04 fresh and typical, without customization.

Preinstalled software from me: clang (the default version on the system), g ++, gcc, make, cmake, git.

heretic13 avatar May 09 '18 08:05 heretic13

@heretic13 what errors do you see? please attach a copy of the output.

gleehokie avatar May 09 '18 08:05 gleehokie

Ok.

First: cpui.txt - cat /proc/cpuinfo meminfo.txt - cat/proc/meminfo

kern.log and syslog - system logs.

PS: The output of the build process I will put screenshots (I do not know how to correctly make a copy of the output in the text) cpui.txt kern.zip syslog.zip meminfo.txt

heretic13 avatar May 09 '18 09:05 heretic13

Output build https://www.dropbox.com/sh/fnasqk3xm36sb8t/AACwyckr47T41BBigtNG6ay9a?dl=0

heretic13 avatar May 09 '18 10:05 heretic13

Some translations from russian: "невозможно выделить память" - "could not allocate memory". "Ожидание завершения заданий" - "waiting for finishing jobs" (for make). "Убито" - killed.

IMAG0082.jpg - The screenshot is grabbed during the closing of the build. Load average - 114.67 158.35 102.39 (very funny)

IMAG0080.jpg - top command not response in 120 sec.

It looks like an excessive parallelization of the compilation process.

heretic13 avatar May 09 '18 10:05 heretic13

@heretic13 could you please run the following commands and put the output log file here (log file = eosio_build.log)? cd /path/to/eos rm -rf build/ git checkout master git pull git submodule update --init --recursive ./eosio_build.sh > eosio_build.log

pacificcode avatar May 09 '18 14:05 pacificcode

eosio_build.zip eos1.txt eos2.txt

After unsuccesfull build (eosio_build.log ) and reboot I do:

./eosio_build.sh > eos1.txt 2>eos2.txt

heretic13 avatar May 09 '18 18:05 heretic13

Your build is failing long before you ever reach EOS.IO code. That build failed while attempting to build LLVM with WASM support, and it failed very early in that process.

Given the nature of the failures, I suggest investigating the state of the machine during the build by running top and sorting by memory usage. ('f' key, down arrow by one to "%MEM", 's' key (change appears in upper right corner), 'q' key.) The build script attempts to limit the parallelization of the build by the lesser of the gigabytes of RAM in the system or the number of available cores. On your 8 core 16 GB system, that would be 8 jobs. If you see gcc using more than 2 GB of RAM average, that's the problem. I agree, that absurd: take it up with the LLVM and GCC teams. EOS.IO code is not involved.

jgiszczak avatar May 09 '18 19:05 jgiszczak

I already gave the above screenshot. loadavg> 100. Do you know what this means? This means that more than 100 threads are trying to execute CPU 100% of their time. And there are records that say that the command top does not answer for more than 2 minutes.

I have a theory. Maybe it's a matter of compiling nested projects?

Suppose there is a project that contains several dozens of internal projects (hierarchical structure). Let's assume that each of the internal projects contains a few dozen more internal projects, and so on.

If for the main project you specify the build in 8 threads, then how many flows will be built by its internal projects? I do not know the answer to this question, but if the -j8 option is inherited for each internal project, then it will be a disaster. 8x8x8x8x8x .... independent building threads.

heretic13 avatar May 09 '18 20:05 heretic13

jgiszczak, how can I easily switch the building of eos (including all dependencies) to a build in 1 compilation thread?

heretic13 avatar May 09 '18 20:05 heretic13

In scripts/eosio_build_ubuntu.sh, change line 10 from JOBS=$(( ${MEM_GIG} > ${CPU_CORE} ? ${CPU_CORE} : ${MEM_GIG} )) to JOBS=1.

jgiszczak avatar May 09 '18 20:05 jgiszczak

jgiszczak, thanks. I found a error in your script.

In scripts/eosio_build_ubuntu.sh : MEM_MEG=$( free -m | grep Mem | tr -s ' ' | cut -d\ -f2 || cut -d' ' -f2 )

Output of command "free -m" is localized.

For example, for russian ubuntu version it will look like this: free-m.txt

I think variable MEM_MEG contains a void. The number of parallel tasks is not calculated correctly.

Perhaps you need to change the parameter in grep. Or, parse the output of /proc/meminfo.

heretic13 avatar May 09 '18 21:05 heretic13

@heretic13 could you run the following and paste the output here? cat /proc/meminfo

pacificcode avatar May 09 '18 23:05 pacificcode

pacificcode, I put meminfo ouput here (upper in thread).

Reference: https://github.com/EOSIO/eos/files/1987297/meminfo.txt

It's not localized

heretic13 avatar May 10 '18 06:05 heretic13

jgiszczak.

I change the line to MEM_MEG = $ (free -m | sed -n 2p | tr -s '' | cut -d \ -f2) and continue building?

Perhaps this is not the only problem during building.

heretic13 avatar May 10 '18 06:05 heretic13

Please do.

jgiszczak avatar May 10 '18 22:05 jgiszczak

jgiszczak, thanks for all.

I have successfully built eos with your changes.

I have not done any tests yet (I will do them later).

jgiszczak, how long will it take for your changes to go to main branch?

The topic can be closed. The problem is solved.

heretic13 avatar May 11 '18 05:05 heretic13

The change has been merged to the slim branch, which is expected to be merged to master within 10 hours of this posting.

jgiszczak avatar May 11 '18 18:05 jgiszczak