gpt4 book ai didi

makefile - 为 redis : cc: error: x86_64: No such file or directory 编译 hiredis 依赖项的奇怪失败

转载 作者:IT王子 更新时间:2023-10-29 06:13:06 26 4
gpt4 key购买 nike

我正在尝试在 Ubuntu 16.04 上编译 Redis 4.0.9(最新)。在 redis 目录中运行 make 时,我得到以下输出:

cd src && make all
make[1]: Entering directory '/user/HS104/m09170/redis/redis-4.0.9/src'
CC Makefile.dep
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
(cd ../deps && make distclean)
make[2]: Entering directory '/user/HS104/m09170/redis/redis-4.0.9/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory '/user/HS104/m09170/redis/redis-4.0.9/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic -DREDIS_STATIC='' >> .make-settings
echo WARN=-Wall -W -Wno-missing-field-initializers >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS= >> .make-settings
echo LDFLAGS= >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -DREDIS_STATIC='' -Wall -W -Wno-missing-field-initializers -O2 -g -ggdb -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS= -g -ggdb -rdynamic >> .make-settings
(cd ../deps && make hiredis linenoise lua jemalloc)
make[2]: Entering directory '/user/HS104/m09170/redis/redis-4.0.9/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-cflags)
(echo "" > .make-ldflags)
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory '/user/HS104/m09170/redis/redis-4.0.9/deps/hiredis'
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb x86_64 net.c
cc: error: x86_64: No such file or directory
Makefile:156: recipe for target 'net.o' failed
make[3]: *** [net.o] Error 1
make[3]: Leaving directory '/user/HS104/m09170/redis/redis-4.0.9/deps/hiredis'
Makefile:45: recipe for target 'hiredis' failed
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory '/user/HS104/m09170/redis/redis-4.0.9/deps'
Makefile:170: recipe for target 'persist-settings' failed
make[1]: [persist-settings] Error 2 (ignored)
CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
compilation terminated.
Makefile:228: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory '/user/HS104/m09170/redis/redis-4.0.9/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

看来问题与依赖性有关。如果我进入 deps 文件夹并手动逐个编译依赖项,它们都会成功(包括 jemalloc),hiredis 除外,它提供以下输出:

user@tefnut:~/redis/redis-4.0.9/deps/hiredis$ make
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb x86_64 net.c
cc: error: x86_64: No such file or directory
Makefile:156: recipe for target 'net.o' failed
make: *** [net.o] Error 1

我试过 make distclean 但没有成功。

最佳答案

解决方案正在运行:

取消设置 ARCH 和/或取消设置 TARGET_ARCH

之后 hiredis 毫无怨言地编译了。我不确定为什么这行得通,所以如果有人知道它为什么会有所作为,我很好奇。

关于makefile - 为 redis : cc: error: x86_64: No such file or directory 编译 hiredis 依赖项的奇怪失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49545175/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com