Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal compiler error: Killed (program cc1plus) #334

Closed
realsamanrad opened this issue Aug 4, 2018 · 16 comments
Closed

internal compiler error: Killed (program cc1plus) #334

realsamanrad opened this issue Aug 4, 2018 · 16 comments

Comments

@realsamanrad
Copy link

realsamanrad commented Aug 4, 2018

Hi,
I wanna compile the github.com/vysheng/tdbot , but it returns error on 60% process:

[ 58%] Building CXX object td/CMakeFiles/tdcore.dir/td/telegram/ConfigManager.cpp.o
[ 60%] Building CXX object td/CMakeFiles/tdcore.dir/td/telegram/ConfigShared.cpp.o
[ 60%] Building CXX object td/CMakeFiles/tdcore.dir/td/telegram/Contact.cpp.o
[ 60%] Building CXX object td/CMakeFiles/tdcore.dir/td/telegram/ContactsManager.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
td/CMakeFiles/tdcore.dir/build.make:590: recipe for target 'td/CMakeFiles/tdcore.dir/td/telegram/ContactsManager.cpp.o' failed
make[3]: *** [td/CMakeFiles/tdcore.dir/td/telegram/ContactsManager.cpp.o] Error 4
CMakeFiles/Makefile2:378: recipe for target 'td/CMakeFiles/tdcore.dir/all' failed
make[2]: *** [td/CMakeFiles/tdcore.dir/all] Error 2
CMakeFiles/Makefile2:86: recipe for target 'CMakeFiles/telegram-bot.dir/rule' failed
make[1]: *** [CMakeFiles/telegram-bot.dir/rule] Error 2
Makefile:164: recipe for target 'telegram-bot' failed
make: *** [telegram-bot] Error 2

OS: Ubuntu 17.10 x86_64
RAM: 2 GB

2018-08-04_212327

@levlam
Copy link
Contributor

levlam commented Aug 4, 2018

gcc needs at least 6 GB of RAM to compile TDLib. You can use clang instead, which needs less than 2 GB.

@jk-1
Copy link

jk-1 commented Aug 28, 2018

How do I configure cmake to use clang?

@levlam
Copy link
Contributor

levlam commented Aug 28, 2018

For Ubuntu: https://stackoverflow.com/a/12843988.
Or you can try to run CXX=clang++ CC=clang cmake ...

@levlam
Copy link
Contributor

levlam commented Aug 28, 2018

Please note that you need to delete the whole build directory and recreate it to be able to change compiler.

@kossnocorp
Copy link
Contributor

gcc needs at least 6 GB of RAM to compile TDLib. You can use clang instead, which needs less than 2 GB.

I'm actually managed to build TDLib on 4Gb RAM machine, so I feel that the requirement might be a bit lower than that.

@levlam
Copy link
Contributor

levlam commented Sep 18, 2018

@kossnocorp I've tested recently with GCC 4.9.2 and it used 5.5 GB RAM at the peak. I've rounded it up to 6 GB to make the comment correct for the next few months.

@kossnocorp
Copy link
Contributor

I see, probably my results were affected by the virtual memory although I'm not sure how it actually works.

@levlam
Copy link
Contributor

levlam commented May 1, 2019

TDLib 1.4.0 includes a lot of compilation memory usage optimizations and a new script SplitSource.php, which can be used to split some source code files before building the library to reduce maximum RAM usage per file at the expense of increased build time. In our tests clang 6.0 with libc++ required less than 500 MB of RAM per file and GCC 4.9/6.3 used less than 1 GB of RAM per file.

@levlam levlam closed this as completed May 1, 2019
@kossnocorp
Copy link
Contributor

@levlam that sounds amazing, great work! Is there are extra steps to make it work on 1Gb RAM?

@levlam
Copy link
Contributor

levlam commented May 2, 2019

@kossnocorp
Copy link
Contributor

@levlam thanks!

@maxtronic
Copy link

image
me mandaron a este llink http://raspberrypimaker.com/adding-swap-to-the-raspberrypi/ , cambie a 1024, pero aun persiste error , ahora probaré con un usb externo...

@levlam
Copy link
Contributor

levlam commented Jul 29, 2020

@maxtronic Do not try to build using 4 threads. Use clang and SplitSource.php before building as described in https://github.com/tdlib/td#building.

@buidangdanh
Copy link

help me
image

@bearmingo
Copy link

bearmingo commented Feb 5, 2022

limit make paralel number to smal, eg. make -j4

@mbuguasamuelwambui
Copy link

Writing HLS project(help me fix this error as i am using hls4ml)

Done
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
g++: error: myproject.o: No such file or directory
Traceback (most recent call last):
File "/home/sam/Documents/cancer/con.py", line 14, in
hls_model.compile()
File "/home/sam/anaconda3/envs/hls4ml_env/lib/python3.11/site-packages/hls4ml/model/graph.py", line 662, in compile
self._compile()
File "/home/sam/anaconda3/envs/hls4ml_env/lib/python3.11/site-packages/hls4ml/model/graph.py", line 681, in _compile
self._top_function_lib = ctypes.cdll.LoadLibrary(lib_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sam/anaconda3/envs/hls4ml_env/lib/python3.11/ctypes/init.py", line 454, in LoadLibrary
return self._dlltype(name)
^^^^^^^^^^^^^^^^^^^
File "/home/sam/anaconda3/envs/hls4ml_env/lib/python3.11/ctypes/init.py", line 376, in init
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: my-hls-test/firmware/myproject-F11E53B9.so: cannot open shared object file: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants