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

Compilation Issue on MacOS Sierra v10.12.6 #42

Open
muthuswamy opened this issue Jul 19, 2018 · 2 comments
Open

Compilation Issue on MacOS Sierra v10.12.6 #42

muthuswamy opened this issue Jul 19, 2018 · 2 comments

Comments

@muthuswamy
Copy link

muthuswamy commented Jul 19, 2018

When I tried to compile on MacOS, I get the following:
$make all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../RedisModulesSDK/rmutil
gcc -g -fPIC -O3 -std=gnu99 -Wall -Wno-unused-function -I../ -c -o periodic.o periodic.c
periodic.c:34:5: warning: implicit declaration of function 'clock_gettime' is invalid in C99
[-Wimplicit-function-declaration]
clock_gettime(CLOCK_REALTIME, &ts);
^
periodic.c:34:19: error: use of undeclared identifier 'CLOCK_REALTIME'
clock_gettime(CLOCK_REALTIME, &ts);
^
1 warning and 1 error generated.
make[1]: *** [periodic.o] Error 1
make: *** [rmutil] Error 2

How can resolve the issue? Where should I declare CLOCK_REALTIME?
The command, $uname -s returns the value as Darwin

Also, I am new to use of redis module. So, appreciate your time to resolve this issue. Thank you,

@danni-m
Copy link
Owner

danni-m commented Sep 30, 2018

This is weird, it works on my mac:

$ make all
/Library/Developer/CommandLineTools/usr/bin/make -C ../RedisModulesSDK/rmutil
make[1]: Nothing to be done for `all'.
cc -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o module.o module.c
clang: warning: -lc: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
cc -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o tsdb.o tsdb.c
clang: warning: -lc: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
cc -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o compaction.o compaction.c
clang: warning: -lc: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
cc -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o rdb.o rdb.c
clang: warning: -lc: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
cc -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o chunk.o chunk.c
clang: warning: -lc: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
cc -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o parse_policies.o parse_policies.c
clang: warning: -lc: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
cc -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o config.o config.c
clang: warning: -lc: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
ld -o redis-tsdb-module.so module.o tsdb.o rdb.o compaction.o chunk.o parse_policies.o config.o -bundle -undefined dynamic_lookup  -L../RedisModulesSDK/rmutil -lrmutil -lc
ld: warning: No version-min specified on command line

Also with gcc-7:

 ✘ dannimoiseyev@Dannis-MBP  ~/code/timeseries-rl/src   master ●  CC=gcc-7 make clean all
rm -rf *.xo *.so *.o ./tests_runner
/Library/Developer/CommandLineTools/usr/bin/make -C ../RedisModulesSDK/rmutil
make[1]: Nothing to be done for `all'.
gcc-7 -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o module.o module.c
gcc-7 -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o tsdb.o tsdb.c
gcc-7 -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o compaction.o compaction.c
gcc-7 -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o rdb.o rdb.c
gcc-7 -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o chunk.o chunk.c
gcc-7 -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o parse_policies.o parse_policies.c
gcc-7 -I../RedisModulesSDK -Wall -g -fPIC -lc -lm -std=gnu99  -DREDIS_MODULE_TARGET   -c -o config.o config.c
ld -o redis-tsdb-module.so module.o tsdb.o rdb.o compaction.o chunk.o parse_policies.o config.o -bundle -undefined dynamic_lookup  -L../RedisModulesSDK/rmutil -lrmutil -lc
ld: warning: No version-min specified on command line

@danni-m
Copy link
Owner

danni-m commented Sep 30, 2018

image

I don't have access to Sierra machine at the moment,
Try to reftech the submodules and use clang instead

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

2 participants