erlang-czmq
erlang-czmq copied to clipboard
Doesn't link correctly on systems with clock_gettime
On Ubuntu, a program that uses clock_gettime (in both libsodium and zeromq) requires the "-rt" library. Because rebar.config.script hard-codes the libraries, czmq-port doesn't link correctly.
This commit appears to address this: 46091115867541db58ff9cdc5211c02773ded0d2
However, this breaks the builds for OSX (no librt
there).
This is an issue in czmq imo. It used to be addressed in 2.1.0. but the bug came back in latest version and master.
@steven807 which version of czmq are you using?
on macosx you need to use the -lcrt flag:
--- a/c_src/Makefile.in
+++ b/c_src/Makefile.in
@@ -1,10 +1,10 @@
CC = @CC@
CFLAGS = -Wall -g2
INCLUDES = -I@ERLANG_LIB_DIR_erl_interface@/include
-LFLAGS = -L@ERLANG_LIB_DIR_erl_interface@/lib -lstdc++ -lrt
+LFLAGS = -L@ERLANG_LIB_DIR_erl_interface@/lib -lstdc++ -lcrt
LIBS = -lerl_interface -lei -lpthread -lczmq
STATIC_DIR = $(shell pwd)/.libs
-BUILD_CZMQ =
+BUILD_CZMQ =
ENABLE_STATIC = @enable_static@
ifeq ($(ENABLE_STATIC), yes)
The platform should probably be checked in the configure file and rebar to handle it. cc @gar1t (tested with latest czmq installed via homebrew)
sorry was a little too much busy. I am working on a fix, it should land tomorrow.
I was able to build it on Mac OS 10.10.3 by removing the -lrt
flag in rebar.config.script
and c_src/Makefile.in
.