alex icon indicating copy to clipboard operation
alex copied to clipboard

erl_nif.h compile issue

Open zdenal opened this issue 4 years ago • 6 comments

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? 🙏

zdenal avatar May 17 '21 15:05 zdenal

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

brew install erlang-dev

Might resolve the issue

seanmor5 avatar May 17 '21 15:05 seanmor5

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

zdenal avatar May 17 '21 16:05 zdenal

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 :)

seanmor5 avatar May 17 '21 23:05 seanmor5

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

vans163 avatar Mar 26 '22 04:03 vans163

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

stocks29 avatar Jan 10 '23 04:01 stocks29

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?

stevensonmt avatar Jun 26 '23 01:06 stevensonmt