Including NIF in escript

126 views
Skip to first unread message

Mike Chmielewski

unread,
Feb 24, 2015, 7:09:31 PM2/24/15
to elixir-l...@googlegroups.com
Hi all,

I've added the sfmt (randomizing) library to my dice rolling app. This library is an erlang one that they've packaged on hex. I also have a CLI interface built via escript.build. However, when I _run_ the resulting escript, I get an error because the escript can't find sfmt.

I haven't found any docs about solving this, does anyone know how to make my CLI app see the sfmt library?

Thanks!

José Valim

unread,
Feb 25, 2015, 3:26:49 AM2/25/15
to elixir-l...@googlegroups.com
I don't think escripts actually work with NIFs. You may want to ask it in the erlang-questions mailing list. Just to be sure, does the library compile the .so files to priv?



José Valim
Skype: jv.ptec
Founder and Lead Developer

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/43e19253-afd5-466d-a005-bb562510774b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Chmielewski

unread,
Feb 26, 2015, 8:57:28 PM2/26/15
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
Sorry for the delayed response. Yes, the nif .so is in the priv/ directory... I copied it to a priv/ subdirectory in the root of my project where my escript was built, and the escript worked. I just needed to read the error more closely.
Reply all
Reply to author
Forward
0 new messages