Vijay
Vijay

Reputation: 1566

Redis Installation fails with "Newer version of jemalloc required" when running make command

Redis installation on RHEL fails when running make command. Below is the output

cd src && make all
make[1]: Entering directory `/root/Downloads/redis-3.2.0/src'
    CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/root/Downloads/redis-3.2.0/src'
make: *** [all] Error 2

Upvotes: 21

Views: 31870

Answers (10)

Kishore Venkataramanan
Kishore Venkataramanan

Reputation: 7139

Ditch the OS based installation, tried multiple solutions some dependency was always failing

Node to the rescue

There are other ways to install Node and NPM below steps is using Yum on Centos / RHEL

# Add NodeSource yum repository
curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -

# Additional dependencies if required
yum install gcc-c++ make -y

# Install Node.js and npm 
yum install nodejs -y

# install redis-cli
npm install -g redis-cli

# connect to redis endpoint
rdcli -h redis.host
 # or
rdcli -h redis.host -a redis.password -p 1111

once connected run

PING

response should be

PONG

to validate the connectivity

cache.amazonaws.com:6379> PING
PONG

Upvotes: 3

Erdal Kaya
Erdal Kaya

Reputation: 1

You should use Ubuntu PPA

$ sudo add-apt-repository ppa:redislabs/redis
$ sudo apt-get update
$ sudo apt-get install redis

Upvotes: 0

Sm Srikanth
Sm Srikanth

Reputation: 2360

In linux

May be some of the files required are missing which can be installed with libc6-dev package.

This worked for me:-

Go to your redis directory and run the following in your terminal:-

sudo apt-get install libc6-dev
make distclean && make

Upvotes: 1

Michele
Michele

Reputation: 29

on centos

yum install gcc glibc
tar zxvf redis-5.0.3.tar.gz
cd redis-5.0.3
cd deps
make hiredis jemalloc linenoise lua geohash-int
cd ..
make install
cd utils
./install_server.sh

extra tips

To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
    The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128

Upvotes: 0

manendra
manendra

Reputation: 131

It happen due to gcc compiler not available in machine. first install gcc:

$ sudo apt install gcc

then try

make

sure it'll resolve this issue . I tried on ubuntu 18.04.

Upvotes: 7

JMess
JMess

Reputation: 672

This error may indicate that you need to run make with sudo: sudo make

You may afterwards run into:

../deps/jemalloc/lib/libjemalloc.a(nstime.o): In function nstime_get':     /opt/redis_src/current/redis-stable/deps/jemalloc/src/nstime.c:120:     undefined reference toclock_gettime'

If so, please see: https://github.com/antirez/redis/issues/3790

Upvotes: 0

Rakesh Venkat
Rakesh Venkat

Reputation: 89

Redis creates the redis-server and redis-cli files only after the Dependenices in the /deps directory: hiredis lua jemalloc linenoise are resolved. I had to run the make command in the deps directory more than once to get the depenedencies resolved.

The following are the Steps I followed:

cd <redisInstallationPath> (I have it under /opt/mount1/redis-3.0.7)
make distclean
cd deps/

Resolve dependecies more than once.

make lua hiredis linenoise
make jemalloc
make hiredis
make linenoise

Did the same again as there were a few missing files. I think you just need to get the combination correct. Run the make command more than once till you get it right.

make hiredis lua jemalloc linenoise
make hiredis
make lua 
make jemalloc 
make linenoise

cd /opt/mount1/redis-3.0.7/
make

-> I got some errors here that the file hiredis/libhiredis.a is not found and hence I continued again to resolve dependecies.

cd deps
make jemalloc 
make hiredis

ll hiredis/libhiredis.a -> yields a file

cd /opt/mount1/redis-3.0.7/
make

Now I get the following output:

cd src && make all
make[1]: Entering directory `/opt/mount1/redis-3.0.7/src'
LINK redis-server
INSTALL redis-sentinel
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
CC redis-check-dump.o
LINK redis-check-dump
CC redis-check-aof.o
LINK redis-check-aof

Hint: It's a good idea to run 'make test' ;)

make[1]: Leaving directory `/opt/mount1/redis-3.0.7/src'

You can go to Redis installation path (in my case: /opt/mount1/redis-3.0.7 directory) to start the Server.

src/redis-server

And in another terminal run 'redis-cli' to connect to the Redis Server.

src/redis-cli

Example:

127.0.0.1:6379> incr counter
(integer) 1
127.0.0.1:6379> get counter
"1"
127.0.0.1:6379> exit

I got a solution to my problem through this article http://michael.otacoo.com/redis/redis-first-steps-fetch-install-and-server-creation/

Upvotes: 4

Vijay
Vijay

Reputation: 1566

running

make distclean

and then

make

solved the issue

Upvotes: 123

Jerry
Jerry

Reputation: 492

I guess the version 3.2.0 lost some files because I have met the same problem as you, I solved it by downloading another redis version 3.0.7, the download link is

http://download.redis.io/releases/redis-3.0.7.tar.gz

Then, decompress the file and run the command as you have done before, just step into the redis directory and type the command 'make'

Good luck with you

Upvotes: 0

Vikram Tiwari
Vikram Tiwari

Reputation: 3905

That shouldn't be happening. One possible reason could be that your make tools are way older than current version. To update them run:

yum install make gcc gcc-c++ kernel-devel

This will install minimum packages, but if even that doesn't solves the problem, try installing the complete group:

yum install make gcc gcc-c++ kernel-devel

Read More: https://superuser.com/questions/151557/what-are-build-essential-build-dep

Upvotes: 0

Related Questions