Issues with ComeOnIn (BCrypt - more specifically bcrypt_nif.so)

324 views
Skip to first unread message

William Dunne

unread,
Mar 23, 2015, 9:51:17 PM3/23/15
to elixir-l...@googlegroups.com
To start with, running Ubuntu 14.10 latest Erlang, Elixir, and ComeOnIn. x64 intel system, yadayada

I have been trying to use ComeOnIn in a different package for password hashing but unfortunately I am unable to get it compile. The error I get is bellow:

comeonin/priv/bcrypt_nif.so: cannot open shared object file: No such file

To take it a step further, I went into the c dependencies folder and attempted to compile the bcrypt_nif.c file myself however I then had the issue of a bcrypt_nif.h file being missing.

I have tried a few different things, like using the IRCCloud fork of bcrypt-erl, but still no avail.

Anyone have any idea as to what is causing this, or more importantly how I can fix it?

Josh Adams

unread,
Mar 24, 2015, 12:06:45 AM3/24/15
to elixir-l...@googlegroups.com
comeonin/priv/bcrypt_nif.so: cannot open shared object file: No such file
 
So this basically just means "hey, a thing that the compilation of comeonin should have created wasn't there!"

To take it a step further, I went into the c dependencies folder and attempted to compile the bcrypt_nif.c file myself however I then had the issue of a bcrypt_nif.h file being missing.

At the top level of comeonin is a Makefile (https://github.com/elixircnx/comeonin/blob/master/Makefile).  It describes how to build that nif.  Can you cd into the dependency's directory, type `make priv/bcrypt_nif.so`, and post the results here?

William Dunne

unread,
Mar 24, 2015, 9:44:55 AM3/24/15
to elixir-l...@googlegroups.com
Thanks Josh, this was the result:

make priv
/bcrypt_nif.socc -g -O3 -Wall -I/usr/lib/erlang/erts-6.3/include -Ic_src -fPIC -shared  -o priv/bcrypt_nif.so c_src/bcrypt_nif.c c_src/bcrypt.c c_src/blowfish.c
c_src
/bcrypt_nif.c:22:21: fatal error: erl_nif.h: No such file or directory
 
#include "erl_nif.h"
                     
^
compilation terminated
.
Makefile:23: recipe for target 'priv/bcrypt_nif.so' failed
make
: *** [priv/bcrypt_nif.so] Error 1

Josh Adams

unread,
Mar 24, 2015, 3:13:10 PM3/24/15
to elixir-l...@googlegroups.com
On Tue, Mar 24, 2015 at 8:44 AM, William Dunne <wil...@mimex.net> wrote:
Thanks Josh, this was the result:

make priv
/bcrypt_nif.socc -g -O3 -Wall -I/usr/lib/erlang/erts-6.3/include -Ic_src -fPIC -shared  -o priv/bcrypt_nif.so c_src/bcrypt_nif.c c_src/bcrypt.c c_src/blowfish.c
c_src
/bcrypt_nif.c:22:21: fatal error: erl_nif.h: No such file or directory
 
#include "erl_nif.h"
                     
^
compilation terminated
.
Makefile:23: recipe for target 'priv/bcrypt_nif.so' failed
make
: *** [priv/bcrypt_nif.so] Error 1

Now we're getting somewhere.  OK, so your problem was that the `make` statement failed to find the erl_nif.h file at /usr/lib/erlang/erts-6.3/include

I haven't a clue why exactly you're missing the erl_nif header file, but if it were in that location this would compile successfully.  You can see how the ComeOnIn Makefile derives this location - perhaps you have an incomplete erlang install?  There's some reason it thinks it's installed in /usr/lib/erlang.

William Dunne

unread,
Mar 24, 2015, 3:29:10 PM3/24/15
to elixir-l...@googlegroups.com
Interesting, I installed it via the standard apt-get method. Any clue how to fix this?

Josh Adams

unread,
Mar 24, 2015, 3:34:51 PM3/24/15
to elixir-l...@googlegroups.com
Yeah, `apt-get install erlang-dev`


--
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/25f8aadd-c6c1-4777-bdcf-efdeb323e61c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Josh Adams

William Dunne

unread,
Mar 24, 2015, 3:54:35 PM3/24/15
to elixir-l...@googlegroups.com
Sorted :D

David Whitlock

unread,
Mar 26, 2015, 10:39:23 PM3/26/15
to elixir-l...@googlegroups.com
Hi, I'm the maintainer of Comeonin. I'm glad to see you got the problem sorted.
For future reference, it might be advisable to download Erlang from the erlang-solutions site as the version of Erlang from the Ubuntu repositories is quite old (17.1). This might be relevant in a month or two, as we're hoping to implement some changes which depend on version 17.3.
Reply all
Reply to author
Forward
0 new messages