Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated ZeroMQ on system trumps bundled version(?) #327

Closed
HenrikBengtsson opened this issue Mar 7, 2024 · 3 comments
Closed

Outdated ZeroMQ on system trumps bundled version(?) #327

HenrikBengtsson opened this issue Mar 7, 2024 · 3 comments
Labels

Comments

@HenrikBengtsson
Copy link

It seems like the fallback to the bundled ZeroMQ, as in

SystemRequirements: ZeroMQ (libzmq) >= 4.3.0 (optional; otherwise bundled)

doesn't detect outdated ZeroMQ versions on the system. On CentOS 7, which still comes with ZeroMQ 3.2.5, the configuration picks up that outdated version;

* system has libzmq -> linking system library

This results in compilation errors (see below).

Details

I get:

> install.packages("clustermq")
Installing package into '/home/alice/R/x86_64-pc-linux-gnu-library/4.3'
(as 'lib' is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/clustermq_0.9.4.tar.gz'
Content type 'application/x-gzip' length 1571546 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

* installing *source* packageclustermq...
** packageclustermqsuccessfully unpacked and MD5 sums checked
** using staged installation
* system has libzmq -> linking system library
* libzmq without DRAFT API found -> disabling crash monitor feature
** libs
using C++ compiler:g++ (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)’
g++ -std=gnu++17 -I"/path/to/R-4.3.3/lib64/R/include" -DNDEBUG -fPIC -Icppzmq -I'/home/alice/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c CMQMaster.cpp -o CMQMaster.o
In file included from common.h:9,
                 from CMQMaster.h:2,
                 from CMQMaster.cpp:2:
cppzmq/zmq.hpp: In member functionvoid zmq::context_t::close()’:
cppzmq/zmq.hpp:873:18: error:zmq_ctx_termwas not declared in this scope; did you meanzmq_ctx_set’?
  873 |             rc = zmq_ctx_term(ptr);
      |                  ^~~~~~~~~~~~
      |                  zmq_ctx_set
cppzmq/zmq.hpp: In member functionvoid zmq::context_t::shutdown()’:
cppzmq/zmq.hpp:887:18: error:zmq_ctx_shutdownwas not declared in this scope; did you meanzmq_ctx_set’?
  887 |         int rc = zmq_ctx_shutdown(ptr);
      |                  ^~~~~~~~~~~~~~~~
      |                  zmq_ctx_set
make: *** [/path/to/R-4.3.3/lib64/R/etc/Makeconf:200: CMQMaster.o] Error 1
ERROR: compilation failed for packageclustermq* removing/home/alice/R/x86_64-pc-linux-gnu-library/4.3/clustermq* restoring previous/home/alice/R/x86_64-pc-linux-gnu-library/4.3/clustermqThe downloaded source packages are in
        '/tmp/alice/RtmpogYwlP/downloaded_packages'
Warning message:
In install.packages("clustermq") :
  installation of package 'clustermq' had non-zero exit status
$ yum info zeromq3-devel
Installed Packages
Name        : zeromq3-devel
Arch        : x86_64
Version     : 3.2.5
Release     : 1.el7
Size        : 93 k
Repo        : installed
From repo   : epel
Summary     : Development files for zeromq3
URL         : http://www.zeromq.org
License     : LGPLv3+ with exceptions
Description : The zeromq3-devel package contains libraries and header files for
            : developing applications that use zeromq3 3.x.
@mschubert mschubert added the bug label Mar 7, 2024
@mschubert
Copy link
Owner

mschubert commented Mar 7, 2024

This looks like a bug. Please use CLUSTERMQ_USE_SYSTEM_LIBZMQ=0 as a workaround:

Sys.setenv(CLUSTERMQ_USE_SYSTEM_LIBZMQ=0)
install.packages("clustermq")

The version should be checked here but the other compilation errors might trigger first:

clustermq/src/common.h

Lines 12 to 21 in 80984fc

#if ! ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 0) || \
! CPPZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 10, 0)
#define XSTR(x) STR(x)
#define STR(x) #x
#pragma message "libzmq version is: " XSTR(ZMQ_VERSION_MAJOR) "." \
XSTR(ZMQ_VERSION_MINOR) "." XSTR(ZMQ_VERSION_PATCH)
#pragma message "cppzmq version is: " XSTR(CPPZMQ_VERSION_MAJOR) "." \
XSTR(CPPZMQ_VERSION_MINOR) "." XSTR(CPPZMQ_VERSION_PATCH)
#error clustermq needs libzmq>=4.3.0 and cppzmq>=4.10.0
#endif

Proposed solution: add the version check to the test_libzmq.c check.

@mschubert
Copy link
Owner

@HenrikBengtsson I pushed a fix to master, would be great if you can check whether this works on your system now!

@HenrikBengtsson
Copy link
Author

Thanks. I'm confirming that:

Sys.setenv(CLUSTERMQ_USE_SYSTEM_LIBZMQ=0)
install.packages("clustermq")

works for clustermq 0.9.4 currently on CRAN.

I'm also confirming the patch in master work out of the box in a fresh R session;

> remotes::install_github("mschubert/clustermq")
...
Installing package into '/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.3-CBI-gcc10'
(as 'lib' is unspecified)
* installing *source* packageclustermq...
** using staged installation
* no system libzmq>=4.3.0 found -> using bundled libzmq
autoreconf: Entering directory `.'
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants