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

Static linking with Drafts #127

Closed
sysbot opened this issue Apr 5, 2018 · 1 comment
Closed

Static linking with Drafts #127

sysbot opened this issue Apr 5, 2018 · 1 comment

Comments

@sysbot
Copy link

sysbot commented Apr 5, 2018

I am able to statically link zmq4 with golang but unable to get the draft code path working. Currently I'm successfully build with

CGO_CPPFLAGS="-I/usr/include" CGO_LDFLAGS="-L/usr/lib -L/usr/lib/x86_64-linux-gnu -lzmq -lpthread -lsodium -lrt -lstdc++ -lm -lc -lgcc" go build -v --ldflags "-v '-extldflags=-v -static -Wl,--allow-multiple-definition,--verbose=99'" -a main.go

Using shared libzmq, it seemed nothing else is need to use the draft code.

Looking at the code, I notice that ZMQ_BUILD_DRAFT_API is required so I've been trying to pass in ZMQ_BUILD_DRAFT_API via CGO_CFLAGS but so far unable to get it working. I'm unable to find any docs in zmq4 that made reference to draft built, where this is listed in goczmq[1]

CGO_CPPFLAGS="-I/usr/include" CGO_CFLAGS="-DZMQ_BUILD_DRAFT_API=1 -I/usr/local/include -L/usr/local/lib -lzmq" CGO_LDFLAGS="-L/usr/lib -L/usr/lib/x86_64-linux-gnu -lzmq -lpthread -lsodium -lrt -lstdc++ -lm -lc -lgcc" go build -v --ldflags "-v '-extldflags=-v -static -Wl,--allow-multiple-definition,--verbose=99'" -tags draft -a ./cmd/shepard

I'm currently using libzmq with:

CFLAGS="-DZMQ_BUILD_DRAFT_API=1" ./configure --enable-drafts --enable-static --with-libsodium

Any help is appreciated.

[1] zeromq/goczmq@b9c1810#diff-04c6e90faac2675aa89e2176d2eec7d8

@sysbot
Copy link
Author

sysbot commented Apr 5, 2018

Looked to be an issue on my end. The libzmq i was using was HEAD which is currently 4.3.1, draft required 4.2

@sysbot sysbot closed this as completed Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant