catid / loraftp

File transfer between two Raspberry Pis using the LoRa Pi HAT from Waveshare
BSD 3-Clause "New" or "Revised" License
19 stars 4 forks source link

Compiling challenges src/tools.cpp.o] Error #1

Closed Dukat-Gul closed 3 years ago

Dukat-Gul commented 3 years ago

Heya. Tried to compile the excellent project and after a very long pause at the 84% mark I get the following failure. Any suggestions?

loraftp/build $ make -j Scanning dependencies of target wirehair Scanning dependencies of target zstd [ 2%] Building CXX object wirehair/CMakeFiles/wirehair.dir/gf256.cpp.o [ 4%] Building CXX object wirehair/CMakeFiles/wirehair.dir/WirehairTools.cpp.o [ 6%] Building CXX object wirehair/CMakeFiles/wirehair.dir/wirehair.cpp.o [ 8%] Building CXX object wirehair/CMakeFiles/wirehair.dir/WirehairCodec.cpp.o [ 10%] Building C object CMakeFiles/zstd.dir/zstd_lib/common/debug.c.o [ 13%] Building C object CMakeFiles/zstd.dir/zstd_lib/common/error_private.c.o [ 15%] Building C object CMakeFiles/zstd.dir/zstd_lib/common/entropy_common.c.o [ 17%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/fse_compress.c.o [ 19%] Building C object CMakeFiles/zstd.dir/zstd_lib/common/xxhash.c.o [ 21%] Building C object CMakeFiles/zstd.dir/zstd_lib/common/threading.c.o [ 23%] Building C object CMakeFiles/zstd.dir/zstd_lib/common/fse_decompress.c.o [ 26%] Building C object CMakeFiles/zstd.dir/zstd_lib/common/zstd_common.c.o [ 28%] Building C object CMakeFiles/zstd.dir/zstd_lib/common/pool.c.o [ 30%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstd_compress_literals.c.o [ 32%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/hist.c.o [ 34%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/huf_compress.c.o [ 36%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstd_compress_superblock.c.o [ 39%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstd_compress_sequences.c.o [ 43%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstd_double_fast.c.o [ 45%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstd_fast.c.o [ 45%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstd_compress.c.o[ 47%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstd_ldm.c.o [ 50%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstd_lazy.c.o [ 52%] Building C object CMakeFiles/zstd.dir/zstd_lib/dictBuilder/divsufsort.c.o[ 54%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstdmt_compress.c.o [ 56%] Building C object CMakeFiles/zstd.dir/zstd_lib/compress/zstd_opt.c.o [ 58%] Building C object CMakeFiles/zstd.dir/zstd_lib/decompress/huf_decompress.c.o [ 63%] Building C object CMakeFiles/zstd.dir/zstd_lib/decompress/zstd_decompress_block.c.o [ 65%] Building C object CMakeFiles/zstd.dir/zstd_lib/dictBuilder/fastcover.c.o [ 67%] Building C object CMakeFiles/zstd.dir/zstd_lib/decompress/zstd_ddict.c.o [ 60%] Building C object CMakeFiles/zstd.dir/zstd_lib/dictBuilder/cover.c.o [ 69%] Building C object CMakeFiles/zstd.dir/zstd_lib/decompress/zstd_decompress.c.o [ 71%] Building C object CMakeFiles/zstd.dir/zstd_lib/dictBuilder/zdict.c.o /home/pi/LoRaFTP/loraftp/wirehair/WirehairCodec.cpp: In member function ‘void wirehair::Codec::BackSubstituteAboveDiagonal()’: /home/pi/LoRaFTP/loraftp/wirehair/WirehairCodec.cpp:2303:39: warning: passing argument 1 to restrict-qualified parameter aliases with argument 2 [-Wrestrict] gf256_div_mem(src, src, code_value, _block_bytes); ^~~ ~ /home/pi/LoRaFTP/loraftp/wirehair/WirehairCodec.cpp:2387:35: warning: passing argument 1 to restrict-qualified parameter aliases with argument 2 [-Wrestrict] gf256_div_mem(src, src, code_value, _block_bytes); ^ ~ /home/pi/LoRaFTP/loraftp/wirehair/WirehairCodec.cpp:2652:31: warning: passing argument 1 to restrict-qualified parameter aliases with argument 2 [-Wrestrict] gf256_div_mem(src, src, code_value, _block_bytes); ^ ~~~ [ 73%] Linking CXX static library libwirehair.a [ 73%] Built target wirehair [ 76%] Linking C static library libzstd.a [ 76%] Built target zstd Scanning dependencies of target loraftp [ 82%] Building CXX object CMakeFiles/loraftp.dir/src/linux_serial.cpp.o [ 82%] Building CXX object CMakeFiles/loraftp.dir/src/loraftp.cpp.o [ 82%] Building CXX object CMakeFiles/loraftp.dir/src/waveshare.cpp.o [ 84%] Building CXX object CMakeFiles/loraftp.dir/src/tools.cpp.o

c++: fatal error: Killed signal terminated program cc1plus compilation terminated. make[2]: [CMakeFiles/loraftp.dir/build.make:102: CMakeFiles/loraftp.dir/src/tools.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [CMakeFiles/Makefile2:161: CMakeFiles/loraftp.dir/all] Error 2 make: [Makefile:141: all] Error 2

catid commented 3 years ago

Try building with make -j4

I think you're running out of RAM

Dukat-Gul commented 3 years ago

Thanks, yeah ran top in another Windows during the process and sure enough memory was being totally consumed....

Screenshot_20210410-084619_Termius

tried the make -j4 and still the same issue, I do note that I am using a Raspberry Pi 3 not the recommended rpi4. Anyhow did some quick swap adjustments/increases;

Temporarily Stop Swap: sudo dphys-swapfile swapoff Modify the size of the swap As root, edit the file /etc/dphys-swapfile and modify the variable CONF_SWAPSIZE to 1024: sudo vi /etc/dphys-swapfile Initialize Swap File sudo dphys-swapfile setup Start Swap sudo dphys-swapfile swapon

Compile worked, I have successfully transmitted (& received) and example log file and an 11MB video file.

I did try to use the echo_test command with 0 on one side and -1 (listen) on the other but nothing seemed to happen.

Dukat-Gul commented 3 years ago

Updated make -j4 along with some decent amount of swap enabled on my rpi3 allowed the compile to complete. Memory being exhausted was clearly the issue.