Opendigitalradio / ODR-DabMux

ODR-DabMux is a DAB (Digital Audio Broadcasting) multiplexer, part of the ODR-mmbTools.
https://www.opendigitalradio.org
Other
48 stars 35 forks source link

OSX compile errors #29

Closed dmitryelj closed 6 years ago

dmitryelj commented 6 years ago

Hi all,

I've got 2 errors when trying to compile the stuff. 1) ./input/prbs.h:34:10: warning: non-portable path to file '"Prbs.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path] ./input/prbs.h:48:9: error: unknown type name 'PrbsGenerator'

Looks like having 2 files Prbs.h and prbs.h confusing the compiler. Solved this by renaming prbs.h and prbs.cpp to another name.

2) TcpSocket.cpp:61:75: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int') TcpSocket.cpp:156:59: error: use of undeclared identifier 'MSG_NOSIGNAL'

Don't know yet how to fix this one.

mpbraendli commented 6 years ago

Hi and thanks for your bugreport.

d573723 should fix 1. and fd026d8 adds a check for MSG_NOSIGNAL. On systems that don't have MSG_NOSIGNAL, SO_NOSIGPIPE should get used instead, although I have no quick way to test. (I would have to setup a VM with FreeBSD somewhere, which is probably also affected by this) Both commits are in the next branch.

Can you please checkout next and test on your machine if

  1. it compiles
  2. when using the TCP output, odr-dabmux doesn't crash when a connection gets closed by the remote ETI receiver

Thanks!

dmitryelj commented 6 years ago

Hi, thanks for response.

Filename error is gone, thanks.

I getting 2 errors now: TcpSocket.cpp:60:24: error: use of undeclared identifier 'sd' if (setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof(val)) ^ TcpSocket.cpp:69:75: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int') if (bind(m_sock, m_own_address.getAddress(), sizeof(sockaddr_in)) == SOCKET_ERROR)

Also some warnings, but its not critical: unknown warning option '-Wduplicated-cond' unknown warning option '-Wduplicated-branches' unknown warning option '-Wlogical-op' unknown warning option '-Wrestrict'

dmitryelj commented 6 years ago

I fixed it probably:

Now getting link error: library not found for -lboost_thread

PS: I was able to compile replacing boost to mt-version in makefile: -lboost_system-mt -lboost_thread-mt -lboost_regex-mt

mpbraendli commented 6 years ago

Added your two changes to the next branch. I doubt I can help you for link issues though... One thing would be to investigate if the link flag needs to be changed: src/Makefile.am hard-codes the flags. I see that m4/ax_boost_base.m4 sets BOOST_LDFLAGS, I guess I should use them somehow...

dmitryelj commented 6 years ago

True, now I use in src/Makefile: odr_dabmux_LDADD = $(ZMQ_LIBS) $(CURL_LIBS) \ -lpthread -lboost_system-mt -lboost_thread-mt -lboost_regex-mt

odr_zmq2edi_LDADD = $(ZMQ_LIBS) \ -lpthread -lboost_thread-mt -lboost_system-mt

And it compiles ok.

Thanks for help anyway.

mpbraendli commented 6 years ago

BOOST_LDFLAGS doesn't set the -lboost_XYZ option, so I don't know what to do. It's not clear to me when the -mt variant has to be chosen.

dmitryelj commented 6 years ago

Looks like, on OSX exist only mt-version: ls /usr/local/lib/libboost_th* /usr/local/lib/libboost_thread-mt.a /usr/local/lib/libboost_thread-mt.dylib

So the choice is easy :)

mpbraendli commented 6 years ago

I've improved the autoconf macros and added a test specific to the boost libraries. Does next now comple on OSX?

dmitryelj commented 6 years ago

Hi. Not yet:

ld: library not found for -lboost_thread clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [odr-zmq2edi] Error 1 make[1]: [all-recursive] Error 1 make: *** [all] Error 2

mpbraendli commented 6 years ago

Did you do make distclean or at least a new bootstrap?

If it still fails after a distclean, can you give me your config.log file please?

dmitryelj commented 6 years ago

Yes, I tried from scratch, the result is the same. Logs attached.

config.log

mpbraendli commented 6 years ago

Ok, I see that configure sets BOOST_THREAD_LIB='-lboost_thread-mt -lpthread' (line 1615 of your config.log), which is used by Makefile.am to link against boost_thread. But only for the odr-dabmux binary, not for odr-zmq2edi :-/ Does next now work?

dmitryelj commented 6 years ago

Yes, compiled it now :)

Got only lots of warnings: warning: unknown warning option '-Wduplicated-cond'; did you mean '-Wduplicate-enum'? [-Wunknown-warning-option] warning: unknown warning option '-Wduplicated-branches' [-Wunknown-warning-option] warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]

mpbraendli commented 6 years ago

Great! This means the boost and other checks are correct now!

Which files trigger the "unknown warning option" messages?

dmitryelj commented 6 years ago

Almost all of them:

CC libtoolame-dab/libtoolame_dab_la-encode.lo warning: unknown warning option '-Wduplicated-cond'; did you mean '-Wduplicate-enum'? [-Wunknown-warning-option] warning: unknown warning option '-Wduplicated-branches' [-Wunknown-warning-option] warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option] 4 warnings generated. CC libtoolame-dab/libtoolame_dab_la-ieeefloat.lo warning: unknown warning option '-Wduplicated-cond'; did you mean '-Wduplicate-enum'? [-Wunknown-warning-option] warning: unknown warning option '-Wduplicated-branches' [-Wunknown-warning-option] warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option] 4 warnings generated. CC libtoolame-dab/libtoolame_dab_la-toolame.lo warning: unknown warning option '-Wduplicated-cond'; did you mean '-Wduplicate-enum'? [-Wunknown-warning-option] warning: unknown warning option '-Wduplicated-branches' [-Wunknown-warning-option] warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option] 4 warnings generated. CC libtoolame-dab/libtoolame_dab_la-portableio.lo warning: unknown warning option '-Wduplicated-cond'; did you mean '-Wduplicate-enum'? [-Wunknown-warning-option] warning: unknown warning option '-Wduplicated-branches' [-Wunknown-warning-option] warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option] 4 warnings generated.

...

mpbraendli commented 6 years ago

Only C files, or also C++ files?

You will see CC for C files, and CXX for C++ files.

dmitryelj commented 6 years ago

Both: CXX src/odr_audioenc-VLCInput.o warning: unknown warning option '-Wduplicated-cond'; did you mean '-Wduplicate-enum'? [-Wunknown-warning-option] warning: unknown warning option '-Wduplicated-branches' [-Wunknown-warning-option] warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option] 4 warnings generated. CXX src/odr_audioenc-AACDecoder.o CC src/odr_audioenc-encryption.o warning: unknown warning option '-Wduplicated-cond'; did you mean '-Wduplicate-enum'? [-Wunknown-warning-option] warning: unknown warning option '-Wduplicated-branches' [-Wunknown-warning-option] warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option] warning: unknown warning option '-Wduplicated-cond'; did you mean '-Wduplicate-enum'? [-Wunknown-warning-option] warning: unknown warning option '-Wduplicated-branches' [-Wunknown-warning-option] warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]

mpbraendli commented 6 years ago

Warnings are gone too now. It builds on OSX using the Travis-CI infrastructure. Thanks for your report!