I'm attempting to build redis on my aws linux server in order to get access to the redis-cli and connect to my redis instance which is also running successfully in aws.
my gcc is:
gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
I downloaded the source and started the build:
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make distclean
make
It built the dependencies and then gave me this:
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/tsd.o src/tsd.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/witness.o src/witness.c
ar crus lib/libjemalloc.a src/jemalloc.o src/arena.o src/background_thread.o src/base.o src/bin.o src/bitmap.o src/ckh.o src/ctl.o src/div.o src/extent.o src/extent_dss.o src/extent_mmap.o src/hash.o src/hooks.o src/large.o src/log.o src/malloc_io.o src/mutex.o src/mutex_pool.o src/nstime.o src/pages.o src/prng.o src/prof.o src/rtree.o src/stats.o src/sz.o src/tcache.o src/ticker.o src/tsd.o src/witness.o
make[3]: Leaving directory `/home/ec2-user/redis-stable/deps/jemalloc'
make[2]: Leaving directory `/home/ec2-user/redis-stable/deps'
CC adlist.o
CC quicklist.o
CC ae.o
CC anet.o
CC dict.o
CC server.o
In file included from server.c:30:0:
server.h:1044:5: error: expected specifier-qualifier-list before ‘_Atomic’
_Atomic unsigned int lruclock; /* Clock for LRU eviction */
^
server.c: In function ‘serverLogRaw’:
server.c:1028:31: error: ‘struct redisServer’ has no member named ‘logfile’
int log_to_stdout = server.logfile[0] == '\0';
^
server.c:1031:23: error: ‘struct redisServer’ has no member named ‘verbosity’
if (level < server.verbosity) return;
^
server.c:1033:47: error: ‘struct redisServer’ has no member named ‘logfile’
fp = log_to_stdout ? stdout : fopen(server.logfile,"a");
...and a lot more
I assume that I must have done something wrong as this is code that undoubtedly builds for everyone else. I'm a java developer with little to no c background. Any pointers will be appreciated.
Jay
Appears that gcc >= 4.9 is required to build redis 6x ...
Problem here is latest Redis version(6.0.7) depends on _Atomic which is not supported in older gcc 4.8.5.
One can also compile latest Redis code with clang if updating gcc version is not possible.
$ cd redis-stable
$ CC=clang make
i have successed.
at first i want to install gcc6, but failed again and agin, then i notise that,devtoolset-6 is deprecated. Maybe you should try -7 or -8.
then i use the flow cmd and it worked
yum install -y devtoolset-6-gcc devtoolset-7-gcc-c++
so i hope it can also help you
Thanks for the responses. The solution I ended up with was to build a new server with CentOS8 and gcc 8.3.1. This combination built the redis server 6.0.3 with no issues. Moral: you need to have up to date infra and software in order to properly build new software.
Download older version, seems some issue with 6.0.*
That worked for me on ubunt 14.04 LTS
Related
I have installed ROHC library (http://rohc-lib.org) using following commands during installation:
autoreconf -if
./configure --enable-static=yes --enable-shared=no --disable-shared --prefix=/usr
make
make install
It successfully installed static (and only static) libraries in /usr/lib directory. It contains librohc.a and librohc.la and no shared-library (i.e. librohc.so*).
I am trying to link this library with OpenVPN. I added following lines in configure.ac of OpenVPN:
AC_CHECK_HEADERS(
[rohc/rohc.h rohc/rohc_comp.h rohc/rohc_decomp.h],
,
[AC_MSG_ERROR([ROHC headers not found])]
)
AC_CHECK_LIB(
[rohc],
[rohc_compress4],
,
[AC_MSG_ERROR([ROHC library not found])]
)
But when I run make in OpenVPN source directory, I get the following error:
/bin/sh ../../libtool --tag=CC --mode=link gcc -DPLUGIN_LIBDIR=\"/usr/local/lib/openvpn/plugins\" -Wall -Wno-unused-parameter -Wno-unused-function -g -O2 -std=c99 -lrt -o openvpn argv.o base64.o buffer.o clinat.o comp.o compstub.o comp-lz4.o crypto.o crypto_openssl.o crypto_mbedtls.o dhcp.o error.o event.o fdmisc.o forward.o fragment.o gremlin.o helper.o httpdigest.o lladdr.o init.o interval.o list.o lzo.o manage.o mbuf.o misc.o platform.o console.o console_builtin.o console_systemd.o mroute.o mss.o mstats.o mtcp.o mtu.o mudp.o multi.o ntlm.o occ.o pkcs11.o pkcs11_openssl.o pkcs11_mbedtls.o openvpn.o options.o otime.o packet_id.o perf.o pf.o ping.o plugin.o pool.o proto.o proxy.o ps.o push.o reliable.o route.o schedule.o session_id.o shaper.o sig.o socket.o socks.o ssl.o ssl_openssl.o ssl_mbedtls.o ssl_verify.o ssl_verify_openssl.o ssl_verify_mbedtls.o status.o tls_crypt.o tun.o win32.o rohc.o trunk.o cryptoapi.o ../../src/compat/libcompat.la -lnsl -lresolv -llzo2 -llz4 -lssl -lcrypto -ldl -lrohc
libtool: link: gcc -DPLUGIN_LIBDIR=\"/usr/local/lib/openvpn/plugins\" -Wall -Wno-unused-parameter -Wno-unused-function -g -O2 -std=c99 -o openvpn argv.o base64.o buffer.o clinat.o comp.o compstub.o comp-lz4.o crypto.o crypto_openssl.o crypto_mbedtls.o dhcp.o error.o event.o fdmisc.o forward.o fragment.o gremlin.o helper.o httpdigest.o lladdr.o init.o interval.o list.o lzo.o manage.o mbuf.o misc.o platform.o console.o console_builtin.o console_systemd.o mroute.o mss.o mstats.o mtcp.o mtu.o mudp.o multi.o ntlm.o occ.o pkcs11.o pkcs11_openssl.o pkcs11_mbedtls.o openvpn.o options.o otime.o packet_id.o perf.o pf.o ping.o plugin.o pool.o proto.o proxy.o ps.o push.o reliable.o route.o schedule.o session_id.o shaper.o sig.o socket.o socks.o ssl.o ssl_openssl.o ssl_mbedtls.o ssl_verify.o ssl_verify_openssl.o ssl_verify_mbedtls.o status.o tls_crypt.o tun.o win32.o rohc.o trunk.o cryptoapi.o ../../src/compat/.libs/libcompat.a -lrt -lnsl -lresolv -llzo2 -llz4 -lssl -lcrypto -ldl /usr/lib/librohc.so
gcc: /usr/lib/librohc.so: No such file or directory
Yes, /usr/lib/librohc.so does not exist, but /usr/lib/librohc.a exists. Why is it not linking with the static library /usr/lib/librohc.a at absence of .so ?
You may ask me why I am not installing shared libs of ROHC; answer is that I want to force static linking with ROHC, and when it is done I will uninstall ROHC libs.
If someone could show me how to do this static linking without installing ROHC first (like adding dependency to configure.ac or Makefile.am of OpenVPN), it would be better for me.
Note that, both OpenVPN and ROHC library require autotools.
I specified --libdir=/usr/lib64 with ./configure of ROHC library and finally the build system used the static library librohc.a when linking with OpenVPN. I installed ROHC with:
autoreconf -if
./configure --enable-static --disable-shared --prefix=/usr --libdir=/usr/lib64
make
make install
Now it installs the library as /usr/lib64/librohc.a and Compilation of OpenVPN successfully finds and links to it.
And surely, it took place in a 64 bit machine (CentOS 6). In a 32 bit environment (OpenWrt in a 32-bit MIPS router) where there is nothing like /usr/lib64, the problem in the question does not take place.
i have been trying to build httpd-2.4.43 from source and i included OpenSSL-fips-2.0.16.
However, i encountered an error during build process of httpd. see below;
make[2]: Entering directory `/root/httpd/httpd-2.4.43/support'
/root/httpd/httpd-2.4.43/srclib/apr/libtool --silent --mode=compile gcc -std=gnu99 -I/opt/openssl-fips-2.0.16/include -g -O2 -pthread -DLINUX -D_REENTRANT -D_GNU_SOURCE \
-I. -I/root/httpd/httpd-2.4.43/os/unix -I/root/httpd/httpd-2.4.43/include -I/root/httpd/httpd-2.4.43/srclib/apr/include -I/root/httpd/httpd-2.4.43/srclib/apr-util/include -I/usr/local/include -I/root/httpd/httpd-2.4.43/modules/aaa -I/root/httpd/httpd-2.4.43/modules/cache -I/root/httpd/httpd-2.4.43/modules/core -I/root/httpd/httpd-2.4.43/modules/database -I/root/httpd/httpd-2.4.43/modules/filters -I/root/httpd/httpd-2.4.43/modules/ldap -I/root/httpd/httpd-2.4.43/server -I/root/httpd/httpd-2.4.43/modules/loggers -I/root/httpd/httpd-2.4.43/modules/lua -I/root/httpd/httpd-2.4.43/modules/proxy -I/root/httpd/httpd-2.4.43/modules/http2 -I/root/httpd/httpd-2.4.43/modules/session -I/root/httpd/httpd-2.4.43/modules/ssl -I/root/httpd/httpd-2.4.43/modules/test -I/root/httpd/httpd-2.4.43/server -I/root/httpd/httpd-2.4.43/modules/md -I/root/httpd/httpd-2.4.43/modules/arch/unix -I/root/httpd/httpd-2.4.43/modules/dav/main -I/root/httpd/httpd-2.4.43/modules/generators -I/root/httpd/httpd-2.4.43/modules/mappers -prefer-non-pic -static -c ab.c && touch ab.lo
In file included from ab.c:161:0:
/opt/openssl-fips-2.0.16/include/openssl/rsa.h:62:26: fatal error: openssl/asn1.h: No such file or directory
#include <openssl/asn1.h>
^
compilation terminated.
make[2]: *** [ab.lo] Error 1
Above error message points to missing asn1.h.
I do not know where to find it. Maybe there is a missing procedure on building OpenSSL from source?
I feel i miss something when building OpenSSL from source.
Please do point me to the right direction for this.
Fixed it. Apprently, when i search for resources, i was finding the asn1.h problem not knowing that rsa.h part which includes asn1.h.
So it was found out that this was due to the *ssl-devel dependencies while building openssl.
So please install the *ssl-devel in your build envionrment
openssl-devel for RHEL/Fedora
libssl-devel for Debian
Then rebuild OpenSSL then httpd
You have to install OpenSSL development package, which is available in standard repositories of all modern Linux distributions.
Install OpenSSL development package on Debian, Ubuntu or their derivatives:
sudo apt-get install libssl-dev
To install OpenSSL development package on Fedora, CentOS or RHEL:
sudo yum install openssl-devel
good day - i am still having issues with installing perl modules
there seems to be issues with the make-file. i am trying to figure out what goes wrong here on my notebook.
cpan[1]> install Data::Dumper
Running install for module 'Data::Dumper'
Running make for S/SM/SMUELLER/Data-Dumper-2.161.tar.gz
Fetching with LWP:
http://mirrors.hostingromania.ro/cpan.org/authors/id/S/SM/SMUELLER/Data-Dumper-2.161.tar.gz
Fetching with LWP:
http://mirrors.hostingromania.ro/cpan.org/authors/id/S/SM/SMUELLER/CHECKSUMS
Checksum for /home/martin/.cpan/sources/authors/id/S/SM/SMUELLER/Data-Dumper-2.161.tar.gz ok
CPAN.pm: Building S/SM/SMUELLER/Data-Dumper-2.161.tar.gz
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Data::Dumper
Writing MYMETA.yml and MYMETA.json
cp Dumper.pm blib/lib/Data/Dumper.pm
Running Mkbootstrap for Dumper ()
chmod 644 "Dumper.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Dumper.bs blib/arch/auto/Data/Dumper/Dumper.bs 644
"/usr/bin/perl" "/usr/lib/perl5/5.18.2/ExtUtils/xsubpp" -typemap '/usr/lib/perl5/5.18.2/ExtUtils/typemap' Dumper.xs > Dumper.xsc
mv Dumper.xsc Dumper.c
cc -c -D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe -DVERSION=\"2.161\" -DXS_VERSION=\"2.161\" -fPIC "-I/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE" -DUSE_PPPORT_H Dumper.c
/bin/sh: cc: Kommando nicht gefunden.
Makefile:332: recipe for target 'Dumper.o' failed
make: *** [Dumper.o] Error 127
SMUELLER/Data-Dumper-2.161.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
SMUELLER/Data-Dumper-2.161.tar.gz : make NO
cpan[2]>
well - i need to make sure that the make is set propperly ..good day - i am still having issues with installing perl modules
there seems to be issues with the make-file. i am trying to figure out what goes wrong here on my notebook.
A C compiler is required to build that module, but the C compiler which perl was built with, 'cc' isn''t available. You will need to install that first.
But Data::Dumper is part of the standard perl distribution, so you shouldn't need to install it anyway. If you're using a Linux distribution where the perl installation has been split into multiple packages, then you may just need to do something like
yum install perl-Data-Dumper
I am trying to compile openjdk 7 on my arm ubuntu:
make all ALLOW_DOWNLOADS=true DISABLE_HOTSPOT_OS_VERSION_CHECK=ok
Then I received this error:
g++ -DLINUX -D_GNU_SOURCE -DIA32 -I/home/darklord/Develop/jdk7/hotspot/src/share/vm/prims -I/home/darklord/Develop/jdk7/hotspot/src/share/vm -I/home/darklord/Develop/jdk7/hotspot/src/cpu/x86/vm -I/home/darklord/Develop/jdk7/hotspot/src/os_cpu/linux_x86/vm -I/home/darklord/Develop/jdk7/hotspot/src/os/linux/vm -I/home/darklord/Develop/jdk7/hotspot/src/os/posix/vm -I/home/darklord/Develop/jdk7/hotspot/src/share/vm/adlc -I../generated -DASSERT -DTARGET_OS_FAMILY_linux -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_32 -DTARGET_OS_ARCH_linux_x86 -DTARGET_OS_ARCH_MODEL_linux_x86_32 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -fvisibility=hidden -m32 -march=i586 -pipe -Werror -g -c -o ../generated/adfiles/adlparse.o /home/darklord/Develop/jdk7/hotspot/src/share/vm/adlc/adlparse.cpp
g++: error: unrecognized argument in option '-march=i586'
It seems it is trying compile using x86 configuration. So how can I make the build pass on ARM machine?
You have to specify proper architecture option for g++. Reference here.
-march=name
This specifies the name of the target ARM architecture. GCC uses this name to determine what kind of instructions it can emit when
generating assembly code. This option can be used in conjunction with
or instead of the -mcpu= option. Permissible names are: armv2',
armv2a', armv3',armv3m', armv4',armv4t', armv5',armv5t',
armv5te',armv6', armv6j',iwmmxt', `ep9312'.
Please make sure you refer proper version docs of gcc
I am getting following error while trying to install httpd 2.0.49 from its source on ubuntu 12.04 machine.
sudo make
...
...
make[4]: Entering directory `/home/satya/httpd-2.0.49/srclib/apr/network_io/unix'
/bin/bash /home/satya/httpd-2.0.49/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -D_REENTRANT -D_GNU_SOURCE -I../../include -I../../include/arch/unix -I../../include/arch/unix -c sockopt.c && touch sockopt.lo
sockopt.c: In function 'apr_socket_opt_set':
sockopt.c:216:27: error: 'SCTP_NODELAY' undeclared (first use in this function)
I installed lksctp by executing sudo apt-get install lksctp-tools command and made few changes as suggested here
Even after doing this I am unable to compile the httpd and getting same error as above.
This is a bug in the configure script which assumes sctp is available even when it is not. This was fixed in later releases of 2.0.
Preferably, you should - if you want 2.0 - compile 2.0.65 instead.
Do however note that 2.0 is EOL (since 2013), so it is not officially supported by Apache anymore.