3

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?

Community
  • 1
  • 1
CommanderBubble
  • 333
  • 2
  • 9

1 Answers1

1

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.

Ray Donnelly
  • 3,920
  • 1
  • 19
  • 20
  • I thought i had tried that specific switch, but i've just tried it agian and it's passed the `checking for sodium_init in -lsodium... yes` stage. I guess i must have typed something wrong when i tried it before... – CommanderBubble Dec 11 '14 at 09:27
  • also, not to try to take this off topic, but when using the mingw32_shell 'version' of msys2 and calling `make install` the libs etc all end up in /usr/local instead of /mingw32/local. is this an oversight on my behalf with needing to specify something when calling make install? – CommanderBubble Dec 11 '14 at 09:31
  • Not really, by default, autotools projects use a prefix of /usr/local. We didn't make any changes to that as they'd be ugly and intrusive. For this, you should pass --prefix=/mingw32/local to configure. – Ray Donnelly Dec 11 '14 at 10:24
  • The new zeromq packages (plural since both i686 and x86_64) have been uploaded in-case you want to use the official MSYS2 packages. – Ray Donnelly Dec 11 '14 at 10:29