hoytech / strfry

a nostr relay
GNU General Public License v3.0
468 stars 94 forks source link

Build Error #81

Open jlopp opened 10 months ago

jlopp commented 10 months ago

Trying to compile a checkout of 0.9.6 on Ubuntu 22.04.

Installed dependencies listed in readme.

$ make -j4
golpe/rules.mk:31: update target 'build/main.o' due to: build/main.cpp
g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT build/main.o -MF build/main.d -c build/main.cpp -o build/main.o
golpe/rules.mk:31: update target 'build/config.o' due to: build/config.cpp build/golpe.h build/config.h build/defaultDb.h
g++ -std=c++20 -O0 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT build/config.o -MF build/config.d -c build/config.cpp -o build/config.o
golpe/rules.mk:31: update target 'src/apps/dbutils/cmd_delete.o' due to: src/apps/dbutils/cmd_delete.cpp build/golpe.h build/config.h build/defaultDb.h
g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_delete.o -MF src/apps/dbutils/cmd_delete.d -c src/apps/dbutils/cmd_delete.cpp -o src/apps/dbutils/cmd_delete.o
golpe/rules.mk:31: update target 'src/apps/dbutils/cmd_dict.o' due to: src/apps/dbutils/cmd_dict.cpp build/golpe.h build/config.h build/defaultDb.h
g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_dict.o -MF src/apps/dbutils/cmd_dict.d -c src/apps/dbutils/cmd_dict.cpp -o src/apps/dbutils/cmd_dict.o
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make: *** [golpe/rules.mk:31: build/config.o] Error 1
make: *** Waiting for unfinished jobs....
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make: *** [golpe/rules.mk:31: src/apps/dbutils/cmd_dict.o] Error 1
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make: *** [golpe/rules.mk:31: src/apps/dbutils/cmd_delete.o] Error 1
jlopp commented 10 months ago

From some searching around it sounds like one possibility is that it's getting killed due to running out of memory.

I tried "make" without -j4 but it still fails. To be clear, this is on a machine that only has 2 GB of RAM.

jlopp commented 10 months ago

I was able to compile the binary on a different Ubuntu machine with more RAM and then run it on this machine. Might be worth updating your documentation and/or making precompiled binaries available.

hoytech commented 10 months ago

Ahh yeah sorry about that, some of the files need a lot of memory to compile. You might be able to build it on the low-memory machine if you had some swap, although building it on a build server with lots of resources is a good way too.

I will look into distributing binaries somehow. What would be your preference? A deb package?

jlopp commented 10 months ago

Just the raw binary should suffice; I don't think there's a need for a deb package.

angelonardone commented 10 months ago

I'm getting the following error:

perl golpe/gen-fbs.pl perl golpe/gen-config.pl golpe/external/rasgueadb/rasgueadb-generate golpe.yaml build perl golpe/gen-main.cpp.pl error: /home/angelo/strfry/strfry/fbs/nostr-index.fbs:4: 16: error: expecting: ] instead got: : flatc failure building fbs/nostr-index.fbs at golpe/gen-fbs.pl line 22, <$fh> line 1. make: *** [golpe/rules.mk:44: build/golpe.h] Error 1 make: *** Waiting for unfinished jobs.... FLATC: error: /home/angelo/strfry/strfry/fbs/nostr-index.fbs:4: 16: error: expecting: ] instead got: : flatc failure at golpe/external/rasgueadb/rasgueadb-generate line 155. make: *** [golpe/rules.mk:54: build/defaultDb.h] Error 1

Any Idea? I'm using Ubuntu 20.04.5 LTS thanks

hoytech commented 8 months ago

I think the flatc that ships with 20.04 might not support some new syntax I'm using -- sorry! Easiest is probably to use 22.04.

I'm going to be getting rid of that flatbuffers file for the next major release, so I don't think it's worth figuring out a long-term fix.