I am trying to use redis in my nodejs project. I see that to build redis you need make command and gcc. I have instaled cygwin on my windows machine and then installed both make and gcc.
I downloaded redis from here https://redis.io/download and as per the instructions -
$ wget http://download.redis.io/releases/redis-3.2.8.tar.gz
$ tar xzf redis-3.2.8.tar.gz
$ cd redis-3.2.8
$ make
I am trying to do same, but facing some issues while building this. Here are the logs :-
D:\Node.JS\redis-3.2.8>make
cd src && make all
make[1]: Entering directory '/cygdrive/d/Node.JS/redis-3.2.8/src'
CC adlist.o
CC quicklist.o
CC ae.o
In file included from ae.c:58:0:
ae_select.c: In function 'aeApiResize':
ae_select.c:52:37: warning: unused parameter 'eventLoop' [-Wunused-parameter]
static int aeApiResize(aeEventLoop *eventLoop, int setsize) {
^~~~~~~~~
CC anet.o
CC dict.o
CC server.o
CC sds.o
CC zmalloc.o
zmalloc.c: In function 'zmalloc_get_memory_size':
zmalloc.c:421:1: warning: control reaches end of non-void function [-Wreturn-typ
e]
}
^
CC lzf_c.o
CC lzf_d.o
CC pqsort.o
CC zipmap.o
CC sha1.o
CC ziplist.o
CC release.o
CC networking.o
CC util.o
CC object.o
CC db.o
CC replication.o
CC rdb.o
CC t_string.o
CC t_list.o
CC t_set.o
CC t_zset.o
CC t_hash.o
CC config.o
CC aof.o
CC pubsub.o
CC multi.o
CC debug.o
debug.c: In function 'watchdogSignalHandler':
debug.c:1138:60: warning: unused parameter 'secret' [-Wunused-parameter]
void watchdogSignalHandler(int sig, siginfo_t *info, void *secret) {
^~~~~~
CC sort.o
CC intset.o
CC syncio.o
CC cluster.o
CC crc16.o
CC endianconv.o
CC slowlog.o
CC scripting.o
CC bio.o
CC rio.o
CC rand.o
CC memtest.o
CC crc64.o
CC bitops.o
CC sentinel.o
CC notify.o
CC setproctitle.o
CC blocked.o
CC hyperloglog.o
CC latency.o
CC sparkline.o
CC redis-check-rdb.o
CC geo.o
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/geohash-int/geohash.o: No such file or directory
cc: error: ../deps/geohash-int/geohash_helper.o: No such file or directory
make[1]: *** [Makefile:185: redis-server] Error 1
make[1]: Leaving directory '/cygdrive/d/Node.JS/redis-3.2.8/src'
make: *** [Makefile:6: all] Error 2
D:\Node.JS\redis-3.2.8>m
Can anyone help me what could be the issue ?
here the new redis 5 version compiled with info on how to do it
https://github.com/meiry/redis5_compiled_for_windows10
As #FluffyNights suggested that redis does not support windows. I made it in working mode using https://github.com/MSOpenTech/redis
Download releases from here https://github.com/MSOpenTech/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.zip then extract this compressed file.
You will find redis-server.exe there, just execute it to start redis server. This has redis client also which you can use to execute its commands to save, get etc
Related
I am trying to cross compile espeak-ng for target=arm-linux-gnueabihf
The sudo make install step gives the following error :
~:~/Downloads/Dependencies/espeak-ng-master$ sudo make install
[sudo] password for abc:
ESPEAK_DATA_PATH=../Downloads/Dependencies/espeak-ng-master src/espeak-ng --compile-intonations && \
ESPEAK_DATA_PATH=../Downloads/Dependencies/espeak-ng-master src/espeak-ng --compile-phonemes && \
touch phsource/phonemes.stamp
src/espeak-ng: line 117: ../Downloads/Dependencies/espeak-ng-master/src/.libs/espeak-ng: cannot execute binary file: Exec format error
src/espeak-ng: line 117: ../Downloads/Dependencies/espeak-ng-master/src/.libs/espeak-ng: Success
Makefile:2590: recipe for target 'phsource/phonemes.stamp' failed
make: *** [phsource/phonemes.stamp] Error 126
I have cross compiled using the following :
./configure CC=arm-linux-gnueabihf-gcc -prefix /opt/myproject-sysroot/usr --build=$MACHTYPE --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
make -B src/speak-ng src/espeak-ng
Configure output
Configuration for eSpeak NG complete.
Source code location: .
C99 Compiler: arm-linux-gnueabihf-gcc
C99 Compiler flags: -Wunused-parameter -Wunused -Wuninitialized -Wreturn-type -Wmissing-prototypes -Wimplicit -g -O2 -std=c99
Sonic: no
PCAudioLib: no
gradle (Android): gradle
ndk-build (Android):
Klatt: yes
MBROLA: yes
Async: yes
Extended Dictionaries:
Russian: no
Chinese (Mandarin): no
Chinese (Cantonese): no
~/Downloads/Dependencies/ESPEAK/espeak-ng-master$ sudo make -B src/speak-ng src/espeak-ng
Output for make command:
---------------
-----------
CC src/libespeak-ng/src_libespeak_ng_la-tr_languages.lo
CC src/libespeak-ng/src_libespeak_ng_la-voices.lo
CC src/libespeak-ng/src_libespeak_ng_la-wavegen.lo
src/libespeak-ng/wavegen.c: In function ‘WavegenFill’:
src/libespeak-ng/wavegen.c:1400:17: warning: variable ‘p_start’ set but not used [-Wunused-but-set-variable]
unsigned char *p_start;
^~~~~~~
CC src/libespeak-ng/src_libespeak_ng_la-klatt.lo
CC src/libespeak-ng/src_libespeak_ng_la-mbrowrap.lo
CC src/libespeak-ng/src_libespeak_ng_la-espeak_command.lo
CC src/libespeak-ng/src_libespeak_ng_la-event.lo
CC src/libespeak-ng/src_libespeak_ng_la-fifo.lo
CCLD src/libespeak-ng.la
arm-linux-gnueabihf-ar: `u' modifier ignored since `D' is the default (see `U')
CCLD src/speak-ng
CC src/espeak-ng.o
src/espeak-ng.c: In function ‘main’:
src/espeak-ng.c:744:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(p_text, 1, filesize, f_text);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CCLD src/espeak-ng
Make install output
~/Downloads/Dependencies/ESPEAK/espeak-ng-master$ sudo make LIBDIR=/opt/myproject-sysroot/usr install
ESPEAK_DATA_PATH=../Downloads/Dependencies/ESPEAK/espeak-ng-master src/espeak-ng --compile-intonations && \
ESPEAK_DATA_PATH=../Downloads/Dependencies/ESPEAK/espeak-ng-master src/espeak-ng --compile-phonemes && \
touch phsource/phonemes.stamp
src/espeak-ng: line 117: ../Downloads/Dependencies/ESPEAK/espeak-ng-master/src/.libs/espeak-ng: cannot execute binary file: Exec format error
src/espeak-ng: line 117: ../Downloads/Dependencies/ESPEAK/espeak-ng-master/src/.libs/espeak-ng: Success
Makefile:2590: recipe for target 'phsource/phonemes.stamp' failed
make: *** [phsource/phonemes.stamp] Error 126
I downloaded the following driver for my new HP 17z laptop running Linux Mint 19: https://github.com/endlessm/linux/tree/master/drivers/net/wireless/rtl8821ce
Upon modifying the makefile by instruction I ran the "make" command and get the following error:
z
ermacroyd#DALEK:~/Downloads/rtl8821ce$ make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.15.0-20-generic/build M=/home/zermacroyd/Downloads/rtl8821ce modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-20-generic'
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_cmd.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_security.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_debug.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_io.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_ioctl_query.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_ioctl_set.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_ieee80211.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_mlme.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_mlme_ext.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_mi.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_wlan_util.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_vht.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_pwrctrl.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_rf.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_recv.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_sta_mgt.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_ap.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_xmit.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_p2p.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_tdls.o
CC [M] /home/zermacroyd/Downloads/rtl8821ce/core/rtw_br_ext.o
In file included from ./include/linux/printk.h:350:0,
from ./include/linux/kernel.h:14,
from ./include/linux/skbuff.h:17,
from ./include/linux/if_arp.h:26,
from /home/zermacroyd/Downloads/rtl8821ce/core/rtw_br_ext.c:23:
./include/net/inet_connection_sock.h: In function ‘inet_csk_clear_xmit_timer’:
./include/linux/dynamic_debug.h:77:14: error: ‘KBUILD_MODNAME’ undeclared (first use in this function); did you mean ‘KBUILD_BASENAME’?
.modname = KBUILD_MODNAME, \
^
./include/linux/dynamic_debug.h:99:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA_KEY’
DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:125:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA’
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/printk.h:354:2: note: in expansion of macro ‘dynamic_pr_debug’
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
./include/net/inet_connection_sock.h:216:3: note: in expansion of macro ‘pr_debug’
pr_debug("%s", inet_csk_timer_bug_msg);
^~~~~~~~
./include/linux/dynamic_debug.h:77:14: note: each undeclared identifier is reported only once for each function it appears in
.modname = KBUILD_MODNAME, \
^
./include/linux/dynamic_debug.h:99:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA_KEY’
DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:125:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA’
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/printk.h:354:2: note: in expansion of macro ‘dynamic_pr_debug’
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
./include/net/inet_connection_sock.h:216:3: note: in expansion of macro ‘pr_debug’
pr_debug("%s", inet_csk_timer_bug_msg);
^~~~~~~~
./include/net/inet_connection_sock.h: In function ‘inet_csk_reset_xmit_timer’:
./include/linux/dynamic_debug.h:77:14: error: ‘KBUILD_MODNAME’ undeclared (first use in this function); did you mean ‘KBUILD_BASENAME’?
.modname = KBUILD_MODNAME, \
^
./include/linux/dynamic_debug.h:99:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA_KEY’
DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:125:2: note: in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_METADATA’
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/printk.h:354:2: note: in expansion of macro ‘dynamic_pr_debug’
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
./include/net/inet_connection_sock.h:232:3: note: in expansion of macro ‘pr_debug’
pr_debug("reset_xmit_timer: sk=%p %d when=0x%lx, caller=%p\n",
^~~~~~~~
scripts/Makefile.build:332: recipe for target '/home/zermacroyd/Downloads/rtl8821ce/core/rtw_br_ext.o' failed
make[2]: *** [/home/zermacroyd/Downloads/rtl8821ce/core/rtw_br_ext.o] Error 1
Makefile:1552: recipe for target '_module_/home/zermacroyd/Downloads/rtl8821ce' failed
make[1]: *** [_module_/home/zermacroyd/Downloads/rtl8821ce] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-20-generic'
Makefile:1897: recipe for target 'modules' failed
make: *** [modules] Error 2
The problem file is rtw_br_ext.c which uses headers from the Linux kernel. So there are NO KBUILD flags in the makefile. What is the best way to fix this?
do not make changes to the make file.
without making changes run the file and it will run Ok.
On that Github url, there is no instruction for changing the make file.
In my ubuntu 14.xx, I try to compile lsnes emulator to use the mario-ai script from aleju/mario-ai, and I've tried to google many solutions to solve the problem below:
Here is the output from the console:
make[3]: __all__.files' is up to date.
make[3]: Leaving directory/home/pengsuyu/software/lsnes/sourcecode/src/platform/macosx'
make[2]: Leaving directory /home/pengsuyu/software/lsnes/sourcecode/src/platform'
g++ -o lsnescat all_common.files all_platform.files-pthread -lboost_iostreams -lboost_filesystem -lboost_system -lz -lgcrypt -lgpg-error -L/usr/lib/x86_64-linux-gnu -lcurl -rdynamic -ldlcat core/all.ldflags lua/all.ldflags fonts/all.ldflags library/all.ldflags interface/all.ldflags video/all.ldflags emulation/all.ldflags cmdhelp/all.ldflags platform/all.ldflags
core/multitrack.o: In functionlua::state::get_string(int, std::string const&)':
/home/pengsuyu/software/lsnes/sourcecode/src/core/../../include/library/lua-base.hpp:317: undefined reference to lua_tolstring'
core/multitrack.o: In functionlua::state::get_bool(int, std::string const&)':
/home/pengsuyu/software/lsnes/sourcecode/src/core/../../include/library/lua-base.hpp:334: undefined reference to lua_toboolean'
core/multitrack.o: In functionlua::state::type(int)':
.
.
/home/pengsuyu/software/lsnes/sourcecode/src/library/lua.cpp:536: undefined reference to lua_close'
library/lua.o: In functionlua::state::pushcfunction(int ()(lua_State))':
/home/pengsuyu/software/lsnes/sourcecode/src/library/../../include/library/lua-base.hpp:504: undefined reference to lua_pushcclosure'
library/lua.o: In functionlua::state::getfield(int, char const*)':
/home/pengsuyu/software/lsnes/sourcecode/src/library/../../include/library/lua-base.hpp:506: undefined reference to lua_getfield'
library/lua.o: In functionlua::state::insert(int)':
/home/pengsuyu/software/lsnes/sourcecode/src/library/../../include/library/lua-base.hpp:509: undefined reference to lua_insert'
collect2: error: ld returned 1 exit status
make[1]: *** [lsnes] Error 1
make[1]: Leaving directory/home/pengsuyu/software/lsnes/sourcecode/src'
make: *** [src/all_files] Error 2
==================================
At the beginning, I think, the linker cannot find my lua library. So I tried to compile my main.cpp with test.lua.
main.cpp:
#include <stdio.h>
#include <iostream>
//extern "C"
//{
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
//} // liblua5.1-c++.a
lua_State * L;
int main ()
{
L = lua_open();
luaL_openlibs(L);
luaL_dofile(L, "d:\\test.lua");
return 0;
}
test.lua:
print("Hello World");
I write a MakeFile to generate the executable file "main":
main:main.o
gcc -o $# $< -llua5.1 -lstdc++
main.o:
gcc -c main.cpp
clean:
-rm *.o
It works when I add the compile option "-llua5.1" and "-lstdc++" otherwise it throws the same error as I compiled lsnes
I am not familiar with gcc and Makefile. Please help me to solve this problem.
I've solved my question
The way to solve this problem is just to change one line in the file named "options.build".
1. find the line "LUA=lua" in options.build
2. change this line to "LUA=lua5.1"
because the needed library is 5.1, so if you want to build it successfully, you must use the "lua5.1" library however the default configuration is "lua" not "lua5.1"
I have this code for the hello world module :
#include <linux/module.h>
#include <linux/kernel.h>
int init_module(void)
{
printk(KERN_INFO "Hello module\n");
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO "Bye module\n");
}
Makefile :
obj-m := hello.o
K := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all:
make -C $(K) M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
I get this compile message from the makefile :
make -C /lib/modules/3.16.0-4-amd64/build M=/home/neo/ker modules
make[1]: Entering directory '/usr/src/linux-headers-3.16.0-4-amd64'
Makefile:10: *** mixed implicit and normal rules: deprecated syntax
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-4-amd64'
CC [M] /home/neo/ker/hello.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/neo/ker/hello.mod.o
LD [M] /home/neo/ker/hello.ko
make[1]: Leaving directory '/usr/src/linux-headers-3.16.0-4-amd64'
this is the warning that i don't understand:
Makefile:10: *** mixed implicit and normal rules: deprecated syntax
Thanks in advance
[il#vmarch openwrt]$ make V=99
...
make -C /home/il/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.36 HOSTCFLAGS="-O2 -I/home/il/openwrt/staging_dir/host/include -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="mips-openwrt-linux-uclibc-" ARCH="mips" KBUILD_HAVE_NLS=no CONFIG_SHELL="/usr/bin/bash" V='' CC="mips-openwrt-linux-uclibc-gcc" modules
make[5]: Entering directory '/home/il/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.36'
...
CC [M] net/netfilter/xt_comment.o
net/netfilter/xt_comment.c:1:1: error: expected identifier or '(' before numeric constant
0 0
^
How to make it print gcc ... instead of CC [M]
According to make help:
make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
make V=2 [targets] 2 => give reason for rebuild of target
No V=99 anywhere... just use V=1 to see the commands run.