ibm-messaging / mq-golang

Calling IBM MQ from Go applications
Apache License 2.0
168 stars 60 forks source link

Runs on Apple Silicon? (arm64 M1) #174

Closed irl-segfault closed 3 years ago

irl-segfault commented 3 years ago

Does this have any known compatibility issues with the new Apple M1 chips? Some of my teammates are reporting issues getting MQ to work on that architecture and just wondering if anyone else has encountered this, gotten to work, or if there is a known incompatibility. Thanks

ibmmqmet commented 3 years ago

The MQ MacOS client package is only available in x64 format. The only ARM-based MQ client is built for Pi. You might be able to get a complete precompiled x64 application running on the M1 via Rosetta conversion, but I don't think you can mix Arm (that might be emitted by the Go compiler) and x64 (the MQ) code in the same process. And I don't know of anyone who has actually tried it. Perhaps use the Go cross-compile options?

If/when there's a native M1 version of the MQ client then I would expect this Go library to work with it, but not until then. And as far as I know, noone's submitted any requirements asking for such a package.

irl-segfault commented 3 years ago

Thanks for the update! Much appreciated

adamdecaf commented 1 year ago

Is there anything the community can do to help? Right now we see build failures due to missing arm values.

#0 0.346 go build -tags dynamic -mod=vendor -ldflags "-X github.com/moovfinancial/rtpgateway.Version=dev-8359193c" -o bin/rtpgateway github.com/moovfinancial/rtpgateway/cmd/rtpgateway                                                                                                                                       
#0 24.84 # github.com/ibm-messaging/mq-golang/v5/ibmmq
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:228:19: undefined: MQCNO_HANDLE_SHARE_NO_BLOCK
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:230:24: undefined: MQCNO_HANDLE_SHARE_NO_BLOCK
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:231:4: undefined: MQCNO_HANDLE_SHARE_BLOCK
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:232:21: undefined: MQCNO_HANDLE_SHARE_NO_BLOCK
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:1397:7: undefined: MQFMT_DEAD_LETTER_HEADER
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:1401:36: undefined: MQCC_FAILED
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:1402:15: undefined: MQRC_FORMAT_NOT_SUPPORTED
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:1419:19: undefined: MQ_PUT_DATE_LENGTH
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:1419:56: undefined: MQ_PUT_TIME_LENGTH
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqiDLH.go:52:15: undefined: MQRC_NONE
#0 24.84 vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqiDLH.go:52:15: too many errors
#0 25.27 make: *** [Makefile:61: build] Error 1

I was reading IBM MQ Developing Applications Reference.pdf and didn't see much of a difference needed for ARM, but I'm not very familiar with the hardware differences.

ibmmqmet commented 1 year ago

Have you installed the current version of the MQ Developers Toolkit for MacOS before trying to build? That has the M1 support. (It was first released at the end of 2022, so a long time after this issue was originally raised.)

adamdecaf commented 1 year ago

Using mq-golang on an M1 mac compiles and works for us. We are seeing those errors when building linux arm docker images though. I don't see a cmqc_linux_*.go file for linux and ARM, so the compile error makes sense.

ibmmqmet commented 1 year ago

There is not (as of today) any publicly available MQ for Linux arm64 client package. So even with a cqmc*.go file, it wouldn't help as the underlying C libraries could not be found.