0

Is it possible to call NIF functions from an Erlang program using Erlide if so is there any tutorial,article to help me run my first example

Hynek -Pichi- Vychodil
  • 26,174
  • 5
  • 52
  • 73
Bou6
  • 84
  • 2
  • 10

1 Answers1

0

I'm not sure what you mean. An Erlang program running under erlide is no different than any Erlang program, so calling NIFs works as usual.

If you mean that you have a C project where you develop a NIF and you want to test it, then there is no direct support. I would believe that what might be missing is configuration so that the NIF .so is found, but I haven't been writing NIFs so I'm not sure.

If you mean something else, please give a little more details. What did you try and what didn't work?

Vlad Dumitrescu
  • 931
  • 5
  • 11
  • Thanks Vlad,In fact i want develop an API (with c language) to monitor a microcontroller and then functions in this API will be called using Erlang is that possible, second question does erlide supports rebar project, – Bou6 Apr 30 '15 at 16:11
  • Rebar support: yes and no. There is some undocumented and not enough tested support in the current release. I am currently working on a big update that will also include better rebar support, which I hope to be able to release "soonish"(tm). – Vlad Dumitrescu May 01 '15 at 17:34
  • The rebar support will still be for Erlang code, and C code might or might not work. – Vlad Dumitrescu May 01 '15 at 17:35
  • could you please show an example, a tutorial on how to use NIFs and rebar in erlide – Bou6 May 01 '15 at 21:01
  • With the big warning that _this is provisional, **will be different** when released and might not work as intended_, you can go to your project's directory, open .settings/org.erlide.model.prefs and edit the settings by replacing INTERNAL with REBAR (in two places). Keep the rest intact. To restore, edit back to to INTERNAL. – Vlad Dumitrescu May 03 '15 at 14:05