seanmor5 / alex

Arcade Learning Environment for Elixir
32 stars 2 forks source link

erl_nif.h compile issue #1

Open zdenal opened 3 years ago

zdenal commented 3 years ago

Not sure it is issue of this library, but I am getting error related to path for erl_nif.h on macOs Big Sur.

using:

Elixir 1.11.3 (compiled with Erlang/OTP 21)
tmux_a_-t_main____tmux_new_-s_main

I have tried to find solution but w/o any success. Can anybody help? 🙏

seanmor5 commented 3 years ago

Hey, this usually occurs because erlang-dev is packaged separately and is not installed:

brew install erlang-dev

Might resolve the issue

zdenal commented 3 years ago

Ola @seanmor5 thanks for quick response. Getting Error: No available formula or cask with the name "erlang-dev". 😢

seanmor5 commented 3 years ago

You'll need to add Erlangs include path to your system wide include directory; however, I'm in the process of refactoring this library, so it might be better to wait a week or 2 while I make some fixes to the project :)

vans163 commented 2 years ago

manually compile it and add the location of erl_nif to include path for cmake

For my ERTS-12.3

cd deps/alex/src/ale
mkdir build
cd build
export CXXFLAGS=-isystem\ /usr/local/lib/erlang/erts-12.3/include/
cmake -DUSE_SDL=ON ..
make
stocks29 commented 1 year ago

This worked for me with an asdf installed erlang on ubuntu:

export CXXFLAGS="-I$HOME/.asdf/installs/erlang/25.2/usr/include/"
mix do deps.clean alex, deps.get, deps.compile
stevensonmt commented 1 year ago

This worked for me with an asdf installed erlang on ubuntu:

export CXXFLAGS="-I$HOME/.asdf/installs/erlang/25.2/usr/include/"
mix do deps.clean alex, deps.get, deps.compile

This worked for me. Because I'm looking to just use mix the solution for editing a makefile does not appeal. Anyone know why exporting CMAKE_INCLUDE_PATH or C_INCLUDE_PATH does not work?