jlouis / enacl

Erlang bindings for NaCl / libsodium
MIT License
197 stars 59 forks source link

rebar3 compile fails on ubuntu #41

Closed davidmann4 closed 5 years ago

davidmann4 commented 5 years ago

image

===> Verifying dependencies...
===> Compiling enacl
make: Entering directory '/home/dmann/workspace/enacl/c_src'
cc -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes -fPIC -I /home/dmann/.asdf/installs/erlang/21.0.5/erts-10.0.5/include/ -I /home/dmann/.asdf/installs/erlang/21.0.5/lib/erl_interface-3.10.3/include  -c -o /home/dmann/workspace/enacl/c_src/enacl_nif.o /home/dmann/workspace/enacl/c_src/enacl_nif.c
/home/dmann/workspace/enacl/c_src/enacl_nif.c: In function 'enif_crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX':
/home/dmann/workspace/enacl/c_src/enacl_nif.c:1364:31: error: 'crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX' undeclared (first use in this function)
   return enif_make_int64(env, crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX);
                               ^
/home/dmann/workspace/enacl/c_src/enacl_nif.c:1364:31: note: each undeclared identifier is reported only once for each function it appears in
/home/dmann/workspace/enacl/c_src/enacl_nif.c:1365:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Makefile:63: recipe for target '/home/dmann/workspace/enacl/c_src/enacl_nif.o' failed
make: *** [/home/dmann/workspace/enacl/c_src/enacl_nif.o] Error 1
make: Leaving directory '/home/dmann/workspace/enacl/c_src'
===> Hook for compile failed!

I have the sodium lib installed on my ubuntu machine using

sudo apt-get install libsodium-dev -y

using

elixir         1.7.2   (set by /home/dmann/.tool-versions)
erlang         21.0.5  (set by /home/dmann/.tool-versions)
nodejs         9.8.0   (set by /home/dmann/.tool-versions)
davidmann4 commented 5 years ago

libsodium-dev version is 1.0.13-1

davidmann4 commented 5 years ago

For everyone finding this via google:

I solved this by

wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.16.tar.gz
tar -zxvf libsodium-1.0.16.tar.gz
cd libsodium-1.0.16/
./configure
make && make check
sudo make install
mv -v /usr/local/include/* /usr/include/
BenoitDuffez commented 3 years ago

perhaps --prefix=/usr is cleaner than the mv