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

Apple M1 issues #95

Open
jjoliveira opened this issue Sep 27, 2021 · 3 comments
Open

Apple M1 issues #95

jjoliveira opened this issue Sep 27, 2021 · 3 comments

Comments

@jjoliveira
Copy link

I'm having some problems with lilliput on my M1 machine.

Running go get github.com/discord/lilliput returns me:

# github.com/discord/lilliput
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libswscale.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libavformat.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libavfilter.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libz.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libbz2.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libavutil.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libavcodec.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libopencv_core.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libwebp.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/share/OpenCV/3rdparty/lib/libippicv.a, missing required architecture arm64 in file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/share/OpenCV/3rdparty/lib/libippicv.a (2 slices)
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libpng.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libjpeg.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libgif.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libopencv_imgproc.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../go/pkg/mod/github.com/discord/lilliput@v0.0.0-20210720001558-e1547514bd5f/deps/osx/lib/libopencv_imgcodecs.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_DGifCloseFile", referenced from:
      _giflib_decoder_release in _x006.o
  "_DGifExtensionToGCB", referenced from:
      _giflib_decoder_decode_frame in _x006.o
      _giflib_encoder_encode_frame in _x006.o
  ...
  "_sws_scale", referenced from:
      _avcodec_decoder_decode in _x005.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My machine go version and arch is as follow:

❯ go version
go version go1.17 darwin/arm64

Is this a known issue? Is there any workaround?

Cheers

@kenshin54
Copy link

I'm working on a fix around this issue, so far I have successfully built it on linux/arm64, which can be used with Docker on Mac without performance degradation. For the Apple M1, it seems more challenge. I'm happy to create a PR after that. But this would potentially increase the cost of all upcoming changes, the maintainers have to update all the libs for linux/drawin * amd64/arm64.

Just link my forked version here for anyone who has interests.

@dougnd
Copy link

dougnd commented Feb 7, 2022

Thank you @kenshin54! It looks like you've got it workin on Apple M1 and opened the PR: #98 . I've tested it and it seems to work for me on my Mac natively (darwin/arm64) and in docker (linux/arm64).

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

Successfully merging a pull request may close this issue.

4 participants
@kenshin54 @dougnd @jjoliveira and others