jlouis / enacl

Erlang bindings for NaCl / libsodium
MIT License
197 stars 59 forks source link

Makefile for NIFs on Apple M1 processor is incorrect #68

Closed hailelagi closed 1 year ago

hailelagi commented 1 year ago

the Makefile options for compiling enacl fail for the arm-64 darwin architectures. See upstream in rebar where the -arch x86 flag is no longer specified (https://github.com/erlang/rebar3/issues/2655). The very hacky way I got around this to build was after doing:

brew install libsodium

Latest stable at this point in time being 1.0.18_1, then altering the rebar.config to:

{"darwin", "CFLAGS", "$CFLAGS -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes -I /opt/homebrew/Cellar/libsodium/1.0.18_1/include"},
{"darwin", "CXXFLAGS", "$CXXFLAGS -O3 -finline-functions -Wall"},
{"darwin", "LDFLAGS", "$LDFLAGS -flat_namespace -undefined suppress -L /opt/homebrew/lib -lsodium"},
hailelagi commented 1 year ago

ack nvm, duplicate of #53 and solution also specificed in #60