zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.75k stars 2.36k forks source link

cmake build fails on FreeBSD #3212

Closed yurivict closed 6 years ago

yurivict commented 6 years ago
-- Performing Test ZMQ_HAVE_TCP_KEEPALIVE
-- Performing Test ZMQ_HAVE_TCP_KEEPALIVE - Failed
-- Checking whether TIPC is supported
-- Performing Test ZMQ_HAVE_TIPC
-- Performing Test ZMQ_HAVE_TIPC - Failed
-- Checking pthread_setname signature
-- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_1
-- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_1 - Failed
-- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_2
-- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_2 - Failed
-- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_3
-- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_3 - Failed
-- Performing Test ZMQ_HAVE_PTHREAD_SET_NAME
-- Performing Test ZMQ_HAVE_PTHREAD_SET_NAME - Failed
-- Checking pthread_setaffinity signature
-- Performing Test ZMQ_HAVE_PTHREAD_SETAFFINITY
-- Performing Test ZMQ_HAVE_PTHREAD_SETAFFINITY - Failed
-- Checking whether getrandom is supported
-- Performing Test ZMQ_HAVE_GETRANDOM
-- Performing Test ZMQ_HAVE_GETRANDOM - Failed
-- Found PythonInterp: /usr/local/bin/python3.6 (found version "3.6.5") 
-- Found AsciiDoc: /usr/local/bin/asciidoc  
CMake Error: File /usr/ports/net/libzmq4/work/zeromq-4.2.5/builds/cmake/clang-format-check.sh.in does not exist.
CMake Error at builds/cmake/Modules/ClangFormat.cmake:27 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1295 (include)
bluca commented 6 years ago

This has been solved in master already.

It's better to use autotools on *NIX, especially if you are a maintainer. If you want to use CMake anyway, you can download the archive of the git repository rather than the distributable tarball which will include the missing file: https://github.com/zeromq/libzmq/archive/v4.2.5.tar.gz

yurivict commented 6 years ago

Thanks.

I have a question: how to install builds/cmake/ZeroMQConfig.cmake.in using autotools?

bluca commented 6 years ago

Autotools doesn't touch that since it's a CMake-specific file - it's only included in the distributable tarball

yurivict commented 6 years ago

You said to use autotools instead of cmake, but autotools doesn't install .cmake files that other projects expect. I need to enable .cmake files in the FreeBSD port net/libzmq4. It needs to use the released version, and you said that only the latest, unreleased revision has the fix for cmake build.

bluca commented 6 years ago

Other projects can just use the pkgconfig file that every build ships. But as mentioned above you can use the linked archive of the git repo to build with CMake, as it includes everything, if you need to.

Also if you want to add shipping those CMake files to the automake scripts feel free to send a PR. At the moment it's not implemented.

yurivict commented 6 years ago

It also doesn't appear that cmake build has an equivalent for --with-norm. Nothing defines ZMQ_HAVE_NORM when cmake is used.


xeus project (https://github.com/QuantStack/xeus) specifically wants cmake files:

  Could not find a package configuration file provided by "ZeroMQ" (requested
  version 4.2.3) with any of the following names:

    ZeroMQConfig.cmake
    zeromq-config.cmake

  Add the installation prefix of "ZeroMQ" to CMAKE_PREFIX_PATH or set
  "ZeroMQ_DIR" to a directory containing one of the above files.  If "ZeroMQ"
  provides a separate development package or SDK, be sure it has been
  installed.
bluca commented 6 years ago

There is an existing request to implement enabling NORM on CMake, but nobody has provided a PR so far: https://github.com/zeromq/libzmq/issues/2207