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

Whether pebbe/zmqt support ARM cpu and ubuntu 16.04 profile #162

Open
eyauwag opened this issue Apr 2, 2020 · 1 comment
Open

Whether pebbe/zmqt support ARM cpu and ubuntu 16.04 profile #162

eyauwag opened this issue Apr 2, 2020 · 1 comment

Comments

@eyauwag
Copy link

eyauwag commented Apr 2, 2020

I want to use pebbe/zmqt on my ARM cpu.But the README.md says "You can't do cross-compilation. That would disable C.".
I want to know whether I should give up my attempt to import pebbe/zmqt in my project for ARM environment.

@ghost
Copy link

ghost commented Oct 27, 2020

You can do cross compilation, but you need to compile zmq manually, and then add the libzmq version to Go. This is what I use:

CC="/usr/bin/aarch64-linux-gnu-gcc" \
CGO_FLAGS="-I/zmq-arm/include" \
CGO_LDFLAGS="-L/zmq-arm/lib" \
CGO_ENABLED=1 \
GOARCH=arm64 \
GODEBUG=asyncpreemptoff=1 \
go build --ldflags '-linkmode external -extldflags "-static -lstdc++ -z muldefs"'

Where /zmq-arm is a folder with include and lib. Be sure to match the zmq library version to the latest pebbe/zmq4 one. I happened to compile a 4.3.3 library, but (as of today) this repo uses 4.3.2 (available in Go modules), so it will fail on runtime

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