Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile on Mac #49

Closed
gpatmore opened this issue Jan 3, 2014 · 37 comments
Closed

Compile on Mac #49

gpatmore opened this issue Jan 3, 2014 · 37 comments

Comments

@gpatmore
Copy link
Contributor

gpatmore commented Jan 3, 2014

Can you give any insight on overcoming errors below when trying to make on Mac?

cc -MD -MP -O2 -Wall -Werror -Wfloat-equal -Wpointer-arith -fPIC -I. -g -DSG -c rdkafka.c
rdkafka.c:1065:29: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
struct consume_ctx ctx = { consume_cb: consume_cb, opaque: opaque };
^~~~~~~~~~~
.consume_cb =
rdkafka.c:1065:53: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
struct consume_ctx ctx = { consume_cb: consume_cb, opaque: opaque };
^~~~~~~
.opaque =
2 errors generated.
make: *** [rdkafka.o] Error 1

@edenhill
Copy link
Contributor

edenhill commented Jan 3, 2014

In the Makefile, find this section:

# Clang warnings to ignore
ifeq ($(CC),clang)
    CFLAGS+=-Wno-gnu-designator
endif

And make it unconditional by removig the ifeq.. and endif lines

Let me know if this fixes your problem.
Could you please also tell me what OSX version you are on?

@gpatmore
Copy link
Contributor Author

gpatmore commented Jan 3, 2014

I apologize for the duplicate: #33
osx 10.9.1

@gpatmore
Copy link
Contributor Author

gpatmore commented Jan 3, 2014

seems I'm getting the same issues as issue 33

cc -MD -MP -O2 -Wall -Werror -Wfloat-equal -Wpointer-arith -fPIC -I. -g -Wno-gnu-designator -DSG -c rdkafka_broker.c
rdkafka_broker.c:2283:22: error: implicit declaration of function 'be64toh' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
hdr->Offset = be64toh(hdr->Offset);
^
rdkafka_broker.c:2884:30: error: implicit declaration of function 'htobe64' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
part2->Time = htobe64(rktp->rktp_query_offset);
^
2 errors generated.
make: *** [rdkafka_broker.o] Error 1

That's with the suggestion you made above

@gpatmore
Copy link
Contributor Author

gpatmore commented Jan 3, 2014

if this helps:

:$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

@edenhill
Copy link
Contributor

edenhill commented Jan 3, 2014

Thank you.
I unfortunately dont have access to a 10.9 box which I would need to fix this.
But I'll see what I can do.

@gpatmore
Copy link
Contributor Author

gpatmore commented Jan 3, 2014

understood. I tried to track it down, but seems like the declarations are ahead of usage for these methods everywhere I can find them.

@edenhill
Copy link
Contributor

edenhill commented Jan 4, 2014

@dvanliere's pull request (issue #51) which was just merged into master fixes this.
Can you give it a try and report back?

@gpatmore
Copy link
Contributor Author

gpatmore commented Jan 6, 2014

Compiles without error now, but make install fails with Illegal option -t
(see below)

Thank you for your attention to this issue

:librdkafka gpatmore$ sudo make install

if [ "/usr/local" != "/usr/local" ]; then \

DESTDIR="/usr/local/usr"; \

else \

DESTDIR="/usr/local" ; \

fi ; \

install -d $DESTDIR/include/librdkafka $DESTDIR/lib ; \

install -t $DESTDIR/include/librdkafka rdkafka.h ; \

install -t $DESTDIR/lib librdkafka.a ; \

install -t $DESTDIR/lib librdkafka.so.1 ; \

(cd $DESTDIR/lib && ln -sf librdkafka.so.1 librdkafka.so)

install: illegal option -- t

usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]

           [-o owner] file1 file2

   install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]

           [-o owner] file1 ... fileN directory

   install -d [-v] [-g group] [-m mode] [-o owner] directory ...

install: illegal option -- t

usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]

           [-o owner] file1 file2

   install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]

           [-o owner] file1 ... fileN directory

   install -d [-v] [-g group] [-m mode] [-o owner] directory ...

install: illegal option -- t

usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]

           [-o owner] file1 file2

   install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]

           [-o owner] file1 ... fileN directory

   install -d [-v] [-g group] [-m mode] [-o owner] directory ...

On Sat, Jan 4, 2014 at 3:11 PM, Magnus Edenhill notifications@github.comwrote:

@dvanliere https://github.com/dvanliere's pull request (issue #51#51)
which was just merged into master fixes this.
Can you give it a try and report back?


Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-31587362
.

@edenhill
Copy link
Contributor

edenhill commented Jan 6, 2014

@dvanliere, still got your superman costume on?

@edenhill
Copy link
Contributor

edenhill commented Jan 7, 2014

Can you give it another go with an updated master? I changed the install options to be more classic.

@gpatmore
Copy link
Contributor Author

gpatmore commented Jan 7, 2014

Thanks guys, you really rock.

Still failing, but different issue.

Here's my output

gpatmore$ sudo make install

uname: illegal option -- o

usage: uname [-amnprsv]

if [ "/usr/local" != "/usr/local" ]; then \

DESTDIR="/usr/local/usr"; \

else \

DESTDIR="/usr/local" ; \

fi ; \

install -d $DESTDIR/include/librdkafka $DESTDIR/lib ; \

install rdkafka.h $DESTDIR/include/librdkafka ; \

install librdkafka.a $DESTDIR/lib ; \

install librdkafka.so.1 $DESTDIR/lib ; \

(cd $DESTDIR/lib && ln -sf librdkafka.so.1 librdkafka.so)

Additionally, and clearly not as important, make tests is also failing for
me, but looks like it's a hard dependency on valgrind. Next chance I get
I'll install valgrind and see if it changes behavior. I'll reply to this
thread with any info I get. It would be great if it could use either the
bundled test.conf.example or else a basic test.conf file for the make tests
target, but maybe there's too much variation in environments to make that
practical.

gpatmore$ sudo make tests

uname: illegal option -- o

usage: uname [-amnprsv]

make -C tests

cc -g -Wall -Werror -Wfloat-equal -Wpointer-arith -O2 -I../ ../librdkafka.a
test.o 0001-multiobj.c -o 0001-multiobj.test ../librdkafka.a -lpthread -lz

cc -g -Wall -Werror -Wfloat-equal -Wpointer-arith -O2 -I../ ../librdkafka.a
test.o 0002-unkpart.c -o 0002-unkpart.test ../librdkafka.a -lpthread -lz

cc -g -Wall -Werror -Wfloat-equal -Wpointer-arith -O2 -I../ ../librdkafka.a
test.o 0003-msgmaxsize.c -o 0003-msgmaxsize.test ../librdkafka.a -lpthread
-lz

for i in 0001-multiobj.test 0002-unkpart.test 0003-msgmaxsize.test ; do
./run-test.sh $i || exit 1 ; done

\e[36m############## 0001-multiobj.test ################\e[0m

\e[36m### Running test 0001-multiobj.test in bare mode ###\e[0m

Creating and destroying 100 kafka instances

Test failed at test.c:77:test_conf_init():

test.conf not found

\e[31m###

Test 0001-multiobj.test in bare mode FAILED!

###\e[0m

\e[36m### Running test 0001-multiobj.test in valgrind mode ###\e[0m

./run-test.sh: line 43: valgrind: command not found

\e[31m###

Test 0001-multiobj.test in valgrind mode FAILED!

###\e[0m

make[1]: *** [all] Error 1

make: *** [tests] Error 2

Thanks again guys,

Greg

On Tue, Jan 7, 2014 at 10:17 AM, Magnus Edenhill
notifications@github.comwrote:

Can you give it another go with an updated master? I changed the install
options to be more classic.


Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-31745580
.

@drdee
Copy link

drdee commented Jan 8, 2014

Enjoying my holidays but will look at this next week.

@drdee
Copy link

drdee commented Jan 9, 2014

So you need to copy test.conf.example in tests/ to test.conf that should make the tests pass. I have created one small pull request to fix those minor OSX issues. On my OSX 10.9 machine all tests pass.

@drdee
Copy link

drdee commented Jan 12, 2014

@gpatmore can you confirm that the latest version on master works on OSX 10.9?

@gpatmore
Copy link
Contributor Author

Sorry it's taken me so long to get back to you on this, I've been swamped
lately :(

Sadly, make is failing again:

CCCNYC01GAPs-MacBook-Pro:librdkafka gpatmore$ make clean

rm -f rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o
rdkafka_defaultconf.o rdkafka_timer.o rdkafka_offset.o rdcrc32.o rdgz.o
rdaddr.o rdrand.o rdthread.o rdqueue.o rdlog.o snappy.o rdkafka.d
rdkafka_broker.d rdkafka_msg.d rdkafka_topic.d rdkafka_defaultconf.d
rdkafka_timer.d rdkafka_offset.d rdcrc32.d rdgz.d rdaddr.d rdrand.d
rdthread.d rdqueue.d rdlog.d snappy.d \

librdkafka_.a librdkafka_.so librdkafka*.so.1

make -C tests clean

rm -f 0001-multiobj.test 0002-unkpart.test 0003-msgmaxsize.test

make -C examples clean

rm -f rdkafka_example rdkafka_performance

CCCNYC01GAPs-MacBook-Pro:librdkafka gpatmore$ make

cc -MD -MP -O2 -Wall -Werror -Wfloat-equal -Wpointer-arith -I. -g -DSG
-fPIC -c rdkafka.c

cc -MD -MP -O2 -Wall -Werror -Wfloat-equal -Wpointer-arith -I. -g -DSG
-fPIC -c rdkafka_broker.c

rdkafka_broker.c:395:44: error: use of undeclared identifier 'MSG_NOSIGNAL'

    r = sendmsg(rkb->rkb_s, msg, MSG_DONTWAIT|MSG_NOSIGNAL);

                                              ^

1 error generated.

make: *** [rdkafka_broker.o] Error 1

CCCNYC01GAPs-MacBook-Pro:librdkafka gpatmore$ git branch

  • master

CCCNYC01GAPs-MacBook-Pro:librdkafka gpatmore$ git rev-parse --verify HEAD

9fcc463

CCCNYC01GAPs-MacBook-Pro:librdkafka gpatmore$

On Sun, Jan 12, 2014 at 5:49 AM, Diederik van Liere <
notifications@github.com> wrote:

@gpatmore https://github.com/gpatmore can you confirm that the latest
version on master works on OSX 10.9?


Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-32119780
.

@drdee
Copy link

drdee commented Jan 17, 2014

Yes, it's now failing for me as well :) @edenhill introduced a regression in one of his most recent commits ;)
The error is: rdkafka_broker.c:395:44: error: use of undeclared identifier 'MSG_NOSIGNAL'

@drdee
Copy link

drdee commented Jan 17, 2014

#62 fixes the MSG_NOSIGNAL issue.

@edenhill
Copy link
Contributor

I'm sorry about this mess but it is hard to keep all platforms happy without automatic builds for all platforms.
Unfortunately travis does not provide this and I'm looking into other alternatives.

It should compile on osx now...

@gpatmore
Copy link
Contributor Author

no sweat man. Your getting through it. I'll try to be more available as a testing resource.

Sent from my iPhone

On Jan 16, 2014, at 9:12 PM, Magnus Edenhill notifications@github.com wrote:

I'm sorry about this mess but it is hard to keep all platforms happy without automatic builds for all platforms.
Unfortunately travis does not provide this and I'm looking into other alternatives.

It should compile on osx now...


Reply to this email directly or view it on GitHub.

@edenhill
Copy link
Contributor

Reopen if still an issue

@gpatmore
Copy link
Contributor Author

fix: #63

On Thu, Jan 16, 2014 at 10:33 PM, Magnus Edenhill
notifications@github.comwrote:

Closed #49 #49.


Reply to this email directly or view it on GitHubhttps://github.com//issues/49
.

@leroix
Copy link

leroix commented May 31, 2014

I think maybe building on osx 10.9 is broken again. Tried on 2 different machines.

[librdkafka (master)]$./configure
using cache file config.cache
checking for OS or distribution... ok (osx)
checking for C compiler from CC env... ok (cached)
checking for C++ compiler from CXX env... failed
checking for C++ compiler (g++)... ok (cached)
checking executable ld... ok (cached)
checking executable nm... ok (cached)
checking executable objdump... failed (disable)
checking executable strip... ok (cached)
checking for pkgconfig (by command)... ok (cached)
checking for install (by command)... failed
checking for PIC (by compile)... ok (cached)
checking for GNU-compatible linker options... failed
checking for OSX linker options... ok (cached)
checking for GNU linker-script ld flag... failed
checking for Solaris linker-script ld flag... failed (ignore)
checking for __atomic_32 (by compile)... ok (cached)
checking for __atomic_64 (by compile)... ok (cached)
checking for socket (by compile)... ok (cached)
parsing version '0x00080300'... ok (0.8.3)
checking for libpthread (by pkg-config)... failed
checking for libpthread (by compile)... ok
checking for zlib (by pkg-config)... failed
checking for zlib (by compile)... ok
checking for librt (by pkg-config)... failed
checking for librt (by compile)... failed
checking executable otool... ok (cached)
Generated rdkafka.pc
Generated Makefile.config
Generated config.h

Configuration summary:
prefix /usr/local
ARCH x86_64
CPU generic
MKL_DISTRO osx
CC clang
CXX g++
LD clang
NM nm
STRIP strip
CPPFLAGS -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith
PKG_CONFIG pkg-config
INSTALL install
LIB_LDFLAGS -shared -dynamiclib -Wl,-install_name,$(DESTDIR)$(libdir)/$(LIBNAME).so.$(LIBVER)
LDFLAGS -g
RDKAFKA_VERSION_STR 0.8.3
LIBS -lpthread -lz
CXXFLAGS -Wno-non-virtual-dtor
SYMDUMPER otool -TV
exec_prefix /usr/local
bindir /usr/local/bin
sbindir /usr/local/sbin
libexecdir /usr/local/libexec
datadir /usr/local/share
sysconfdir /usr/local/etc
sharedstatedir /usr/local/com
localstatedir /usr/local/var
libdir /usr/local/lib
includedir /usr/local/include
infodir /usr/local/info
mandir /usr/local/man
Generated config.cache

Now type 'make' to build
[librdkafka (master)]$make
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdkafka.c -o rdkafka.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdkafka_broker.c -o rdkafka_broker.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdkafka_msg.c -o rdkafka_msg.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdkafka_topic.c -o rdkafka_topic.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdkafka_defaultconf.c -o rdkafka_defaultconf.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdkafka_timer.c -o rdkafka_timer.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdkafka_offset.c -o rdkafka_offset.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdgz.c -o rdgz.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdaddr.c -o rdaddr.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdrand.c -o rdrand.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdthread.c -o rdthread.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdqueue.c -o rdqueue.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -c rdlog.c -o rdlog.o
Creating shared library librdkafka.so.1
clang -g -shared -dynamiclib -Wl,-install_name,/usr/local/lib/librdkafka.so.1 rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_defaultconf.o rdkafka_timer.o rdkafka_offset.o rdcrc32.o rdgz.o rdaddr.o rdrand.o rdthread.o rdqueue.o rdlog.o snappy.o -o librdkafka.so.1 -lpthread -lz
Creating static library librdkafka.a
ar rcs librdkafka.a rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_defaultconf.o rdkafka_timer.o rdkafka_offset.o rdcrc32.o rdgz.o rdaddr.o rdrand.o rdthread.o rdqueue.o rdlog.o snappy.o
Checking librdkafka integrity
librdkafka.so.1 OK
librdkafka.a OK
Symbol visibility FAILED
Checking librdkafka++ integrity
librdkafka++.so.1 OK
librdkafka++.a OK
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C examples
clang -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -I../src rdkafka_example.c -o rdkafka_example -g
../src/librdkafka.a -lpthread -lz
Assertion failed: (!"Unknown operand"), function LinkLocation, file /SourceCache/dwarf_utilities/dwarf_utilities-114/source/DWARFdSYM.cpp, line 1704.
clang: error: unable to execute command: Abort trap: 6
clang: error: dsymutil command failed due to signal (use -v to see invocation)
make[1]: *** [rdkafka_example] Error 254
make: *** [examples] Error 2

@edenhill
Copy link
Contributor

edenhill commented Jun 1, 2014

It seems to be hitting some old, supposedly fixed, GCC bug (but this is using clang..):

https://gcc.gnu.org/bugzilla/show_bug.cgi?format=multiple&id=41405
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41473

I currently dont have a 10.9 box, so can you try the following two:

CC=clang CXX=clang++ ./configure --reconfigure && make clean all

and:

CC=gcc CXX=g++ ./configure --reconfigure && make clean all

Thanks,
Magnus

@edenhill edenhill reopened this Jun 1, 2014
@leroix
Copy link

leroix commented Jun 2, 2014

Interesting, I'll look into that gcc bug a bit more, but, yea, this is definitely clang

CC=clang CXX=clang++ ./configure --reconfigure && make clean all
https://gist.github.com/leroix/b9830ea2f9b9eec69a55

CC=gcc CXX=g++ ./configure --reconfigure && make clean all
looks like this may have actually compiled, but the symbol visibility check failed
https://gist.github.com/leroix/7d6187433f777a189936

@edenhill
Copy link
Contributor

edenhill commented Jun 2, 2014

Could you try the following:

CC=clang CXX=clang++ ./configure --reconfigure && make clean all

wait for it to build and fail and then do:

cd src
ranlib librdkafka.a
cd ..
make

@leroix
Copy link

leroix commented Jun 2, 2014

Ok, here's the sequence:

[librdkafka (master *)]$CC=clang CXX=clang++ ./configure --reconfigure && make clean all
Reconfiguring: /Users/leroix/librdkafka/configure
using cache file config.cache
checking for OS or distribution... ok (osx)
checking for C compiler from CC env... ok (cached)
checking for C++ compiler from CXX env... ok (cached)
checking executable ld... ok (cached)
checking executable nm... ok (cached)
checking executable objdump... failed (disable)
checking executable strip... ok (cached)
checking for pkgconfig (by command)... ok (cached)
checking for install (by command)... failed
checking for PIC (by compile)... ok (cached)
checking for GNU-compatible linker options... failed
checking for OSX linker options... ok (cached)
checking for GNU linker-script ld flag... failed
checking for Solaris linker-script ld flag... failed (ignore)
checking for __atomic_32 (by compile)... ok (cached)
checking for __atomic_64 (by compile)... ok (cached)
checking for socket (by compile)... ok (cached)
parsing version '0x00080300'... ok (0.8.3)
checking for libpthread (by pkg-config)... failed
checking for libpthread (by compile)... ok
checking for zlib (by pkg-config)... failed
checking for zlib (by compile)... ok
checking for librt (by pkg-config)... failed
checking for librt (by compile)... failed
checking executable otool... ok (cached)
Generated rdkafka.pc
Generated Makefile.config
Generated config.h

Configuration summary:
  prefix                   /usr/local
  ARCH                     x86_64
  CPU                      generic
  MKL_DISTRO               osx
  CC                       clang
  CXX                      clang++
  LD                       clang
  NM                       nm
  STRIP                    strip
  CPPFLAGS                 -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith
  PKG_CONFIG               pkg-config
  INSTALL                  install
  LIB_LDFLAGS              -shared -dynamiclib -Wl,-install_name,$(DESTDIR)$(libdir)/$(LIBNAME).so.$(LIBVER)
  LDFLAGS                  -g
  RDKAFKA_VERSION_STR      0.8.3
  LIBS                     -lpthread -lz
  CXXFLAGS                 -Wno-non-virtual-dtor
  SYMDUMPER                otool -TV
  exec_prefix              /usr/local
  bindir                   /usr/local/bin
  sbindir                  /usr/local/sbin
  libexecdir               /usr/local/libexec
  datadir                  /usr/local/share
  sysconfdir               /usr/local/etc
  sharedstatedir           /usr/local/com
  localstatedir            /usr/local/var
  libdir                   /usr/local/lib
  includedir               /usr/local/include
  infodir                  /usr/local/info
  mandir                   /usr/local/man
Generated config.cache

Now type 'make' to build
rm -f *.test test.o
rm -f rdkafka_example rdkafka_performance rdkafka_example_cpp
rm -f rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_defaultconf.o rdkafka_timer.o rdkafka_offset.o rdcrc32.o rdgz.o rdaddr.o rdrand.o rdthread.o rdqueue.o rdlog.o snappy.o rdkafka.d rdkafka_broker.d rdkafka_msg.d rdkafka_topic.d rdkafka_defaultconf.d rdkafka_timer.d rdkafka_offset.d rdcrc32.d rdgz.d rdaddr.d rdrand.d rdthread.d rdqueue.d rdlog.d snappy.d
rm -f librdkafka*.a librdkafka*.so librdkafka*.so.1 \
        librdkafka.lds
rm -f RdKafka.o ConfImpl.o HandleImpl.o ConsumerImpl.o ProducerImpl.o TopicImpl.o MessageImpl.o RdKafka.d ConfImpl.d HandleImpl.d ConsumerImpl.d ProducerImpl.d TopicImpl.d MessageImpl.d
rm -f librdkafka++*.a librdkafka++*.so librdkafka++*.so.1 \
        librdkafka++.lds
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdkafka.c -o rdkafka.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdkafka_broker.c -o rdkafka_broker.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdkafka_msg.c -o rdkafka_msg.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdkafka_topic.c -o rdkafka_topic.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdkafka_defaultconf.c -o rdkafka_defaultconf.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdkafka_timer.c -o rdkafka_timer.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdkafka_offset.c -o rdkafka_offset.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdcrc32.c -o rdcrc32.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdgz.c -o rdgz.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdaddr.c -o rdaddr.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdrand.c -o rdrand.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdthread.c -o rdthread.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdqueue.c -o rdqueue.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c rdlog.c -o rdlog.o
clang -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith  -c snappy.c -o snappy.o
Generating linker script librdkafka.lds from rdkafka.h
Creating shared library librdkafka.so.1
clang -g -shared -dynamiclib -Wl,-install_name,/usr/local/lib/librdkafka.so.1 rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_defaultconf.o rdkafka_timer.o rdkafka_offset.o rdcrc32.o rdgz.o rdaddr.o rdrand.o rdthread.o rdqueue.o rdlog.o snappy.o -o librdkafka.so.1 -lpthread -lz
Creating static library librdkafka.a
ar rcs librdkafka.a rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_defaultconf.o rdkafka_timer.o rdkafka_offset.o rdcrc32.o rdgz.o rdaddr.o rdrand.o rdthread.o rdqueue.o rdlog.o snappy.o
Checking librdkafka integrity
librdkafka.so.1                OK
librdkafka.a                   OK
Symbol visibility              FAILED
clang++ -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -Wno-non-virtual-dtor -c RdKafka.cpp -o RdKafka.o
clang++ -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -Wno-non-virtual-dtor -c ConfImpl.cpp -o ConfImpl.o
clang++ -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -Wno-non-virtual-dtor -c HandleImpl.cpp -o HandleImpl.o
clang++ -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -Wno-non-virtual-dtor -c ConsumerImpl.cpp -o ConsumerImpl.o
clang++ -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -Wno-non-virtual-dtor -c ProducerImpl.cpp -o ProducerImpl.o
clang++ -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -Wno-non-virtual-dtor -c TopicImpl.cpp -o TopicImpl.o
clang++ -MD -MP -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -Wno-non-virtual-dtor -c MessageImpl.cpp -o MessageImpl.o
Generating linker script librdkafka++.lds from rdkafkacpp.h
Creating shared library librdkafka++.so.1
clang -g -shared -dynamiclib -Wl,-install_name,/usr/local/lib/librdkafka++.so.1 RdKafka.o ConfImpl.o HandleImpl.o ConsumerImpl.o ProducerImpl.o TopicImpl.o MessageImpl.o -o librdkafka++.so.1 -L../src -lrdkafka -lpthread -lz -lstdc++
Creating static library librdkafka++.a
ar rcs librdkafka++.a RdKafka.o ConfImpl.o HandleImpl.o ConsumerImpl.o ProducerImpl.o TopicImpl.o MessageImpl.o
Checking librdkafka++ integrity
librdkafka++.so.1              OK
librdkafka++.a                 OK
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C examples
clang -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -I../src rdkafka_example.c -o rdkafka_example -g \
        ../src/librdkafka.a -lpthread -lz
Assertion failed: (!"Unknown operand"), function LinkLocation, file /SourceCache/dwarf_utilities/dwarf_utilities-114/source/DWARFdSYM.cpp, line 1704.
clang: error: unable to execute command: Abort trap: 6
clang: error: dsymutil command failed due to signal (use -v to see invocation)
make[1]: *** [rdkafka_example] Error 254
make: *** [examples] Error 2
[librdkafka (master *)]$cd src
[src (master *)]$ranlib librdkafka.a
[src (master *)]$cd ..
[librdkafka (master *)]$make
Checking librdkafka integrity
librdkafka.so.1                OK
librdkafka.a                   OK
Symbol visibility              FAILED
Checking librdkafka++ integrity
librdkafka++.so.1              OK
librdkafka++.a                 OK
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C examples
clang -g -O2 -fPIC -Wall -Werror -Wfloat-equal -Wpointer-arith -I../src rdkafka_example.c -o rdkafka_example -g \
        ../src/librdkafka.a -lpthread -lz
Assertion failed: (!"Unknown operand"), function LinkLocation, file /SourceCache/dwarf_utilities/dwarf_utilities-114/source/DWARFdSYM.cpp, line 1704.
clang: error: unable to execute command: Abort trap: 6
clang: error: dsymutil command failed due to signal (use -v to see invocation)
make[1]: *** [rdkafka_example] Error 254
make: *** [examples] Error 2

@leroix
Copy link

leroix commented Jun 3, 2014

Not sure if this is all that helpful, but I found that if I remove the instruction to compile the examples in examples/Makefile, make finishes without error. I then ran sudo make install and tested it out with kafkacat. It seems to be working.

@edenhill
Copy link
Contributor

edenhill commented Jun 3, 2014

Yeah, it's the static linking of librdkafka.a that fails for some reason.
I dont know if it's a problem with the static library or the linking.

@edenhill
Copy link
Contributor

edenhill commented Jun 3, 2014

This is a problem with debugging symbols.
Removing the '-g' from the rdkafka_example build fixes it.
I need to understand why this is the case though.

@edenhill
Copy link
Contributor

If someone is on 10.7 or 10.8, please have a go to see that this doesnt break compiles.
Works on 10.9 with clang now.

@Kentzo
Copy link

Kentzo commented Jul 11, 2015

I came across this issue when googling for the following error: Assertion failed: (!"Unknown operand"), function LinkLocation, file /SourceCache/dwarf_utilities/dwarf_utilities-114/source/DWARFdSYM.cpp, line 1704.

Here is the solution: https://gist.github.com/Kentzo/e038118346f1e1a582ac

@edenhill
Copy link
Contributor

Thanks @Kentzo

@kparadkar
Copy link

@edenhill I am running on El Capitan Mac OSX 10.11.16 but I am unfortunately stuck on 0.9.1.
I downloaded 0.9.1 code from your when I try to compile (using make) I get 'openssl/ssl.h' not found error. (I noticed that you have WITH_SSL flag set to 'y' in 0.9.1 and it is 'n' in master in Makefile.config)

Since I was getting those errors (I didn't want to make changes to code I got from your repo) I installed openssl on MAC (irrespective of BUG Dont use OpenSSL on OSX #408). And now I get following errors:
Undefined symbols for architecture x86_64:
"_OPENSSL_init_crypto", referenced from:
_rd_kafka_transport_ssl_init in rdkafka_transport.o
"_OPENSSL_init_ssl", referenced from:
_rd_kafka_transport_ssl_init in rdkafka_transport.o
"_TLS_client_method", referenced from:
_rd_kafka_transport_ssl_ctx_init in rdkafka_transport.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

So i have couple of questions here:

  1. I dont need openssl for my test code, then shouldn't library compile irrespective of presence of openssl/ssl.h?
  2. Do you have any idea about why I still get errors even after installing openssl?
  3. Why does master say WITH_SSL = n ? I noticed that the bug Dont use OpenSSL on OSX #408 was reported on Nov3rd 2015 and release date of 0.9.1 was May23rd 2016, so is there any other reason for keeping openssl in 0.9.1 but remove from 0.9.2 ?

Please help as I have to get this library to compile on 0.9.1 !

Thank you.

@edenhill
Copy link
Contributor

You need to pull in this commit to make ./configure correctly detect OpenSSL on OSX, or actually not to detect it, but doing that properly.

2add32d

@kparadkar
Copy link

After pulling this commit, now make complains about SSL_CTX
./rdkafka_conf.h:90:3: error: unknown type name 'SSL_CTX'
SSL_CTX *ctx;

If I understand correctly from the code this is all conditional for WITH_SSL = y.
What am I missing here exactly? since include 'openssl/ssl.h' succeeded ?

@edenhill
Copy link
Contributor

That looks very weird.
If openssl/ssl.h is found it should be able to commit.
Maybe you are on a incompatible version of OpenSSL?
librdkafka supports 1.0.x, not 1.1.x

czyzykowski added a commit to czyzykowski/nixpkgs that referenced this issue May 16, 2017
Without --disable-ssl librdkafka ./configure detects that OpenSSL is
installed but when it tries to link it fails because the default
version is incompatible (1.0.2 vs required 1.1.x).

confluentinc/librdkafka#49 (comment)
@barracuda156
Copy link

I came across this issue when googling for the following error: Assertion failed: (!"Unknown operand"), function LinkLocation, file /SourceCache/dwarf_utilities/dwarf_utilities-114/source/DWARFdSYM.cpp, line 1704.

Here is the solution: https://gist.github.com/Kentzo/e038118346f1e1a582ac

@Kentzo Do you know what commit specifically fixed that in dsymutil?

The bug is also showing up on 10.6:
https://trac.macports.org/ticket/65291
https://trac.macports.org/ticket/69188

PKRoma pushed a commit to PKRoma/librdkafka that referenced this issue Nov 4, 2024
add missing consumer metrics described in the KIP:

* consumer.coordinator.rebalance.latency.avg
* consumer.coordinator.rebalance.latency.max
* consumer.coordinator.rebalance.latency.total
* consumer.fetch.manager.fetch.latency.avg
* consumer.fetch.manager.fetch.latency.max
* consumer.poll.idle.ratio.avg
* consumer.coordinator.commit.latency.avg
* consumer.coordinator.commit.latency.max

additionally: 
* add unit tests for all the metrics
* add integrations tests with the producer or consumer while they're active
* configurable group initial rebalance delay ms to make integration tests reusable with both producer and consumer
---------
Co-authored-by: Anchit Jain <anjain@confluent.io>
Co-authored-by: mahajanadhitya <amahajan@confluent.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants