Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

redis 2.6 stable install fail on Ubuntu 12.04.1 LTS #722

Closed
ardsu opened this Issue Oct 23, 2012 · 44 comments

Comments

Projects
None yet

ardsu commented Oct 23, 2012

sudo make install

make[1]: Entering directory /home/richard/redis-2.6.0/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 compilation terminated. make[1]: *** [adlist.o] Error 1 make[1]: Leaving directory/home/richard/redis-2.6.0/src'
make: *** [install] Error 2

Contributor

charsyam commented Oct 23, 2012

maybe you need to install jemalloc. you can download it from below site.
http://www.canonware.com/jemalloc/

ardsu commented Oct 24, 2012

after install jemalloc

sudo make install

cd src && make install
make[1]: Entering directory /home/richard/redis-2.6.0/src' LINK redis-server cc: error: ../deps/hiredis/libhiredis.a: No such file or directory cc: error: ../deps/lua/src/liblua.a: No such file or directory cc: error: ../deps/jemalloc/lib/libjemalloc.a: No such file or directory make[1]: *** [redis-server] Error 1 make[1]: Leaving directory/home/richard/redis-2.6.0/src'
make: *** [install] Error 2

Contributor

charsyam commented Oct 24, 2012

Hi ardsu. When did you download redis 2.6.0 stable? maybe I think you downloaded 2.6.0-rc8, It is same symptom when I downloaded 2.6.0-rc8, try to download 2.6.0 in redis.io.

ardsu commented Oct 25, 2012

thanks for answer.
i'm sure.it it 2.6.0.
libhiredis.a and liblua.a and libjemalloc.a should have done in package,but files no in package。

Contributor

charsyam commented Oct 25, 2012

hi ardsu and antirez, I think it is not only because of sync_file_range. The behavior of Makefile is somewhat different. I found that it doesn't run "cd deps; make hiredis lua jemalloc linenoise" , try this https://github.com/charsyam/redis-2.6.0-rh5.git maybe you can build it well

ardsu commented Oct 29, 2012

successed install redis 2.6.2 .

I just had the same problem with 2.6.4 - have to manually cd deps; make hiredis lua jemalloc linenoise first before the main make

(I also had to install gcc first before any of above, on a fresh Ubuntu 12.04 EC2 instance - should mention in the instructions too maybe, for noobs like me)

the download instructions on the website currently say:

Download, extract and compile Redis with:
$ wget http://redis.googlecode.com/files/redis-2.6.4.tar.gz
$ tar xzf redis-2.6.4.tar.gz
$ cd redis-2.6.4
$ make

guersam commented Nov 22, 2012

The same with @anentropic on Ubuntu JeOS 12.04.

Owner

antirez commented Nov 22, 2012

Hello, I just tested under Ubuntu 12.04 without any issue at all following the same instructions... so without further details I'm unlikely to be able to fix this for lack of reproducibility.

Cheers,
Salvatore

Contributor

charsyam commented Nov 22, 2012

@guersam is it 32bit? or 64bit OS?

Owner

antirez commented Nov 22, 2012

I tried with both btw (make 32 also). My ubuntu ships with make version 3.81

On Thu, Nov 22, 2012 at 10:55 AM, charsyam notifications@github.com wrote:

@guersam https://github.com/guersam is it 32bit? or 64bit OS?


Reply to this email directly or view it on GitHubhttps://github.com/antirez/redis/issues/722#issuecomment-10628987.

Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org

Beauty is more important in computing than anywhere else in technology
because software is so complicated. Beauty is the ultimate defence against
complexity.
— David Gelernter

I'm using the following EC2 AMI provided by Ubuntu:

AMI: ubuntu/images/ebs/ubuntu-precise-12.04-amd64-server-20121001 (ami-c1aaabb5)

Owner

antirez commented Nov 22, 2012

Please could you report the full output of the failed compilation? Thanks.

Contributor

charsyam commented Nov 22, 2012

I try to reproduce this bug m1.small ec2 64bit ubuntu 12.04 but it compiled well 2.6.4
and after apt-get install build-essential it's make version is 3.81
what is your ec2 instance model?

I think maybe doing sudo apt-get install build-essential first is the difference. I didn't know to do that.

I have just reproduced using a clean instance of the AMI I gave above (ami-c1aaabb5). I do:

ubuntu@:~$ wget http://redis.googlecode.com/files/redis-2.6.4.tar.gz
--2012-11-22 10:37:46--  http://redis.googlecode.com/files/redis-2.6.4.tar.gz
Resolving redis.googlecode.com (redis.googlecode.com)... 74.125.24.82, 2a00:1450:400c:c05::52
Connecting to redis.googlecode.com (redis.googlecode.com)|74.125.24.82|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 978759 (956K) [application/x-gzip]
Saving to: `redis-2.6.4.tar.gz'

100%[===========================================================================================>] 978,759     --.-K/s   in 0.08s   

2012-11-22 10:37:46 (12.2 MB/s) - `redis-2.6.4.tar.gz' saved [978759/978759]

ubuntu@:~$ tar xzf redis-2.6.4.tar.gz
ubuntu@:~$ cd redis-2.6.4/
ubuntu@:~/redis-2.6.4$ make
The program 'make' is currently not installed.  You can install it by typing:
sudo apt-get install make
ubuntu@:~/redis-2.6.4$ sudo apt-get install make
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  make-doc
The following NEW packages will be installed:
  make
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 118 kB of archives.
After this operation, 328 kB of additional disk space will be used.
Get:1 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ precise/main make amd64 3.81-8.1ubuntu1 [118 kB]
Fetched 118 kB in 0s (1,547 kB/s)
Selecting previously unselected package make.
(Reading database ... 25372 files and directories currently installed.)
Unpacking make (from .../make_3.81-8.1ubuntu1_amd64.deb) ...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-31-virtual
Processing triggers for man-db ...
Setting up make (3.81-8.1ubuntu1) ...
ubuntu@:~/redis-2.6.4$ make
cd src && make all
make[1]: Entering directory `/home/ubuntu/redis-2.6.4/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[2]: Entering directory `/home/ubuntu/redis-2.6.4/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 `/home/ubuntu/redis-2.6.4/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic >> .make-settings
echo WARN=-Wall >> .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 -Wall -O2 -g -rdynamic -ggdb   -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS=  -g -rdynamic -ggdb >> .make-settings
(cd ../deps && make hiredis linenoise lua jemalloc)
make[2]: Entering directory `/home/ubuntu/redis-2.6.4/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-ldflags)
(echo "" > .make-cflags)
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory `/home/ubuntu/redis-2.6.4/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 `/home/ubuntu/redis-2.6.4/deps/hiredis'
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/home/ubuntu/redis-2.6.4/deps'
make[1]: [persist-settings] Error 2 (ignored)
    CC adlist.o
/bin/sh: 1: cc: not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/home/ubuntu/redis-2.6.4/src'
make: *** [all] Error 2
ubuntu@:~/redis-2.6.4$ 

I note that it says make[3]: gcc: Command not found near the end there. So I do a sudo apt-get install gcc (which fails, prompting to sudo apt-get update which I do and try again)

I then try Redis again:

ubuntu@:~/redis-2.6.4$ make clean
cd src && make clean
make[1]: Entering directory `/home/ubuntu/redis-2.6.4/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
make[1]: Leaving directory `/home/ubuntu/redis-2.6.4/src'
ubuntu@:~/redis-2.6.4$ make
cd src && make all
make[1]: Entering directory `/home/ubuntu/redis-2.6.4/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
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/home/ubuntu/redis-2.6.4/src'
make: *** [all] Error 2

Fail, but I am able to install Redis by following the extra steps:

cd deps
make hiredis lua jemalloc linenoise
cd ../
make

I was also able to install Redis following the instructions from the website on another instance, where I had already installed other software. I guess one of them had installed the prerequisites for me.

Contributor

charsyam commented Nov 22, 2012

@anentropic @antirez I finally found the reason. it is because of .make-* files
after first building failure, it already made some .make-*files
so it disturbs building of redis server.
remove dep/.make-cflags deps/.make-ldflags deps/.make-prerequisites
and remove src/.make-prerequisites src/.make-setting

exactly. it is because of src/.make-* files.

and make again. It will work well!.

@antirez. I have a question why do you use .make-prerequisites? It is just from my curious. thank you.

hmm. In Makefile, there is distclean option.
just run

 make distclean 

guersam commented Nov 22, 2012

@charsyam It was 64bit, but you already found out the clue, thanks!

bgSosh commented Feb 5, 2013

I'm had the same issue building the latest stable (2.6.9) on Debian Squeeze 64.

zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"

I don't know what jemalloc is, and it doesnt' seem to be available from apt-get

The fix posted above seems to have fixed it:

cd deps
make hiredis lua jemalloc linenoise

Are these steps supposed to be necessary? If so please could they be added to the installation notes on the download page?

Contributor

charsyam commented Feb 5, 2013

@bgSosh I think you need "make distclean"

@charsyam I tryed "make distclean". But the issue still exist.

[root@localhost redis-2.6.10]# make
cd src && make all
make[1]: Entering directory /root/redis-2.6.10/src'
CC adlist.o
In file included from zmalloc.h:50,
from adlist.c:34:
../deps/jemalloc/include/jemalloc/jemalloc.h:41: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:43: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:45: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:47: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:49: warning:nonnull' attribute directive ignored
../deps/jemalloc/include/jemalloc/jemalloc.h:49: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:51: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:52: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:53: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:57: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:61: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:65: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:67: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:69: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:71: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:73: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:77: warning: nonnull' attribute directive ignored
../deps/jemalloc/include/jemalloc/jemalloc.h:77: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:79: warning:nonnull' attribute directive ignored
../deps/jemalloc/include/jemalloc/jemalloc.h:79: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:81: warning: nonnull' attribute directive ignored
../deps/jemalloc/include/jemalloc/jemalloc.h:81: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:83: warning:nonnull' attribute directive ignored
../deps/jemalloc/include/jemalloc/jemalloc.h:83: visibility arg must be one of "hidden", "protected" or "internal"
../deps/jemalloc/include/jemalloc/jemalloc.h:84: visibility arg must be one of "hidden", "protected" or "internal"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/root/redis-2.6.10/src'
make: *** [all] Error 2

help!!

Contributor

charsyam commented Mar 10, 2013

@superqbb hi. I am sorry, I don't know your situation.

Plz, Just try next step:

[root@localhost redis-2.6.10]# apt-get install build-essential
[root@localhost redis-2.6.10]# make distclean
[root@localhost redis-2.6.10]# cd deps; make; cd ..
[root@localhost redis-2.6.10]# cd src; make; cd ..

good luck.

see issue #706

AlekSi commented Mar 27, 2013

make distclean fixed it. @antirez may you mention it instead of make clean in README?

I faced this issue but in a really weird way. I have 2 micro instances using Amazon Kernel :
Linux ip-10-226-117-251 3.4.37-40.44.amzn1.x86_64 #1 SMP Thu Mar 21 01:17:08 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

The weird thing was that in the first, the make runs flawlessly. In the 2nd I compiled the deps first. Still trying to dig what happened there.

got the same issue that jemalloc.h was not found, with redis redis-2.6.16, on ubuntu server 12.0.4..3 LTS. and Following instructrions describes by @anentropic solved it.

@ic ic added a commit to ic/redis that referenced this issue Mar 10, 2014

@ic ic Makefile should build dependencies before install.
antirez#722

This fix proposes to make the `install` rule to depends on a new one,
named `deps`, that builds first all dependencies.

Tested on Ubuntu 12.0.4.3 LTS.
f3fb4b2

ic commented Mar 10, 2014

Same situation with redis-2.8.7 on Ubuntu 12.0.4.3 LTS.
Building the dependencies first as suggested by @anentropic works still:
cd deps; make hiredis lua jemalloc linenoise

Simple proposal to fix this issue: ic/redis@f3fb4b2

Owner

antirez commented Mar 10, 2014

Hello, thanks for reporting this issue. The proposed fix is not the right one IMHO, since the Makefile, in theory (read: even if it is not working in some case) should build dependencies by forcing the ".make-prerequisite" target as first.

Basically every object depends on .make-prerequisite:

%.o: %.c .make-prerequisites

And .make-prerequisites depends on persist-settings, which is the target that will build dependencies:

.make-prerequisites: persist-settings

However the above is only optionally included, depending on the fact that the current CFLAGS are the same as the one generated previously. I've some feeling that the following line is not working as expected in certain setups:

ifneq ($(strip $(PREV_FINAL_CFLAGS)), $(strip $(FINAL_CFLAGS)))

I'll try to reproduce here to see if I can fix it, I use Ubuntu extensively and I never seen anything like that.

bunkat commented May 4, 2014

I just hit this same issue with a clean install of Ubuntu 14.04 server on a physical machine. cd deps; make hiredis lua jemalloc linenoise worked for me as well.

Collaborator

badboy commented May 4, 2014

A make distclean would probably have worked as well.

Same issue with redis(2.8) on Ubuntu 12.04.Make distclean fixed it.

Sorry: not Redis2.6* but this page is a likely hit and this will help someone I hope:

redis-2.8.9 .::. 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

v---

\o/ All tests passed without errors!

Cleanup: may take some time... OK
make[1]: Leaving directory `/home/floadmin/redis-2.8.9/src'
floadmin@scheduler-redis:~/redis-2.8.9$ uname -a
Linux scheduler-redis 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

^--- this was on a Azure Ubuntu VM. Good grief what a disaster.

I basically used this post and comments to play whack-a-mole with the half-dozen or so out-of-the-box missing dependencies issues. FWIW, on a clean Azure/Ubuntu image apt-get update / upgrade / build-essential as baseline, as indicated above additional apt-get install of make and gcc were required. As above manual make of deps/* required. And finally, apt-get install tcl in order to execute your final make test.

Same issue here with 2.8.13, this solved it:
cd deps
make hiredis lua jemalloc linenoise
cd ../
make

g-p-g commented Jul 16, 2014

"Simple" way to reproduce it: create a new droplet for Ubuntu 14.04 x64 at digitalocean (I'm not associated to it in any way); download redis 2.8.13; apt-get install the bare minimum to be able to compile it; make; link step fails as mentioned in the third comment.

Meekohi commented Sep 9, 2014

make distclean worked for me, but I had been trying make clean with no success.

make distclean also worked for me, make clean nope.

编译的时候会出现一些怪问题, 如我在挂载的NTFS盘下,就无法编译,而移到ext4下就可以编译!

pctj101 commented Mar 30, 2015

FYI, I found this happens when:
A build is run while jemalloc/libtool or other dependencies are NOT on the system.
Then these dependencies are installed
Then a make is run again (then the deps can't link properly)

Thus a distclean fixes this out-of-order execution problem.

elciopa commented Jun 10, 2015

make distclean has also worked for me. Thanks for the tip!

McFarts commented Mar 9, 2016

Same here, tried to install on Debian 7, 64-bit got same error here 4 years later 🌴

I followed this guide:

http://redis.io/topics/quickstart

@antirez Maybe add make distclean on the quickstart page somewhere for future redis users? 👯 make distclean worked for me by the way

I came across this same issue with installing 3.2 from source on ubuntu 14.04. make distclean was the solution for missing lua and geo dependency errors.

Echoing @McFarts that adding make distclean to the quickstart and/or README would be beneficial.

This thread saved me. A simple make (on Ubuntu 14.04) definitely didn't work.

Following steps worked for me:

  1. sudo apt-get update
  2. sudo apt-get install build-essential
  3. sudo apt-get install tcl8.5
  4. wget http://download.redis.io/redis-stable.tar.gz
  5. tar xvzf redis-stable.tar.gz
  6. cd redis-stable
  7. make

Just wanted to add that I had to run make distclean as sudo to get this working.

@badboy badboy closed this Jul 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment