sym_num

sym_num

Where is erl_nif.h header file required for NIF?

HI
Please help me.

I am trying to write C code of NIF referring to the following article.

However, an error occurs because the header file cannot be found.
gcc nif.c
nif.c:1:10: fatal error: erl_nif.h: No such file or directory
#include “erl_nif.h”
^~~~~~~~~~~
compilation terminated.

Where is erl_nif.h header file required for NIF ?
Please tell me what to do.

My environment is Windows subsystem for LInux, Ubuntu 18.04.

Most Liked

NobbZ

NobbZ

Depending on how you installed erlang, you might need to install additional packages.

If you installed erlang and elixir through apt (but not from ESL repos), it might be that sudo apt install erlang-dev works.

If though you installed by any other means, then you will need to check how you install the erlang headers via that package/version manager.

sym_num

sym_num

I implement it on Linux. I have not checked on Windows. But the following code may be fine.

I referred to Matrex makefile code.

ERL_INCLUDE_PATH = $(shell erl -eval ‘io:format(“~s”, [lists:concat([code:root_dir(), “/erts-”, erlang:system_info(version), “/include”])])’ -s init stop -noshell)

nifs: ./lib/nifs.cu
@mkdir -p priv
nvcc -shared --compiler-options ‘-fPIC’ -lcublas -I$(ERL_INCLUDE_PATH) -o ./priv/nifs.so ./lib/nifs.cu

That code gives the PATH to the Nif header.

https://github.com/sasagawa888/deeppipe2

Where Next?

Popular in Questions Top

fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Other popular topics Top

msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => "XXX...
New

We're in Beta

About us Mission Statement