Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor issue to build dict-benchmark #3944

Closed
jaebaek opened this issue Apr 17, 2017 · 5 comments
Closed

Minor issue to build dict-benchmark #3944

jaebaek opened this issue Apr 17, 2017 · 5 comments

Comments

@jaebaek
Copy link

jaebaek commented Apr 17, 2017

Hi, I tried to build dict-benchmark and saw some error messages because some references like jemalloc_XXX functions are missed.

I guess this is a minor issue but the current makefile incurs this problem.
At line 217 and 218 of src/Makefile,

dict-benchmark: dict.c zmalloc.c sds.c
$(REDIS_CC) $(FINAL_CFLAGS) dict.c zmalloc.c sds.c siphash.c -D DICT_BENCHMARK_MAIN -o dict-benchmark

could be changed such as

dict-benchmark: dict.c zmalloc.c sds.c
$(REDIS_CC) $(FINAL_CFLAGS) $^ -D DICT_BENCHMARK_MAIN -o $@ $(FINAL_LIBS)

Thanks,
Jaebaek

@charsyam
Copy link
Contributor

@jaebaek Hi jaebaek. In my case, I made it easily(on OSX)
so What is your os and environment?

charsyam@charsyamui-MacBook-Pro:~/works/redis/$ ./dict-benchmark
Inserting: 5000000 items in 2984 ms
Linear access of existing elements: 5000000 items in 1448 ms
Linear access of existing elements (2nd round): 5000000 items in 1418 ms
Random access of existing elements: 5000000 items in 2048 ms
Accessing missing: 5000000 items in 1546 ms
Removing and adding: 5000000 items in 3673 ms

@jaebaek
Copy link
Author

jaebaek commented Apr 17, 2017

I guess the reason why you did not meet the problem is because redis sets libc's malloc as default on OSX.
In Linux, redis sets jemalloc as the default.

By the way,

$ uname -a

showed me

Linux jaebaek-sgx 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I installed Ubuntu 16.04

I tried

$ make
$ cd src
$ make dict-benchmark

and it showed me

CC Makefile.dep
CC dict-benchmark

/tmp/ccvBGxxm.o: In function zmalloc': /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:107: undefined reference to je_malloc'
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:111: undefined reference to je_malloc_usable_size' /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:111: undefined reference to je_malloc_usable_size'
/tmp/ccvBGxxm.o: In function zmalloc_no_tcache': /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:125: undefined reference to je_mallocx'
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:127: undefined reference to je_malloc_usable_size' /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:127: undefined reference to je_malloc_usable_size'
/tmp/ccvBGxxm.o: In function zfree_no_tcache': /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:133: undefined reference to je_malloc_usable_size'
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:133: undefined reference to je_malloc_usable_size' /tmp/ccvBGxxm.o: In function zcalloc':
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:139: undefined reference to je_calloc' /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:143: undefined reference to je_malloc_usable_size'
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:143: undefined reference to je_malloc_usable_size' /tmp/ccvBGxxm.o: In function zrealloc':
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:161: undefined reference to je_malloc_usable_size' /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:162: undefined reference to je_realloc'
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:166: undefined reference to je_malloc_usable_size' /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:166: undefined reference to je_malloc_usable_size'
/tmp/ccvBGxxm.o: In function zfree': /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:203: undefined reference to je_malloc_usable_size'
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:203: undefined reference to je_malloc_usable_size' /tmp/ccvBGxxm.o: In function zfree_no_tcache':
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:134: undefined reference to je_dallocx' /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:134: undefined reference to je_dallocx'
/tmp/ccvBGxxm.o: In function zfree': /home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:204: undefined reference to je_free'
/home/jaebaek/sgx-mutual-untrust/graphene-and-sdk/redis/src/zmalloc.c:204: undefined reference to `je_free'
collect2: error: ld returned 1 exit status
Makefile:218: recipe for target 'dict-benchmark' failed
make: *** [dict-benchmark] Error 1

@badboy
Copy link
Contributor

badboy commented Apr 17, 2017

Send a PR, indeed fails on Linux

@charsyam
Copy link
Contributor

@jaebaek Cool. It is easily reproduced :) Thanks.

@antirez
Copy link
Contributor

antirez commented Apr 18, 2017

Thanks @badboy, PR merged.

antirez pushed a commit that referenced this issue Apr 18, 2017
JackieXie168 pushed a commit to JackieXie168/redis that referenced this issue May 16, 2017
GitHubMota pushed a commit to GitHubMota/redis that referenced this issue Jul 25, 2017
JackieXie168 pushed a commit to JackieXie168/redis that referenced this issue Aug 20, 2017
pulllock pushed a commit to pulllock/redis that referenced this issue Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants