Skip to content

Commit

Permalink
Fix/develop ci (#28)
Browse files Browse the repository at this point in the history
* fix ci build issue

* update deprecated zmq functions
  • Loading branch information
nathanhhughes committed Dec 12, 2024
1 parent 471e28b commit 0a8b29b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/spark_dsg/serialization/json_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct adl_serializer<Eigen::Matrix<Scalar, Rows, Cols>> {
throw std::runtime_error(ss.str());
}

mat = Eigen::Matrix<Scalar, Rows, Cols>(rows, cols);
mat = Eigen::Matrix<Scalar, Rows, Cols>::Zero(rows, cols);
for (size_t i = 0; i < vec->size(); ++i) {
int r = i / cols;
int c = i % cols;
Expand Down
1 change: 1 addition & 0 deletions include/spark_dsg/serialization/versioning.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <cstdint>
#include <vector>

namespace spark_dsg::io {
Expand Down
13 changes: 13 additions & 0 deletions src/zmq_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,30 @@ struct ZmqReceiver::Detail {
Detail(const std::string& url, size_t, bool conflate) {
socket.reset(new zmq::socket_t(ZmqContextHolder::instance().context(), ZMQ_SUB));
socket->connect(url);
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(4, 7, 0)
socket->setsockopt(ZMQ_SUBSCRIBE, "", 0);
#else
socket->set(zmq::sockopt::subscribe, "", 0);
#endif

if (conflate) {
int conflate_flag = 1;
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(4, 7, 0)
socket->setsockopt(ZMQ_CONFLATE, &conflate_flag, sizeof(conflate_flag));
#else
socket->set(zmq::sockopt::conflate, &conflate_flag, sizeof(conflate_flag));
#endif
}
}

~Detail() = default;

bool recv(size_t timeout_ms) {
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(4, 7, 1)
if (!socket->connected()) {
#else
if (!socket) {
#endif
return false;
}

Expand Down

0 comments on commit 0a8b29b

Please sign in to comment.