NIF module dependency is not being fetched while calling mix deps.get

hey folks,

I tried to fetch a small library which has a NIF module that calls a C code, but seems it cannot be fetched, so I’m getting:

{:error, {:load_failed, ‘Failed to load NIF library: ‘./ cannot open shared object file: No such file or directory’’}}

It has the makefile, and all is working fine on the library directory
I tried to force fetch it directly from git like

{:ex_interval, git: “ ”, branch: “master”}
I can see all source code is fetched and compiled generating the *.so file on the deps directory, but on the _build directory it only shows the beam files

1 Like

This library uses relative path for fetching the *.so while it should store it in priv and load it from there using :code.priv_dir(app_name).


How is the proper way to store the *.so file on the priv directory?

If the native dependency has a build script (like a Makefile) you could add a step to just copy the resulting .so file(s) to priv/.

1 Like