[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.
Related
I am a beginner of Fortran and running a model written by Fortran. When I tried to compile it, I got an error message like:
libtool: link: (cd ".libs" && rm -f "libgrib_api_f77.so" && ln -s "libgrib_api_f77.so.1.0.0" "libgrib_api_f77.so")
libtool: link: ar cru .libs/libgrib_api_f77.a grib_fortran.o grib_f77.o
libtool: link: ranlib .libs/libgrib_api_f77.a
libtool: link: ( cd ".libs" && rm -f "libgrib_api_f77.la" && ln -s "../libgrib_api_f77.la" "libgrib_api_f77.la" )
gfortran -c -o same_int_long.o same_int_long.f90
same_int_long.f90:23:18:
17 | call check_long(x2(1),x2(2),ret)
| 2
......
23 | call check_long(x4(1),x4(2),ret)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/INTEGER(2)).
same_int_long.f90:29:18:
17 | call check_long(x2(1),x2(2),ret)
| 2
......
29 | call check_long(x8(1),x8(2),ret)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/INTEGER(2)).
same_int_long.f90:51:17:
45 | call check_int(x2(1),x2(2),ret)
| 2
......
51 | call check_int(x4(1),x4(2),ret)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/INTEGER(2)).
same_int_long.f90:57:17:
45 | call check_int(x2(1),x2(2),ret)
| 2
......
57 | call check_int(x8(1),x8(2),ret)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/INTEGER(2)).
make[2]: *** [Makefile:546: same_int_long.o] Error 1
make[2]: Leaving directory '/gpfs/home3/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source/fortran'
make[1]: *** [Makefile:604: all-recursive] Error 1
make[1]: Leaving directory '/gpfs/home3/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source'
make: *** [Makefile:398: /home/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source-LXgfortran/include/grib_api.mod] Error 2
What I did is basically following the installation of the model:
Step1
(base) [eccei339#int3 ~]$ mkdir snellius_surfex
(base) [eccei339#int3 ~]$ cp open_surfex_v8_1_20200107.tar-2.gz snellius_surfex/
(base) [eccei339#int3 ~]$ cd snellius_surfex/
(base) [eccei339#int3 snellius_surfex]$ tar zxvf open_surfex_v8_1_20200107.tar-2.gz
…(omit the tar zxvf logging information)
Step 2: some essential env variable
(base) [eccei339#int3 snellius_surfex]$ export VER_MPI="NOMPI"
(base) [eccei339#int3 snellius_surfex]$ export OMP_NUM_THREADS=1
(base) [eccei339#int3 snellius_surfex]$ module load 2021
(base) [eccei339#int3 snellius_surfex]$ module load GCC/10.3.0
(base) [eccei339#int3 snellius_surfex]$ ls
open_SURFEX_V8_1 open_surfex_v8_1_20200107.tar-2.gz
(here I exported some necessary envi var following the instructions of installation of the software)
Step 3: configure
(base) [eccei339#int3 snellius_surfex]$ cd open_SURFEX_V8_1/src/
(base) [eccei339#int3 src]$ ls
ASSIM Makefile Rules.bullXI15.mk Rules.MCgfortran.mk SURFEX
configure Makefile.SURFEX.mk Rules.bullXI16.mk Rules.SX8.mk
FORC OFFLIN Rules.LXgfortran.mk Rules.zgfortran.mk
include Rules.AIX64.mk Rules.LXifort.mk Rules.zifort.mk
LIB Rules.bgfortran.mk Rules.LXpgi.mk scripts
(base) [eccei339#int3 src]$ ./configure
(omit the long logging info of the “configure” command)
(base) [eccei339#int3 src]$ . ../conf/profile_surfex-LXgfortran-SFX-V8-1-1-NOMPI-OMP-O2-X0
(an essential step following the instructions of installation of the software)
Step 4: make the master
(base) [eccei339#int3 src]$ make
find: ‘/home/eccei339/snellius_surfex/open_SURFEX_V8_1/src/dir_obj-LXgfortran-SFX-V8-1-1-NOMPI-OMP-O2-X0/MASTER’: No such file or directory
cd /home/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source && LDFLAGS= FCFLAGS= CPPFLAGS="" \
./configure --disable-jpeg --prefix=/home/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source-LXgfortran FC="gfortran" && \
make -j 1 clean && \
make -j 1 && \
make -j 1 install && \
make -j 1 clean
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
(omit the long logging information, and the final lines are the error message shown in the beginning of this question description.)
I searched the Internet that this could be due to the GCC 10 is more strict than older GCC (I compiled this model last year with older GCC and made it, but failed this time because our server is transferred to a new system, thus the GCC is upgraded from older version to a new version). Some information from Google said that I could add something like this:
export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFLAGS="-w -fallow-argument-mismatch -O2"
But I tried it in the step 2 where I export some essential environmental variables, it still does not work. So I am wondering is there anybody who can help me? Thanks a lot!
Updates: the source code of grib_api-1.17.0-Source/fortran/same_int_long.f90 from http://distfiles.macports.org/grib_api/ is as following:
! Copyright 2005-2016 ECMWF.
!
! This software is licensed under the terms of the Apache Licence Version 2.0
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
!
! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
integer function kind_of_long()
integer(2), dimension(2) :: x2 = (/1, 2/)
integer(4), dimension(2) :: x4 = (/1, 2/)
integer(8), dimension(2) :: x8 = (/1, 2/)
character(len=1) :: ret
kind_of_long=-1
call check_long(x2(1),x2(2),ret)
if (ret == 't') then
kind_of_long=2
return
endif
call check_long(x4(1),x4(2),ret)
if (ret == 't') then
kind_of_long=4
return
endif
call check_long(x8(1),x8(2),ret)
if (ret == 't') then
kind_of_long=8
return
endif
end function kind_of_long
integer function kind_of_int()
integer(2), dimension(2) :: x2 = (/1, 2/)
integer(4), dimension(2) :: x4 = (/1, 2/)
integer(8), dimension(2) :: x8 = (/1, 2/)
character(len=1) :: ret
kind_of_int=-1
call check_int(x2(1),x2(2),ret)
if (ret == 't') then
kind_of_int=2
return
endif
call check_int(x4(1),x4(2),ret)
if (ret == 't') then
kind_of_int=4
return
endif
call check_int(x8(1),x8(2),ret)
if (ret == 't') then
kind_of_int=8
return
endif
end function kind_of_int
program same_int_long
integer ki,kl
ki=kind_of_int()
kl=kind_of_long()
if (ki /= kl) then
write (*,'(i1)') 0
else
write (*,'(i1)') 1
endif
end program same_int_long
Here is the full log information of make: https://drive.google.com/file/d/14rkj2ay39Rv84QBL6UDiSdlIAfhuEt_z/view?usp=sharing
This appened to me with a MPI fortran code. The cause is a decision from gcc developpers on what should be «good interfaces» see here.
Two solutions in my case :
Tells gfortran to ignore this concerns with option -fallow-argument-mismatch.
Use modern fortran interface (use mpi instead of include mpif.h)
I chose the latter.
What you are instantiating as an INTEGER is getting its value assigned by another (variable or declaration) integer of a different "byte" memory storage size.
e.g. in other languages int is 4 bytes and long is 8 bytes. (note) Fortran also has pointers alike C/C++
https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vna5/index.html
nb: You did not show the code that has the problem , somewhere around line 29 char 18 in source file same_int_long.f90 ??
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.
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
I have a problem when I execute commmand "make" in terminal ubuntu.
My code of makefile is:
all: temp p1
%: %.cc g++ -lm -lcrypt -O2 -std=c++11 -pipe $< -o $#
Of course, my files are temp.cc and p1.cc, but my problem is in p1.cc, where the code is:
#include <bits/stdc++.h>
using namespace std;
int main(){
vector<int> vec = {4,6,8,9,8,7,1,3,4,5,0,1};
for(auto i : vec)
cout<<i<<" ";
cout<<endl;
return 0;}
My error using 'make' is:
eabg97#EABG:~/P$ make
g++ p1.cc -o p1
p1.cc: In function ‘int main()’:
p1.cc:7:44: error: in C++98 ‘vec’ must be initialized by constructor, not by ‘{...}’
vector<int> vec = {4,6,8,9,8,7,1,3,4,5,0,1};
^
p1.cc:7:44: error: could not convert ‘{4, 6, 8, 9, 8, 7, 1, 3, 4, 5, 0, 1}’ from ‘<brace-enclosed initializer list>’ to ‘std::vector<int>’
p1.cc:9:11: error: ‘i’ does not name a type
for(auto i : vec)
^
p1.cc:11:2: error: expected ‘;’ before ‘cout’
cout<<endl;
^
p1.cc:12:2: error: expected primary-expression before ‘return’
return 0;
^
p1.cc:12:2: error: expected ‘)’ before ‘return’
make: *** [p1] Error 1
Using the next command lines, compile:
g++ --std=c++11 p1.cc -o p1
and executing is okay:
eabg97#EABG:~/P$ ./p1
4 6 8 9 8 7 1 3 4 5 0 1
Please help me, I don't understand why there is a problem, thanks for your support :)
This is wrong:
all: temp p1
%: %.cc g++ -lm -lcrypt -O2 -std=c++11 -pipe $< -o $#
You should either add a newline and an initial TAB, like this:
all: temp p1
%: %.cc
g++ -lm -lcrypt -O2 -std=c++11 -pipe $< -o $#
(the first char on the third line must be a TAB character) or you need to insert a semicolon like this:
all: temp p1
%: %.cc ; g++ -lm -lcrypt -O2 -std=c++11 -pipe $< -o $#
What is your makefile doing? First, that statement all in one line without any newline/TAB or semicolon is considered by make to be a single pattern rule with a target % and prerequisites %.cc, g++, -lm, -lcrypt, etc. And, since there's no recipe, you're basically deleting that pattern rule (which doesn't exist anyway) since a pattern rule with no recipe deletes the pattern rule. So that line is essentially a no-op and does nothing.
So what happens? Make has a bunch of built-in rules that it uses to create things if you don't tell it how to do so, and there's a built-in rule that knows how to create a program from a .cc file, so make uses that. But of course, that built-in rule doesn't have any of your customizations.
It's simpler to use make's built-in rule and use the standard make variables to control it:
CXX := g++
CXXFLAGS := -std=c++11 -pipe
LDLIBS := -lm -lcrypt
all: temp p1
That's all you need, if you don't want to write your own rule.