Open Hakkadaikon opened 8 months ago
Hi, When I built nostrdb, the following link error occurred.
$ make clean; make rm -rf test bench bench-ingest bench-ingest-many cc -Wall -Wno-misleading-indentation -Wno-unused-function -Werror -O2 -g -Ideps/secp256k1/include -Ideps/lmdb -Ideps/flatcc/include bench.c nostrdb.c sha256.c bech32.c deps/flatcc/src/runtime/json_parser.c deps/flatcc/src/runtime/verifier.c deps/flatcc/src/runtime/builder.c deps/flatcc/src/runtime/emitter.c deps/flatcc/src/runtime/refmap.c deps/lmdb/liblmdb.a deps/secp256k1/.libs/libsecp256k1.a -o bench /usr/bin/ld: deps/lmdb/liblmdb.a(mdb.o): in function `mdb_txn_renew0': /home/hakkadaikon/repos/hakkadaikon/nostrdb/deps/lmdb/mdb.c:2719: undefined reference to `pthread_getspecific' /usr/bin/ld: /home/hakkadaikon/repos/hakkadaikon/nostrdb/deps/lmdb/mdb.c:2762: undefined reference to `pthread_setspecific' /usr/bin/ld: deps/lmdb/liblmdb.a(mdb.o): in function `mdb_env_copythr': /home/hakkadaikon/repos/hakkadaikon/nostrdb/deps/lmdb/mdb.c:9126: undefined reference to `pthread_sigmask' ~ collect2: error: ld returned 1 exit status make: *** [Makefile:137: bench] Error 1
The problem was resolved by changing nostrdb/Makefile as follows.
--- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ CFLAGS = -Wall -Wno-misleading-indentation -Wno-unused-function -Werror -O2 -g - HEADERS = sha256.h nostrdb.h cursor.h hex.h jsmn.h config.h sha256.h random.h memchr.h $(C_BINDINGS) FLATCC_SRCS=deps/flatcc/src/runtime/json_parser.c deps/flatcc/src/runtime/verifier.c deps/flatcc/src/runtime/builder.c deps/flatcc/src/runtime/emitter.c deps/flatcc/src/runtime/refmap.c SRCS = nostrdb.c sha256.c bech32.c $(FLATCC_SRCS) -LDS = $(SRCS) $(ARS) +LDS = $(SRCS) $(ARS) -lpthread DEPS = $(SRCS) $(HEADERS) $(ARS) ARS = deps/lmdb/liblmdb.a deps/secp256k1/.libs/libsecp256k1.a LMDB_VER=0.9.31
I'm using Ubuntu 20.04.
cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"
Hi, When I built nostrdb, the following link error occurred.
The problem was resolved by changing nostrdb/Makefile as follows.
I'm using Ubuntu 20.04.