cppzmq icon indicating copy to clipboard operation
cppzmq copied to clipboard

CMake error! message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")

Open dapeng17951 opened this issue 4 years ago • 4 comments

message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")

dapeng17951 avatar May 19 '20 11:05 dapeng17951

Thanks for your report.

Note that for using cppzmq, you don't have to build it at all, it is a header only library. You need a libzmq library (static or shared) for your platform, and link it into your application/library, as described with libzmq itself. Then, you only need to #include "zmq.hpp" (and maybe #include "zmq_addon.hpp") to use cppzmq.

If you want to develop cppzmq itself and run its tests, please provide details on your environment, in particular the OS, how/where you installed libzmq, and how you ran cmake.

sigiesec avatar May 20 '20 08:05 sigiesec

@sigiesec So what exactly is cmake for in this project? I tried building it (with similar error) and then just included it and voila, it works. What do I miss by not building it?

Miosss avatar May 20 '20 19:05 Miosss

Thanks for your report.

Note that for using cppzmq, you don't have to build it at all, it is a header only library. You need a libzmq library (static or shared) for your platform, and link it into your application/library, as described with libzmq itself. Then, you only need to #include "zmq.hpp" (and maybe #include "zmq_addon.hpp") to use cppzmq.

If you want to develop cppzmq itself and run its tests, please provide details on your environment, in particular the OS, how/where you installed libzmq, and how you ran cmake.

Could you explain then why this is in the README? I am having also build failures with gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 and libzmq 4.2.5-1ubuntu0.2

f3rm4rf3r avatar Jun 08 '20 16:06 f3rm4rf3r

I have been trying to get past this one as well. While configuring xeus-sqlite I get the following error:

-- Building xeus-sqlite v0.. -- Found nlohmann_json: /opt/local/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.7.3", minimum required is "3.2.0") -- Found PkgConfig: /opt/local/bin/pkg-config (found version "0.29.2") -- Checking for module 'libzmq' -- Found libzmq, version 4.3.2 CMake Error at /opt/local/share/cmake/cppzmq/cppzmqConfig.cmake:53 (message): ZeroMQ was NOT found! Call Stack (most recent call first): /opt/local/share/cmake-3.17/Modules/CMakeFindDependencyMacro.cmake:47 (find_package) /opt/local/lib/cmake/xeus/xeusConfig.cmake:64 (find_dependency) CMakeLists.txt:62 (find_package)

-- Configuring incomplete, errors occurred!

Unfortunately, xeus and zeus-sqilte need the cppzmqConfig.cmake file, but my platform macOS/MacPorts currently provides the autotools version of zmq. I've found no way to work around it. Changing to the cmake version of zmq changes both the current and compatibility version of the zmq library (to a smaller number in both cases), which means rebuilding all dependent ports.

Schamschula avatar Jun 18 '20 18:06 Schamschula