seanmor5 / alex

Arcade Learning Environment for Elixir
32 stars 2 forks source link

brew `sdl` no longer exists #2

Open aegatlin opened 1 year ago

aegatlin commented 1 year ago

Hello, I'm reading "Genetic Algorithms in Elixir" for the (public discord) Elixir book club (which you are invited to :smile:). Great book, thanks for making it ❤️

Ch 10 intros Tetris and the MacOS install calls for brew install sdl. sdl does not exist anymore.

There is sdl-compat12, which maintains API compat with sdl 1.2, but underneath is in sdl2: https://github.com/libsdl-org/sdl12-compat.

There is sdl2, which does not work with mix deps.compile.

I tried sdl-compat12 and got to the erl_nif.h problem and used this issue answer but got blocked on this error during mix.compile

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [my/path/to/genetic/deps/alex/priv/alex/libale_c.so] Error 1
make[1]: *** [CMakeFiles/ale-c-lib.dir/all] Error 2
make: *** [all] Error 2

==> alex
warning: Mix compiler :ale was supposed to return {:ok | :noop | :error, [diagnostic]} but it returned :error
Generated alex app

My current work from the book is here: https://github.com/aegatlin/genetic , in case it's useful.