silviucpp / erlkaf

Erlang kafka driver based on librdkafka
MIT License
84 stars 41 forks source link

MacOs Build fail #18

Closed pankajsoni19 closed 4 years ago

pankajsoni19 commented 4 years ago

I am building on macos catalina 10.15.1

logs

make[3]: Entering directory `/Users/pankajsoni/Documents/Git/Rivers/ejabberd/master/deps/erlkaf/c_src'
 CPP    erlkaf_producer.cc
 CPP    queuemanager.cc
 CPP    topicmanager.cc
 CPP    erlkaf_logger.cc
 CPP    erlkaf_config.cc
 CPP    erlkaf_nif.cc
 CPP    erlkaf_consumer.cc
 CPP    nif_utils.cc
 LD     erlkaf_nif.so
Undefined symbols for architecture x86_64:
  "_OPENSSL_sk_pop_free", referenced from:
      _rd_kafka_transport_ssl_ctx_init in librdkafka.a(rdkafka_transport.o)
  "_OpenSSL_version", referenced from:
      _rd_kafka_transport_ssl_ctx_init in librdkafka.a(rdkafka_transport.o)
  "_OpenSSL_version_num", referenced from:
      _rd_kafka_transport_ssl_ctx_init in librdkafka.a(rdkafka_transport.o)
  "_SSL_CTX_set_options", referenced from:
      _rd_kafka_transport_ssl_ctx_init in librdkafka.a(rdkafka_transport.o)
  "_TLS_client_method", referenced from:
      _rd_kafka_transport_ssl_ctx_init in librdkafka.a(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)
make[3]: *** [/Users/pankajsoni/Documents/Git/Rivers/ejabberd/master/deps/erlkaf/c_src/../priv/erlkaf_nif.so] Error 1
make[3]: Leaving directory `/Users/pankajsoni/Documents/Git/Rivers/ejabberd/master/deps/erlkaf/c_src'
silviucpp commented 4 years ago

Sorry I don't have catalina to test. but problem seems related to the openssl version .

You can use brew info openssl to see what version do you have

pankajsoni19 commented 4 years ago

weird output

brew info openssl

brew info openssl
openssl@1.1: stable 1.1.1d (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit

which openssl

pankaj-macbook:master $ which openssl
/usr/local/bin/openssl
pankaj-macbook:master $ openssl version
OpenSSL 1.0.2t  10 Sep 2019
silviucpp commented 4 years ago

I'm facing same issue. seems an update to openssl broken the build. Will investigate

pankajsoni19 commented 4 years ago

I had set path to openssl in /etc/paths.d and in bashrc. Both were pointing to different versions. So I removed both of them. Deleted openssl folder. uninstalled using brew. deleted symlinks.

Then I re-installed using brew and readded this it just under paths.d

>  cat /etc/paths.d/openssl 
> /usr/local/opt/openssl/bin/openssl
silviucpp commented 4 years ago

For me just upgrading all brew packages, including openssl fixed the problem.