sipwise / rtpengine

The Sipwise media proxy for Kamailio
GNU General Public License v3.0
776 stars 366 forks source link

Daemon compilation error on Amazon Linux 2 #1239

Open denyspozniak opened 3 years ago

denyspozniak commented 3 years ago

Hello!

When compiling rtpengine from a master on Amazon Linux 2 I get the following error:

...
make[2]: Entering directory `/usr/local/src/rtpengine/daemon'
cc -g -Wall -Wstrict-prototypes -pthread -fno-strict-aliasing -std=c99 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include       -pthread     -I/usr/include/libxml2   -I/usr/include/libxml2     -pthread -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include       -DWITH_IPTABLES_OPTION -I. -I../kernel-module/ -I../lib/ -I../include/ -D_GNU_SOURCE             -DWITH_TRANSCODING -I/usr/include/mysql -DRE_PLUGIN_DIR="\"/usr/lib/rtpengine\"" -DRTPENGINE_VERSION="\"git-master-0ae99674\""    dtmf_rx_fillin-test.c  -lm -lglib-2.0   -pthread -lgthread-2.0 -lglib-2.0   -lz   -lpcre   -lcrypto   -lssl -lcrypto   -levent_pthreads -levent   -lpcap -lxmlrpc_client   -lxmlrpc   -lxmlrpc_util   -lhiredis -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0   -lwebsockets   -lip4tc -lip6tc   -lavcodec   -lavformat   -lavutil   -lswresample   -lavfilter   -lspandsp   -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto -o dtmf_rx_fillin-test
/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/libavcodec.so: undefined reference to `opus_multistream_surround_encoder_create'
collect2: error: ld returned 1 exit status
make[2]: *** [dtmf_rx_fillin-test] Error 1
make[2]: Leaving directory `/usr/local/src/rtpengine/daemon'
Failed build with ../lib/dtmf_rx_fillin-01.h
Trying build with ../lib/dtmf_rx_fillin-02.h
make[2]: Entering directory `/usr/local/src/rtpengine/daemon'
cc -g -Wall -Wstrict-prototypes -pthread -fno-strict-aliasing -std=c99 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include       -pthread     -I/usr/include/libxml2   -I/usr/include/libxml2     -pthread -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include       -DWITH_IPTABLES_OPTION -I. -I../kernel-module/ -I../lib/ -I../include/ -D_GNU_SOURCE             -DWITH_TRANSCODING -I/usr/include/mysql -DRE_PLUGIN_DIR="\"/usr/lib/rtpengine\"" -DRTPENGINE_VERSION="\"git-master-0ae99674\""    dtmf_rx_fillin-test.c  -lm -lglib-2.0   -pthread -lgthread-2.0 -lglib-2.0   -lz   -lpcre   -lcrypto   -lssl -lcrypto   -levent_pthreads -levent   -lpcap -lxmlrpc_client   -lxmlrpc   -lxmlrpc_util   -lhiredis -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0   -lwebsockets   -lip4tc -lip6tc   -lavcodec   -lavformat   -lavutil   -lswresample   -lavfilter   -lspandsp   -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto -o dtmf_rx_fillin-test
In file included from dtmf_rx_fillin-test.c:1:0:
dtmf_rx_fillin.h:12:13: error: conflicting types for ‘dtmf_rx_fillin’
 INLINE void dtmf_rx_fillin(dtmf_rx_state_t *dsp, int n) {
             ^~~~~~~~~~~~~~
In file included from dtmf_rx_fillin.h:9:0,
                 from dtmf_rx_fillin-test.c:1:
/usr/include/spandsp/dtmf.h:185:19: note: previous declaration of ‘dtmf_rx_fillin’ was here
 SPAN_DECLARE(int) dtmf_rx_fillin(dtmf_rx_state_t *s, int samples);
                   ^~~~~~~~~~~~~~
make[2]: *** [dtmf_rx_fillin-test] Error 1
make[2]: Leaving directory `/usr/local/src/rtpengine/daemon'
Failed build with ../lib/dtmf_rx_fillin-02.h
make[1]: *** [dtmf_rx_fillin.h] Error 1
rm sdp.strhash.c control_ng.strhash.c call_interfaces.strhash.c
make[1]: Leaving directory `/usr/local/src/rtpengine/daemon'
make: *** [all] Error 2

What is missing?

NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
rfuchs commented 3 years ago

Looks like a problem with your ffmpeg libraries, perhaps libopus missing?

micmac1 commented 3 years ago

Hi all,

to me it looks like the make race issue that 92ee64f was supposed to fix. In OpenWrt I re-enabled parallel building once the mentioned fix was checked in. But still there were sporadic build failures like the above. So I disabled parallel building again.

@denyspozniak can you try a clean build using "make -j1 ..."?

Kind regards, Seb

denyspozniak commented 3 years ago

Hello!

@rfuchs , is it enough to have opus-devel? At this stage, we do not need to process codecs, only proxy the RTP stream. Can somehow disable the compilation of codecs?

[root@ip daemon]# rpm -qa | grep opus
opus-1.0.2-6.amzn2.0.2.x86_64
opus-devel-1.0.2-6.amzn2.0.2.x86_64

@micmac1 , the same issue

[root@ip daemon]# make -j1
make rtpengine rtpengine.8
make[1]: Entering directory `/usr/local/src/rtpengine/daemon'
....
../utils/build_test_wrapper "dtmf_rx_fillin.h"
Looking for usable alternative for dtmf_rx_fillin.h
Trying build with ../lib/dtmf_rx_fillin-01.h
make[2]: Entering directory `/usr/local/src/rtpengine/daemon'
cc -g -Wall -Wstrict-prototypes -pthread -fno-strict-aliasing -std=c99 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include       -pthread     -I/usr/include/libxml2   -I/usr/include/libxml2     -pthread -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include       -DWITH_IPTABLES_OPTION -I. -I../kernel-module/ -I../lib/ -I../include/ -D_GNU_SOURCE             -DWITH_TRANSCODING -I/usr/include/mysql -DRE_PLUGIN_DIR="\"/usr/lib/rtpengine\"" -DRTPENGINE_VERSION="\"git-master-0ae99674\""    dtmf_rx_fillin-test.c  -lm -lglib-2.0   -pthread -lgthread-2.0 -lglib-2.0   -lz   -lpcre   -lcrypto   -lssl -lcrypto   -levent_pthreads -levent   -lpcap -lxmlrpc_client   -lxmlrpc   -lxmlrpc_util   -lhiredis -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0   -lwebsockets   -lip4tc -lip6tc   -lavcodec   -lavformat   -lavutil   -lswresample   -lavfilter   -lspandsp   -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto -o dtmf_rx_fillin-test
/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/libavcodec.so: undefined reference to `opus_multistream_surround_encoder_create'
collect2: error: ld returned 1 exit status
make[2]: *** [dtmf_rx_fillin-test] Error 1
make[2]: Leaving directory `/usr/local/src/rtpengine/daemon'
Failed build with ../lib/dtmf_rx_fillin-01.h
Trying build with ../lib/dtmf_rx_fillin-02.h
make[2]: Entering directory `/usr/local/src/rtpengine/daemon'
cc -g -Wall -Wstrict-prototypes -pthread -fno-strict-aliasing -std=c99 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include       -pthread     -I/usr/include/libxml2   -I/usr/include/libxml2     -pthread -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include       -DWITH_IPTABLES_OPTION -I. -I../kernel-module/ -I../lib/ -I../include/ -D_GNU_SOURCE             -DWITH_TRANSCODING -I/usr/include/mysql -DRE_PLUGIN_DIR="\"/usr/lib/rtpengine\"" -DRTPENGINE_VERSION="\"git-master-0ae99674\""    dtmf_rx_fillin-test.c  -lm -lglib-2.0   -pthread -lgthread-2.0 -lglib-2.0   -lz   -lpcre   -lcrypto   -lssl -lcrypto   -levent_pthreads -levent   -lpcap -lxmlrpc_client   -lxmlrpc   -lxmlrpc_util   -lhiredis -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0   -lwebsockets   -lip4tc -lip6tc   -lavcodec   -lavformat   -lavutil   -lswresample   -lavfilter   -lspandsp   -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto -o dtmf_rx_fillin-test
In file included from dtmf_rx_fillin-test.c:1:0:
dtmf_rx_fillin.h:12:13: error: conflicting types for ‘dtmf_rx_fillin’
 INLINE void dtmf_rx_fillin(dtmf_rx_state_t *dsp, int n) {
             ^~~~~~~~~~~~~~
In file included from dtmf_rx_fillin.h:9:0,
                 from dtmf_rx_fillin-test.c:1:
/usr/include/spandsp/dtmf.h:185:19: note: previous declaration of ‘dtmf_rx_fillin’ was here
 SPAN_DECLARE(int) dtmf_rx_fillin(dtmf_rx_state_t *s, int samples);
                   ^~~~~~~~~~~~~~
make[2]: *** [dtmf_rx_fillin-test] Error 1
make[2]: Leaving directory `/usr/local/src/rtpengine/daemon'
Failed build with ../lib/dtmf_rx_fillin-02.h
make[1]: *** [dtmf_rx_fillin.h] Error 1
rm sdp.strhash.c control_ng.strhash.c call_interfaces.strhash.c
make[1]: Leaving directory `/usr/local/src/rtpengine/daemon'
make: *** [all] Error 2
denyspozniak commented 3 years ago

Can somehow disable the compilation of codecs? Option in daemon/Makefile: with_transcoding ?= no

August1023 commented 1 year ago

@denyspozniak Hello, has this problem been solved?

denyspozniak commented 1 year ago

@August1023 I could not compile with transcoding support.

August1023 commented 1 year ago

Can somehow disable the compilation of codecs? Option in daemon/Makefile: with_transcoding ?= no

Set with_transcoding ?= no is that ok ?

denyspozniak commented 1 year ago

yes, should work

August1023 commented 1 year ago

@denyspozniak Strangely, I can't. The following errors are reported: [ root@localhost daemon]# make

make rtpengine rtpengine.8

Make [1]: enter the directory "/ usr / local / SRC / rtpengine_02 / daemon"

cc -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes -pthread -fno-strict-aliasing -std=c99 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/libxml2 -I/usr/include/libxml2 -pthread -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DWITH IPTABLES OPTION -I. - I../kernel-module/ -I../lib/ -I../include/ -D GNU SOURCE -DWITHOUT CODECLIB -DRTPENGINE VERSION="\"git-master-b1242be\"" -c -o codec. o codec.c

In file included from codec.c:20:0:

fix frame channel_ layout. h: 2:29: fatal error: libavutil / frame. H: no file or directory

include <libavutil/frame.h>

^

Compilation interrupted.

Make [1]: * [codec. O] error 1

Make [1]: leave the directory "/ usr / local / SRC / rtpengine_02 / daemon"

Make: * [all] error: 2

[ root@localhost daemon]#

denyspozniak commented 1 year ago

@August1023 it looks missing ffmpeg libs

aldennisa15 commented 1 year ago

I'm hitting the same problem. Previously been compiling with with_transcoding = no, with no ffmpeg libraries installed. worked fine.

Looks as though https://github.com/sipwise/rtpengine/commit/206ea9efd5dee5d00b44517e375ce2290a1ce2ab has broken this because daemon now includes fix_frame_channel_layout.h (it didn't previously) which in turn includes libavutil/channel_layout.h, assuming that ffmpeg libraries will be installed, but they're not. Boom... fatal error: libavutil / frame. H: no file or directory