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

UndefVarError: libsdl2_{ttf,image} not defined (Apple Silicon / M1 Mac) #58

Closed
shg opened this issue Apr 16, 2022 · 6 comments
Closed

Comments

@shg
Copy link

shg commented Apr 16, 2022

I tried to run the file in the example directory and got an error. I see the same error when I tried GZExamples. Any idea? I installed master of SimpleMediaLayer and GameZero. I'm on M1 Mac and sdl2 libraries are installed by homebrew.

julia> using GameZero
julia> rungame("~/.julia/packages/GameZero/e03cc/example/BasicGame/basic.jl")
ERROR: UndefVarError: libsdl2_ttf not defined
Stacktrace:
 [1] TTF_Init
   @ ~/.julia/packages/SimpleDirectMediaLayer/gJANO/src/LibSDL2.jl:5233 [inlined]
 [2] initSDL()
   @ GameZero ~/.julia/packages/GameZero/17XG0/src/GameZero.jl:284
 [3] initgame(jlf::String, external::Bool)
   @ GameZero ~/.julia/packages/GameZero/17XG0/src/GameZero.jl:208
 [4] rungame(jlf::String, external::Bool)
   @ GameZero ~/.julia/packages/GameZero/17XG0/src/GameZero.jl:186
 [5] rungame(jlf::String)
   @ GameZero ~/.julia/packages/GameZero/17XG0/src/GameZero.jl:185
 [6] top-level scope
   @ REPL[5]:1
julia> versioninfo()
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.2.0)
  CPU: Apple M1 Max
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)
Environment:
  JULIA_GR_PROVIDER = GR
(@v1.7) pkg> st GameZero SimpleDirectMediaLayer
      Status `~/.julia/environments/v1.7/Project.toml`
  [9da27670] GameZero v0.3.0 `https://github.com/aviks/GameZero.jl.git#master`
  [98e33af6] SimpleDirectMediaLayer v0.3.0 `https://github.com/JuliaMultimedia/SimpleDirectMediaLayer.jl.git#master`
$ brew list|grep sdl2
sdl2
sdl2_gfx
sdl2_image
sdl2_mixer
sdl2_net
sdl2_ttf
@aviks
Copy link
Owner

aviks commented Apr 18, 2022

Yeah, SDL2_ttf jll is not built for apple m1.

cf: https://github.com/JuliaBinaryWrappers/SDL2_ttf_jll.jl/tree/main/src/wrappers

Someone needs to rebuild this in Yggdrasil

@shg
Copy link
Author

shg commented Apr 18, 2022

Thank you. I wish I could contribute but I have no experience with jll. I will wait for someone else to work on it.

@shg shg changed the title UndefVarError: libsdl2_ttf not defined UndefVarError: libsdl2_ttf not defined (Apple Silicon / M1 Mac) May 11, 2022
@giordano
Copy link
Contributor

I haven't tried myself, but this should have been fixed by JuliaPackaging/Yggdrasil#5483. Curiously, JuliaPackaging/Yggdrasil#3367 was already meant to build the library for this platform, but failed to do so in practice.

@shg shg changed the title UndefVarError: libsdl2_ttf not defined (Apple Silicon / M1 Mac) UndefVarError: libsdl2_{ttf,image} not defined (Apple Silicon / M1 Mac) Sep 16, 2022
@shg
Copy link
Author

shg commented Sep 16, 2022

To make GameZero work on Apple Silicom Mac, it seems SDL2_image_jll needs to be built as well.

JuliaPackaging/Yggdrasil#5484

I renamed the title and keep this issue open.

@aviks
Copy link
Owner

aviks commented Sep 17, 2022

SDL2_image_jll should now be available for M1

@shg
Copy link
Author

shg commented Sep 18, 2022

I confirmed SDL2 related issues are fixed on my M1 Mac. Thank you very much!

I can run examples although there are some issues related to screen resolution. I will register another issue if necessary after a little more digging.

@shg shg closed this as completed Sep 18, 2022
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

3 participants