silviucpp / erlkaf

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

Build failing on mac #15

Closed pankajsoni19 closed 5 years ago

pankajsoni19 commented 5 years ago

I am trying to use the library on mac. The esq dependency is failing to compile with

src/esq_queue.erl: undefined parse transform 'category'

If I download esq repo, it does compiles by itself. Can you check please.

silviucpp commented 5 years ago

Hello,

I'm using mac os every day and it's working fine. can you please come up with more details ?

Silviu

silviucpp commented 5 years ago

BTW also tavis ci has osx integrated and build pass: https://travis-ci.org/silviucpp/erlkaf

pankajsoni19 commented 5 years ago

I am using this in an erlang.mk based build project. This is included as a dependency. I will do some more digging on my end.

silviucpp commented 5 years ago

I never used erlang.mk . Project is tested via rebar3, rebar and mix

pankajsoni19 commented 5 years ago

I am able to build and run the code. I am getting Segmentation fault 11 when the lib loads on server start.

These are some of the logs while compiling. Can you guide?

cc -MD -MP -I/usr/local/opt/openssl/include/ -I/usr/local/opt/openssl/include/ -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/
usr/local/opt/openssl/include/ -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -DLIBRDKAFKA_GIT_VERSION="\"v1.0.1\"" -I/usr/local/
opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -fPIC -I"" -I"" -fPIC -I"" -I"" -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/loca
l/opt/expat/include -fPIC -I"" -I"" -fPIC -I"" -I"" -I/usr/local/Cellar/openssl/1.0.2s/include -I/usr/local/Cellar/openssl/1.0.2s/include -I/usr/local/Cellar/lz4/1.9.1/in
clude -I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include -fPIC -I"" -I"" -fPIC -I"" -I"" -I/usr/local/Cellar/openssl/1.0.2s/include -I/
usr/local/Cellar/openssl/1.0.2s/include -I/usr/local/Cellar/lz4/1.9.1/include -c rdkafka_sasl_cyrus.c -o rdkafka_sasl_cyrus.o
In file included from rdkafka_sasl_cyrus.c:29:
In file included from ./rdkafka_int.h:46:
./rdtime.h:172:17: warning: 'timespec_get' is only available on macOS 10.15 or newer [-Wunguarded-availability-new]
timespec_get(tspec, TIME_UTC);
^~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:199:5: note: 'timespec_get' has been marked as being introduced in macOS 10.15 here, but the
deployment target is macOS 10.14.0
int timespec_get(struct timespec *ts, int base);
^
./rdtime.h:172:17: note: enclose 'timespec_get' in a __builtin_available check to silence this warning
timespec_get(tspec, TIME_UTC);
silviucpp commented 5 years ago

What os are you using ? I tested only on High Sierra and last xcode. Same apply for travis.

Silviu

pankajsoni19 commented 5 years ago

mojave 10.14.5

It works with: gmake -v GNU Make 4.2.1 Built for x86_64-apple-darwin17.0.0

It fails with gmake -v GNU Make 4.2.1 Built for x86_64-apple-darwin18.2.0

pankajsoni19 commented 5 years ago

:) I have 2 macs. The gnu make differs on the macs. It is working on one and failing on another. Mac 10.15 is not available for download, how did you get it?

silviucpp commented 5 years ago

Hello,

I don't know why is not working for you and I don't have time to digg into it. I never used gmake to build the library. It's tested only with XCode 8+.

If you want to use another build chain please investigated yourself.

pankajsoni19 commented 5 years ago

Can you share build steps for xcode. I can take it from there.

silviucpp commented 5 years ago

Just install last XCode and Command Line tools for Xcode then: brew install openssl lz4 zstd And from project root run: ./rebar3 compile

Please look into travis scripts