You are not logged in.

#1 2018-05-30 23:11:14

joaocandre
Member
Registered: 2013-02-23
Posts: 146

Can't compile ZeroMQ

I've been trying to recompile ZeroMQ (https://github.com/zeromq/libzmq, the 'zeromq' package in the Community) with the '-fPIC' flag in order to pack it within some shared libraries I'm writing, but I'm encoutering errors:

When compiling with './configure CFLAGS=-fPIC' and 'make':

In member function ‘int zmq::msg_t::set_group(const char*, size_t)’,
    inlined from ‘int zmq::msg_t::set_group(const char*)’ at src/msg.cpp:549:22:
src/msg.cpp:560:13: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
     strncpy (u.base.group, group_, length_);
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/msg.cpp: In member function ‘int zmq::msg_t::set_group(const char*)’:
src/msg.cpp:549:22: note: length computed here
     return set_group (group_, strlen (group_));
            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:3695: src/src_libzmq_la-msg.lo] Error 1
make[1]: Leaving directory '/home/user/Downloads/zeromq-4.2.3'
make: *** [Makefile:4316: all-recursive] Error 1

And when calling CMake:

(....)
-- Checking whether getrandom is supported
-- Performing Test ZMQ_HAVE_GETRANDOM
-- Performing Test ZMQ_HAVE_GETRANDOM - Success
-- Found PythonInterp: /usr/bin/python (found version "3.6.5") 
-- Could NOT find AsciiDoc (missing: ASCIIDOC_EXECUTABLE) 
CMake Warning (dev) at tests/CMakeLists.txt:216 (message):
  Test 'test_security_gssapi' is not known to CTest.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error: File /home/user/Downloads/zeromq-4.2.3/ZeroMQConfig.cmake.in does not exist.
CMake Error at /usr/share/cmake-3.11/Modules/CMakePackageConfigHelpers.cmake:314 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:992 (configure_package_config_file)


-- Configuring incomplete, errors occurred!

Am I doing something wrong, or is the issue on the makefiles/source code?

Offline

#2 2018-06-03 18:56:28

ms
Member
From: Bandung, Indonesia
Registered: 2010-07-28
Posts: 80
Website

Re: Can't compile ZeroMQ

If you were cloning the source from their git repository, their installation manual said that you must run "./autogen.sh",

If you clone the Git repository then you should start by running the
command `./autogen.sh`. This is not necessary if you get the source
packages. [1]

[1] https://github.com/zeromq/libzmq/blob/master/INSTALL

Offline

Board footer

Powered by FluxBB