Building ROOT - machine slows down until freeze


I have a ThinkPad R60 9461-DXG with 2 GB RAM, standard 100 GB HDD and running dual-boot Windows 10 + LMDE 3 64-bit. I’ve been trying to build ROOT 6.14.00 on Linux for two weeks now, but around 25-35% the system slows down until it seems to freeze up completely. I’ve tried enabling/disabling swap, building with 1 and 2 cores etc., but the problem persists. Could it be that the laptop is simply too old?

I’ve ordered a 4 GB RAM upgrade now… Any advice is much appreciated.


Hi Hyun-Keun,

First of all you should check what’s happening. When it starts to slow down, hit Ctrl+Z, and at a terminal check whether free says that all of the Mem: and most of the Swap: is used. Then you’re running out of memory. If not, post dmesg | tail.

If the build is running out of memory then here is what I’d do, in the order of significance:

  • order more RAM (check!)
  • use gold instead of bsd-ld - check with your distro how to switch to the gold linker! It uses way less memory.
  • Build with make -j2 instead of make -j4 or so.

Cheers, Axel.

Hi Axel,

thanks for your advice, I just installed the new RAM (only 3 out of 4 GB can be used due to chipset limitations, meh) and restarted the build using 2/2 cores. So far it looks good, 62% and running. This time, I used

sudo cmake -Dall=ON -Dpython3=ON -DPYTHON_EXECUTABLE=/usr/bin/python3.5m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/ -DPYTHON_INCLUDE_DIR=/usr/include/python3.5m /path-to-source/

giving the Python paths explicitly. For some reason, this seems to make a difference…either this or the larger & faster RAM.

In the meantime, I’m looking up how to use Gold in Debian.


You really shouldn’t run cmake with sudo… Also, how do you build?

Cheers, Axel.

Why is sudo here unadvisable?

Unfortunately, the build slowed down around 70%, so I hit Ctrl+Z and found this in the terminal output:

[ 70%] Building CXX object interpreter/llvm/src/tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/CodeGenPGO.cpp.o
{standard input}: Assembler messages:
{standard input}:921113: Warning: end of file not at end of a line; newline inserted
{standard input}:921313: Error: unknown pseudo-op: ` .l'
c++: internal compiler error: Getötet (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
core/clingutils/CMakeFiles/ClingUtils.dir/build.make:86: die Regel für Ziel „core/clingutils/CMakeFiles/ClingUtils.dir/src/TClingUtils.cxx.o“ scheiterte
make[2]: *** [core/clingutils/CMakeFiles/ClingUtils.dir/src/TClingUtils.cxx.o] Fehler 4
CMakeFiles/Makefile2:16731: die Regel für Ziel „core/clingutils/CMakeFiles/ClingUtils.dir/all“ scheiterte
make[1]: *** [core/clingutils/CMakeFiles/ClingUtils.dir/all] Fehler 2
make[1]: *** Es wird auf noch nicht beendete Prozesse gewartet...
[ 70%] Building CXX object interpreter/llvm/src/tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/CodeGenTBAA.cpp.o
[ 70%] Building CXX object interpreter/llvm/src/tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/CodeGenTypes.cpp.o
[ 70%] Building CXX object interpreter/llvm/src/tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/ConstantInitBuilder.cpp.o
[ 70%] Building CXX object interpreter/llvm/src/tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/CoverageMappingGen.cpp.o
[ 70%] Building CXX object interpreter/llvm/src/tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/ItaniumCXXABI.cpp.o
[2]+ Angehalten sudo cmake --build . -- -j2

I wasn’t quick enough to do free, so I’m not sure about memory usage yet. When I noticed that the mouse wasn’t moving, the system was already frozen and I had to wait until I could open a new terminal. dmesg | tail only gives some wifi activity:

user@localhost:/usr/local/bin/root_6.14.04$ dmesg | tail
[23580.190362] wls3: associated
[23580.241622] wls3: Limiting TX power to 11 dBm as advertised by 70:df:2f:a5:d6:3f
[23672.306016] wls3: disconnect from AP 70:df:2f:a5:d6:3f for new auth to b0:26:80:a4:44:50
[23672.314786] wls3: authenticate with b0:26:80:a4:44:50
[23672.316478] wls3: send auth to b0:26:80:a4:44:50 (try 1/3)
[23672.320922] wls3: authenticated
[23672.332071] wls3: associate with b0:26:80:a4:44:50 (try 1/3)
[23672.335416] wls3: RX AssocResp from b0:26:80:a4:44:50 (capab=0x421 status=0 aid=1)
[23672.337119] wls3: associated
[23672.356471] wls3: Limiting TX power to 4 dBm as advertised by b0:26:80:a4:44:50

I’m running cmake again, this time without sudo


Is there a way to automatically pause the build process once a certain memory usage is exceeded? The building process takes very long (hours) and apparently the system starts to freeze up in a matter of minutes or less, so it’s difficult to pause it manually. I’ve installed htop, is there a simple way e.g. to trigger a script that pauses cmake once memory usage hits a certain percentage?

PS.: I’ve disabled the lock screen. Not sure if this is relevant, but I just had to log in from the lock screen and just when I started the browser to check the wifi connection status, the system froze up within a few seconds.

Is there a way to automatically pause the build process once a certain memory usage is exceeded

You can use ulimit to set the maximum amount of resident memory allowed for the user. It does not pause the build though – it kills it.

Thanks for this bit! Opening Firefox without swap while running the build was probably a bad idea. I’m giving it one last shot, now with swap turned on (4 GB, swappiness=10, vfs_cache_pressure=50). Memory usage seems to oscillate between 0.9 GB and 1.3 GB / 2.94 GB and the thing is getting pretty hot… If it gets stuck again, I will try ulimit.

Try to make it using “-j1” (and make sure that you have enough free disk space, e.g. try “df -h”).


I already tried using one and both cores, I think the problem was memory rather than CPU usage. With the swap on and everything, the last overnight build got pretty far:

[ 94%] Building CXX object tmva/tmva/CMakeFiles/TMVA.dir/src/DNN/Architectures/Cpu/CpuMatrix.cxx.o
[ 94%] Linking CXX shared library ../../lib/
[ 94%] Built target TMVA
Makefile:149: die Regel für Ziel "all" scheiterte
make: *** [all] Fehler 2

Does anyone know how to interpret this error message? This bit, die Regel für Ziel "all" scheitert, translates to the recipe for target "all" failed.

A collegue also suggested using make -j2 instead of cmake --build . -- -j2. Interestingly, building with make seems to be lightning-fast (less than a minute), but even after sourcing, ROOT could not be started (No command 'root' found, did you mean: […]).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.