redis make报错
解压redis后,第一次make出现报错:
[root@localhost redis-3.2.5]# make cd src && make all
make[1]: Entering directory `/data/redis/redis-3.2.5/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[2]: Entering directory `/data/redis/redis-3.2.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd geohash-int && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/data/redis/redis-3.2.5/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic -DREDIS_STATIC='' >> .make-settings
echo WARN=-Wall -W >> .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 -O2 -g -ggdb -I../deps/geohash-int -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 geohash-int jemalloc)
make[2]: Entering directory `/data/redis/redis-3.2.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd geohash-int && 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 `/data/redis/redis-3.2.5/deps/hiredis'
gcc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
make[3]: gcc: Command not found
make[3]: *** [net.o] Error 127
make[3]: Leaving directory `/data/redis/redis-3.2.5/deps/hiredis'
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/data/redis/redis-3.2.5/deps'
make[1]: [persist-settings] Error 2 (ignored)
CC adlist.o
/bin/sh: cc: command not found 这行报错说明你没有安装gcc
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/data/redis/redis-3.2.5/src'
make: *** [all] Error 2
安装gcc后,继续make出现如下报错:
[root@localhost redis-3.2.5]# make
cd src && make all
make[1]: Entering directory `/data/redis/redis-3.2.5/src'
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
#include <jemalloc/jemalloc.h>
^
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/data/redis/redis-3.2.5/src'
make: *** [all] Error 2
解决方法:
第一种:执行 make MALLOC=libc 命令 ,如果执行后报错 或 还有其他错误,建议删除redis所有文件重新解压编译尝试
原因:由于系统没有jemalloc 而只有 libc ,但是默认回去找jemalloc,导致了 make 出错。 所以加参:make MALLOC=libc
第二种:make CFLAGS="-march=x86-64"
在README 有这个一段话。
Allocator
---------
Selecting a non-default memory allocator when building Redis is done by setting
the `MALLOC` environment variable. Redis is compiled and linked against libc
malloc by default, with the exception of jemalloc being the default on Linux
systems. This default was picked because jemalloc has proven to have fewer
fragmentation problems than libc malloc.
To force compiling against libc malloc, use:
% make MALLOC=libc
To compile against jemalloc on Mac OS X systems, use:
% make MALLOC=jemalloc
在构建Redis时,通过设置来选择非默认的内存分配器
MALLOC的环境变量。Redis被编译并链接到libc
malloc是默认的,jemalloc是Linux上的默认值。之所以选择这个默认值,是由于事实证明jemalloc的内存更少,碎片化问题比libc malloc严重。
现在由于没有jemalloc 而只有 libc ,但是默认回去找jemalloc,导致了 make 出错。 所以加这么一个参数。
要强制编译libc malloc,请使用:
% MALLOC = libc
要在Mac OS X系统上编译jemalloc,请使用:
% MALLOC = jemalloc
redis make报错的更多相关文章
- REDIS持久化报错失败
redis log报错: [7666] 15 Jan 00:22:36.028 # Error moving temp DB file on the final destination: Invali ...
- SpringBoot- springboot集成Redis出现报错:No qualifying bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory'
Springboot将accessToke写入Redisk 缓存,springboot集成Redis出现报错 No qualifying bean of type 'org.springframewo ...
- redis编译报错总结
redis编译报错总结: 1.不能编译没有GCC 编译工具安装报错:问题1:make时可能会报如下错误cc -c -std=c99 -pedantic -O2 -Wall -W -g -rdyna ...
- redis启动报错:Fatal error loading the DB: Invalid argument
redis启动报错 add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be ...
- .Net Core redis 调用报错 '6000 Redis requests per hour' 解决 6000 此调用限制
问题描述 redis 是一种基于内存,性能高效的 NoSQL 数据库,性能高主要就体现在数据交互耗时较短,能够段时快速的对用户的请求做出反应,所以在业务比较复杂或交互量需求大时,必然会超过 6000次 ...
- Ubuntu 14.04下Redis安装报错:“You need tcl 8.5 or newer in order to run the Redis test”问题解决
Redis简介: Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API.从2010年3月15日起,Redis的开发工 ...
- 非root用户启动redis容器报错mkdir: cannot create directory '/bitnami/redis': Permission denied
问题:使用docker启动容器时,报错如下 zh@debian:~/testPath$ docker-compose up redis Starting testpath_redis_1 ... do ...
- linux下安装redis组件报错-gcc报错
报错如图: 1.解决办法 先安装gcc插件.删除redis解压后文件.重新解压
- Windows 7 上面 redis 启动报错的处理
Windows 7或者是 win10 上面 安装redis 的windows 3.2.100 的版本 启动报错: Creating Server TCP listening socket *:: li ...
- 机器装多个版本php,并安装redis插件报错【已解决】
机器原版本php5.5.3 适应新的框架安装了7.1.12 期间遇到的小问题就是安装 redis插件的时候,总报错,报错如下: Starting php-fpm [02-Jan-2019 10:15: ...
随机推荐
- spring整合springmvc和mybatis
1.spring 1.1 jar包 1.2 spring基本配置,包扫描注解 <!-- 自动扫描 --> <context:component-scan base-package=& ...
- redis操作基本命令
Redis—— Remote Dictionary Server,它是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API,我们 ...
- No.1一步步学习vuejs 环境配置安装篇
一 安装与配置 需要安装node.js和 nmp管理器http://nodejs.cn/安装完后测试输入命令查看版本验证 node -v //查看node.js的版本 npm -v //查看 由于有些 ...
- spring_boot 配置
配置pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www ...
- 前端学习之路之CSS (三)
Infi-chu: http://www.cnblogs.com/Infi-chu/ 创建CSS有三种方法:外部样式表.内部样式表.内联样式.优先级:内联样式>内部样式>外部样式表> ...
- USG防火墙基础
http://support.huawei.com/huaweiconnect/enterprise/thread-331003.html 华为防火墙产品线 安全区域 1. 默认防火墙区域 T ...
- 简单理解C#中的抽象工厂模式是什么概念!
抽象工厂模式向客户端提供一个接口,使得客户端在不必指定具体类型的情况下,创建多个产品族中的对象.本文采取的仍然是接着以前的那个快餐店的例子.现在,快餐店经常良好,逐渐发展壮大,为了适合不同地方人的饮食 ...
- DBGridEh常用技巧
一.增加多表头显示方式 DBGridEh1.UseMultiTitle:=True; //打开多标题显示方式 DBGridEh1.Columns[].Title.Caption:='员工编号'; // ...
- Windows下 Mysql启动报1067解决方法
前几天刚入职安装了一下Mysql 刚开始能打开 今天去公司发现启动不了服务 报1067错误, 在网上查看了一些方法,好多种版本..以下是本人的解决方法 1.打开运行-事件查看器--Windows日 ...
- layui分页
毕业已经两年,期间经历了很多.一个人欢笑与哭泣,在墙角.在路边.在床上.每天搭乘首班车来到公司,每天无数次反省自己,每天每天再问自己为什么活着. 一.下载并引用css和js 地址:点我 <lin ...