Building libzmq with libsodium

4.4k Views Asked by At

Edit as of ZMQ version 4.1: Configure automatically looks for libsodium, so this is no longer required. If for some reason you wish to build it WITHOUT libsodium and you have it built and installed, configure libzmq with '--without-libsodium'.


So I'm having problems building/making zeromq with libsodium.

im using msys2 as the shell - specifically the mingw32_shell - , and zmq 4.1.0 rc1 with libsodium 1.0.1 and mingw-w64 32bit (gcc 4.9.2).

im currently able to compile libsodium like this

cd .../libsodium
bash configure
make
make check
make install

and everything is fine, all the tests pass and the libs and includes end up in the /usr/local/ folders that msys2 seems to know about.

then when i try to build zeromq with these commands

cd .../zeromq
bash configure --with-libsodium
make
make check
make install

i never get past the configure stage, as configure returns

checking for sodium_init in -lsodium... no
configure: error: libsodium is not installed.  Install it or don't pass --with-libsodium to configure script

i have tried the methods suggested in this post - ZeroMQ doesn't spot libsodium - but to no success.

therefore my question is thus: how do i either set the locations for zeromq's configure to look for libsodium to spot, whether with --with-libsodium, --with-libsodium-include-dir= and --with-libsodium-lib-dir=, or have them 'installed' in a location that msys2's shell is able to find?

1

There are 1 best solutions below

4
On BEST ANSWER

I assume you tried it already since the link you provided mentions it:

--with-libsodium=/usr/local

I tried this and it worked for me. However, I don't recommend this because for MSYS2, it is cleaner if /usr/local is used only for MSYS2 software, and not MinGW-w64 software. For MinGW-w64 i686 software, the 'right' prefix for 'local' is /mingw32/local

I've just now added libsodium as a dependency on the zeromq package.

Github MinGW-w64 zeromq PKGBUILD commit e32ae0

I will ask Alexey to rebuild and repackage it tomorrow.