1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Merge pull request #666 from VILLASframework/fixes-steffen

Pending fixes from Steffen
This commit is contained in:
Steffen Vogel 2023-06-21 12:10:16 +02:00 committed by GitHub
commit 2bcd1d9a46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 126 additions and 160 deletions

View file

@ -135,6 +135,14 @@ if (REDISPP_FOUND)
set(REDISPP_WITH_TLS ON)
endif()
unset(CONTENTS)
# Redis++ had a breaking change between 1.3.6 and 1.3.7
# Detect this change by checking if the new header exists
#
# See https://github.com/sewenew/redis-plus-plus/commit/192ebae13583ff0611e2d7666a9c1e98a2a0dc86
if (EXISTS "${REDISPP_INCLUDEDIR}/sw/redis++/redis_uri.h")
set(REDISPP_WITH_URI ON)
endif()
endif()
# Check if libwebsockets is build with deflate extension

View file

@ -13,7 +13,7 @@ set(CPACK_BUILD_SOURCE_DIRS ${PROJECT_SOURCE_DIR}/src;${PROJECT_SOURCE_DIR}/lib;
set(CPACK_PACKAGE_NAME "villas-node")
set(CPACK_PACKAGE_VENDOR ${PROJECT_AUTHOR})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "This is VILLASnode, a gateway for processing and forwardning simulation data between real-time simulators.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Connecting real-time power grid simulation equipment")
set(CPACK_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_PROJECT_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_PROJECT_MINOR_VERSION})

View file

@ -58,3 +58,4 @@
/* Library features */
#cmakedefine LWS_DEFLATE_FOUND
#cmakedefine REDISPP_WITH_TLS
#cmakedefine REDISPP_WITH_URI

View file

@ -188,3 +188,20 @@ OStream &operator<<(OStream &os, const enum villas::node::RedisMode &m)
return os;
}
namespace villas {
namespace node {
#ifdef REDISPP_WITH_URI
sw::redis::ConnectionOptions make_redis_connection_options(char const *uri)
{
auto u = sw::redis::Uri { uri };
return u.connection_options();
}
#else
sw::redis::ConnectionOptions make_redis_connection_options(char const *uri)
{
return sw::redis::ConnectionOptions { uri };
}
#endif
} // node
} // villas

View file

@ -22,24 +22,6 @@ namespace api {
class StatusRequest : public Request {
protected:
#ifdef LWS_WITH_SERVER_STATUS
json_t * getLwsStatus()
{
int ret;
struct lws_context *ctx = lws_get_context(session->wsi);
char buf[4096];
ret = lws_json_dump_context(ctx, buf, sizeof(buf), 0);
if (ret <= 0)
throw Error(HTTP_STATUS_INTERNAL_SERVER_ERROR, "Failed to dump LWS context");
return json_loads(buf, 0, nullptr);
}
#endif /* LWS_WITH_SERVER_STATUS */
public:
using Request::Request;
@ -129,10 +111,6 @@ public:
if (!json_status)
throw Error(HTTP_STATUS_INTERNAL_SERVER_ERROR, "Failed to prepare response: {}", err.text);
#ifdef LWS_WITH_SERVER_STATUS
json_object_set(json_status, "lws", getLwsStatus());
#endif /* LWS_WITH_SERVER_STATUS */
return new JsonResponse(session, HTTP_STATUS_OK, json_status);
}
};

View file

@ -313,7 +313,6 @@ std::string MappingEntry::toString(unsigned index) const
return ss.str();
}
Signal::Ptr MappingEntry::toSignal(unsigned index) const
{
auto name = toString(index);

View file

@ -119,7 +119,7 @@ endif()
# Enable Kafka support
if(WITH_NODE_KAFKA)
list(APPEND NODE_SRC kafka.cpp)
list(APPEND LIBRARIES ${RDKAFKA_LIBRARIES})
list(APPEND LIBRARIES PkgConfig::RDKAFKA)
endif()
# Enable Comedi support

View file

@ -240,7 +240,7 @@ int FpgaNodeFactory::start(SuperNode *sn)
cards.splice(cards.end(), piceCards);
return 0;
return NodeFactory::start(sn);
}
static FpgaNodeFactory p;

View file

@ -22,8 +22,8 @@ using namespace std::literals::chrono_literals;
static CP56Time2a timespec_to_cp56time2a(timespec time) {
time_t time_ms =
static_cast<time_t> (time.tv_sec) * 1000
+ static_cast<time_t> (time.tv_nsec) / 1000000;
static_cast<time_t>(time.tv_sec) * 1000
+ static_cast<time_t>(time.tv_nsec) / 1000000;
return CP56Time2a_createFromMsTimestamp(NULL, time_ms);
}
@ -148,7 +148,7 @@ SignalType ASDUData::signalType() const
std::optional<ASDUData::Sample> ASDUData::checkASDU(CS101_ASDU const &asdu) const
{
if (CS101_ASDU_getTypeID(asdu) != static_cast<int> (descriptor->type))
if (CS101_ASDU_getTypeID(asdu) != static_cast<int>(descriptor->type))
return std::nullopt;
for (int i = 0; i < CS101_ASDU_getNumberOfElements(asdu); i++) {
@ -163,41 +163,41 @@ std::optional<ASDUData::Sample> ASDUData::checkASDU(CS101_ASDU const &asdu) cons
QualityDescriptor quality;
switch (typeWithoutTimestamp()) {
case ASDUData::SCALED_INT: {
auto scaled_int = reinterpret_cast<MeasuredValueScaled> (io);
auto scaled_int = reinterpret_cast<MeasuredValueScaled>(io);
int scaled_int_value = MeasuredValueScaled_getValue(scaled_int);
signal_data.i = static_cast<int64_t> (scaled_int_value);
signal_data.i = static_cast<int64_t>(scaled_int_value);
quality = MeasuredValueScaled_getQuality(scaled_int);
break;
}
case ASDUData::NORMALIZED_FLOAT: {
auto normalized_float = reinterpret_cast<MeasuredValueNormalized> (io);
auto normalized_float = reinterpret_cast<MeasuredValueNormalized>(io);
float normalized_float_value = MeasuredValueNormalized_getValue(normalized_float);
signal_data.f = static_cast<double> (normalized_float_value);
signal_data.f = static_cast<double>(normalized_float_value);
quality = MeasuredValueNormalized_getQuality(normalized_float);
break;
}
case ASDUData::DOUBLE_POINT: {
auto double_point = reinterpret_cast<DoublePointInformation> (io);
auto double_point = reinterpret_cast<DoublePointInformation>(io);
DoublePointValue double_point_value = DoublePointInformation_getValue(double_point);
signal_data.i = static_cast<int64_t> (double_point_value);
signal_data.i = static_cast<int64_t>(double_point_value);
quality = DoublePointInformation_getQuality(double_point);
break;
}
case ASDUData::SINGLE_POINT: {
auto single_point = reinterpret_cast<SinglePointInformation> (io);
auto single_point = reinterpret_cast<SinglePointInformation>(io);
bool single_point_value = SinglePointInformation_getValue(single_point);
signal_data.b = static_cast<bool> (single_point_value);
signal_data.b = static_cast<bool>(single_point_value);
quality = SinglePointInformation_getQuality(single_point);
break;
}
case ASDUData::SHORT_FLOAT: {
auto short_float = reinterpret_cast<MeasuredValueShort> (io);
auto short_float = reinterpret_cast<MeasuredValueShort>(io);
float short_float_value = MeasuredValueShort_getValue(short_float);
signal_data.f = static_cast<double> (short_float_value);
signal_data.f = static_cast<double>(short_float_value);
quality = MeasuredValueShort_getQuality(short_float);
break;
}
@ -209,31 +209,31 @@ std::optional<ASDUData::Sample> ASDUData::checkASDU(CS101_ASDU const &asdu) cons
std::optional<CP56Time2a> time_cp56;
switch (type()) {
case ASDUData::SCALED_INT_WITH_TIMESTAMP: {
auto scaled_int = reinterpret_cast<MeasuredValueScaledWithCP56Time2a> (io);
auto scaled_int = reinterpret_cast<MeasuredValueScaledWithCP56Time2a>(io);
time_cp56 = MeasuredValueScaledWithCP56Time2a_getTimestamp(scaled_int);
break;
}
case ASDUData::NORMALIZED_FLOAT_WITH_TIMESTAMP: {
auto normalized_float = reinterpret_cast<MeasuredValueNormalizedWithCP56Time2a> (io);
auto normalized_float = reinterpret_cast<MeasuredValueNormalizedWithCP56Time2a>(io);
time_cp56 = MeasuredValueNormalizedWithCP56Time2a_getTimestamp(normalized_float);
break;
}
case ASDUData::DOUBLE_POINT_WITH_TIMESTAMP: {
auto double_point = reinterpret_cast<DoublePointWithCP56Time2a> (io);
auto double_point = reinterpret_cast<DoublePointWithCP56Time2a>(io);
time_cp56 = DoublePointWithCP56Time2a_getTimestamp(double_point);
break;
}
case ASDUData::SINGLE_POINT_WITH_TIMESTAMP: {
auto single_point = reinterpret_cast<SinglePointWithCP56Time2a> (io);
auto single_point = reinterpret_cast<SinglePointWithCP56Time2a>(io);
time_cp56 = SinglePointWithCP56Time2a_getTimestamp(single_point);
break;
}
case ASDUData::SHORT_FLOAT_WITH_TIMESTAMP: {
auto short_float = reinterpret_cast<MeasuredValueShortWithCP56Time2a> (io);
auto short_float = reinterpret_cast<MeasuredValueShortWithCP56Time2a>(io);
time_cp56 = MeasuredValueShortWithCP56Time2a_getTimestamp(short_float);
break;
}
@ -260,75 +260,75 @@ bool ASDUData::addSampleToASDU(CS101_ASDU &asdu, ASDUData::Sample sample) const
? std::optional { timespec_to_cp56time2a(sample.timestamp.value()) }
: std::nullopt;
InformationObject io;
InformationObject io = nullptr;
switch (descriptor->type) {
case ASDUData::SCALED_INT: {
auto scaled_int_value = static_cast<int16_t> (sample.signal_data.i & 0xFFFF);
auto scaled_int_value = static_cast<int16_t>(sample.signal_data.i & 0xFFFF);
auto scaled_int = MeasuredValueScaled_create(NULL, ioa, scaled_int_value, sample.quality);
io = reinterpret_cast<InformationObject> (scaled_int);
io = reinterpret_cast<InformationObject>(scaled_int);
break;
}
case ASDUData::NORMALIZED_FLOAT: {
auto normalized_float_value = static_cast<float> (sample.signal_data.f);
auto normalized_float_value = static_cast<float>(sample.signal_data.f);
auto normalized_float = MeasuredValueNormalized_create(NULL, ioa, normalized_float_value, sample.quality);
io = reinterpret_cast<InformationObject> (normalized_float);
io = reinterpret_cast<InformationObject>(normalized_float);
break;
}
case ASDUData::DOUBLE_POINT: {
auto double_point_value = static_cast<DoublePointValue> (sample.signal_data.i & 0x3);
auto double_point_value = static_cast<DoublePointValue>(sample.signal_data.i & 0x3);
auto double_point = DoublePointInformation_create(NULL, ioa, double_point_value, sample.quality);
io = reinterpret_cast<InformationObject> (double_point);
io = reinterpret_cast<InformationObject>(double_point);
break;
}
case ASDUData::SINGLE_POINT: {
auto single_point_value = sample.signal_data.b;
auto single_point = SinglePointInformation_create(NULL, ioa, single_point_value, sample.quality);
io = reinterpret_cast<InformationObject> (single_point);
io = reinterpret_cast<InformationObject>(single_point);
break;
}
case ASDUData::SHORT_FLOAT: {
auto short_float_value = static_cast<float> (sample.signal_data.f);
auto short_float_value = static_cast<float>(sample.signal_data.f);
auto short_float = MeasuredValueShort_create(NULL, ioa, short_float_value, sample.quality);
io = reinterpret_cast<InformationObject> (short_float);
io = reinterpret_cast<InformationObject>(short_float);
break;
}
case ASDUData::SCALED_INT_WITH_TIMESTAMP: {
auto scaled_int_value = static_cast<int16_t> (sample.signal_data.i & 0xFFFF);
auto scaled_int_value = static_cast<int16_t>(sample.signal_data.i & 0xFFFF);
auto scaled_int = MeasuredValueScaledWithCP56Time2a_create(NULL, ioa, scaled_int_value, sample.quality, timestamp.value());
io = reinterpret_cast<InformationObject> (scaled_int);
io = reinterpret_cast<InformationObject>(scaled_int);
break;
}
case ASDUData::NORMALIZED_FLOAT_WITH_TIMESTAMP: {
auto normalized_float_value = static_cast<float> (sample.signal_data.f);
auto normalized_float_value = static_cast<float>(sample.signal_data.f);
auto normalized_float = MeasuredValueNormalizedWithCP56Time2a_create(NULL, ioa, normalized_float_value, sample.quality, timestamp.value());
io = reinterpret_cast<InformationObject> (normalized_float);
io = reinterpret_cast<InformationObject>(normalized_float);
break;
}
case ASDUData::DOUBLE_POINT_WITH_TIMESTAMP: {
auto double_point_value = static_cast<DoublePointValue> (sample.signal_data.i & 0x3);
auto double_point_value = static_cast<DoublePointValue>(sample.signal_data.i & 0x3);
auto double_point = DoublePointWithCP56Time2a_create(NULL, ioa, double_point_value, sample.quality, timestamp.value());
io = reinterpret_cast<InformationObject> (double_point);
io = reinterpret_cast<InformationObject>(double_point);
break;
}
case ASDUData::SINGLE_POINT_WITH_TIMESTAMP: {
auto single_point_value = sample.signal_data.b;
auto single_point = SinglePointWithCP56Time2a_create(NULL, ioa, single_point_value, sample.quality, timestamp.value());
io = reinterpret_cast<InformationObject> (single_point);
io = reinterpret_cast<InformationObject>(single_point);
break;
}
case ASDUData::SHORT_FLOAT_WITH_TIMESTAMP: {
auto short_float_value = static_cast<float> (sample.signal_data.f);
auto short_float_value = static_cast<float>(sample.signal_data.f);
auto short_float = MeasuredValueShortWithCP56Time2a_create(NULL, ioa, short_float_value, sample.quality, timestamp.value());
io = reinterpret_cast<InformationObject> (short_float);
io = reinterpret_cast<InformationObject>(short_float);
break;
}
@ -337,6 +337,7 @@ bool ASDUData::addSampleToASDU(CS101_ASDU &asdu, ASDUData::Sample sample) const
}
bool successfully_added = CS101_ASDU_addInformationObject(asdu, io);
InformationObject_destroy(io);
return successfully_added;
@ -383,27 +384,27 @@ void SlaveNode::createSlave() noexcept
// Setup callbacks into the class
CS104_Slave_setClockSyncHandler(server.slave, [] (void *tcp_node, IMasterConnection connection, CS101_ASDU asdu, CP56Time2a new_time) {
auto self = static_cast<SlaveNode const *> (tcp_node);
auto self = static_cast<SlaveNode const *>(tcp_node);
return self->onClockSync(connection, asdu, new_time);
}, this);
CS104_Slave_setInterrogationHandler(server.slave, [] (void *tcp_node, IMasterConnection connection, CS101_ASDU asdu, QualifierOfInterrogation qoi) {
auto self = static_cast<SlaveNode const *> (tcp_node);
auto self = static_cast<SlaveNode const *>(tcp_node);
return self->onInterrogation(connection, asdu, qoi);
}, this);
CS104_Slave_setASDUHandler(server.slave, [] (void *tcp_node, IMasterConnection connection, CS101_ASDU asdu) {
auto self = static_cast<SlaveNode const *> (tcp_node);
auto self = static_cast<SlaveNode const *>(tcp_node);
return self->onASDU(connection, asdu);
}, this);
CS104_Slave_setConnectionEventHandler(server.slave, [](void *tcp_node, IMasterConnection connection, CS104_PeerConnectionEvent event){
auto self = static_cast<SlaveNode const *> (tcp_node);
auto self = static_cast<SlaveNode const *>(tcp_node);
self->debugPrintConnection(connection, event);
}, this);
CS104_Slave_setRawMessageHandler(server.slave, [](void *tcp_node, IMasterConnection connection, uint8_t *message, int message_size, bool sent){
auto self = static_cast<SlaveNode const *> (tcp_node);
auto self = static_cast<SlaveNode const *>(tcp_node);
self->debugPrintMessage(connection, message, message_size, sent);
}, this);

View file

@ -184,9 +184,9 @@ public:
json_t *json_value = json_array();
for (unsigned k = 0; k < cnt; k++) {
const auto *sig = (Signal *) list_at_safe(smp->signals, index);
const auto *smp = &smps[k];
const auto *data = &smp->data[index];
auto sig = smp->signals->getByIndex(index);
json_array_append_new(json_value, json_pack("[ f, o, i ]",
time_to_double(smp->ts.origin),
@ -349,7 +349,7 @@ int ngsi_parse_entity(NodeCompat *n, json_t *json_entity, struct Sample * const
smp->ts.origin = tss;
auto *sd = &smp->data[attr->index];
auto *sig = (Signal *) list_at_safe(n->getInputSignals(false), attr->index);
auto sig = n->getInputSignals(false)->getByIndex(attr->index);
if (!sig)
return -11;

View file

@ -216,7 +216,7 @@ void redis_on_message(NodeCompat *n, const std::string &channel, const std::stri
n->logger->debug("Message: {}: {}", channel, msg);
int alloc, scanned, pushed;
int alloc, scanned, pushed = 0;
unsigned cnt = n->in.vectorize;
struct Sample *smps[cnt];
@ -247,7 +247,6 @@ void redis_on_message(NodeCompat *n, const std::string &channel, const std::stri
if (scanned < 0) {
n->logger->error("Failed to decode samples");
pushed = 0;
goto out;
}
@ -419,7 +418,7 @@ int villas::node::redis_parse(NodeCompat *n, json_t *json)
/* Connection options */
if (uri)
r->options = sw::redis::ConnectionOptions(uri);
r->options = make_redis_connection_options(uri);
if (db >= 0)
r->options.db = db;

View file

@ -87,7 +87,7 @@ void * Path::runPoll()
if (ret < 0)
throw SystemError("Failed to poll");
logger->debug("returned from poll(2): ret={}", ret);
logger->debug("Returned from poll(2): ret={}", ret);
for (unsigned i = 0; i < pfds.size(); i++) {
auto &pfd = pfds[i];

View file

@ -269,8 +269,10 @@ void SuperNode::startNodes()
void SuperNode::startPaths()
{
for (auto *p : paths) {
if (p->isEnabled())
p->start();
if (!p->isEnabled())
continue;
p->start();
}
}
@ -291,8 +293,10 @@ void SuperNode::prepareNodes()
void SuperNode::preparePaths()
{
for (auto *p : paths) {
if (p->isEnabled())
p->prepare(nodes);
if (!p->isEnabled())
continue;
p->prepare(nodes);
}
}

View file

@ -13,14 +13,14 @@ CMAKE_OPTS+=" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX}"
MAKE_THREADS=${MAKE_THREADS:-$(nproc)}
MAKE_OPTS+="--jobs=${MAKE_THREADS}"
git config --global http.postBuffer 524288000
git config --global core.compression 0
PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${PREFIX}/lib/pkgconfig:${PREFIX}/lib64/pkgconfig:${PREFIX}/share/pkgconfig
export PKG_CONFIG_PATH
DIR=$(mktemp -d)
pushd ${DIR}
TMPDIR=$(mktemp -d)
pushd ${TMPDIR}
# Build & Install Criterion
if ! pkg-config "criterion >= 2.3.1" && \
if ! pkg-config "criterion >= 2.4.1" && \
[ "${ARCH}" == "x86_64" ] && \
[ -z "${SKIP_CRITERION}" ]; then
git clone ${GIT_OPTS} --branch v2.3.3 --recursive https://github.com/Snaipe/Criterion
@ -50,17 +50,17 @@ if ! ( pkg-config "lua >= 5.1" || \
pkg-config "lua51" || \
[ -n "${RTLAB_ROOT}" -a -f "/usr/local/include/lua.h" ] \
) && [ -z "${SKIP_LUA}" ]; then
wget http://www.lua.org/ftp/lua-5.3.6.tar.gz -O - | tar -xz
pushd lua-5.3.6
wget http://www.lua.org/ftp/lua-5.4.4.tar.gz -O - | tar -xz
pushd lua-5.4.4
make ${MAKE_OPTS} MYCFLAGS=-fPIC linux
make ${MAKE_OPTS} MYCFLAGS=-fPIC install
make ${MAKE_OPTS} MYCFLAGS=-fPIC INSTALL_TOP=${PREFIX} install
popd
fi
# Build & Install mosquitto
if ! pkg-config "libmosquitto >= 1.4.15" && \
[ -z "${SKIP_LIBMOSQUITTO}" ]; then
git clone ${GIT_OPTS} --branch v2.0.12 https://github.com/eclipse/mosquitto
git clone ${GIT_OPTS} --branch v2.0.15 https://github.com/eclipse/mosquitto
mkdir -p mosquitto/build
pushd mosquitto/build
cmake -DWITH_BROKER=OFF \
@ -73,7 +73,7 @@ if ! pkg-config "libmosquitto >= 1.4.15" && \
fi
# Build & Install rabbitmq-c
if ! pkg-config "librabbitmq >= 0.8.0" && \
if ! pkg-config "librabbitmq >= 0.13.0" && \
[ -z "${SKIP_LIBRABBITMQ}" ]; then
git clone ${GIT_OPTS} --branch v0.11.0 https://github.com/alanxz/rabbitmq-c
mkdir -p rabbitmq-c/build
@ -98,7 +98,8 @@ if ! pkg-config "libzmq >= 2.2.0" && \
fi
# Build & Install EtherLab
if [ -z "${SKIP_ETHERLAB}" ]; then
if ! pkg-config "libethercat >= 1.5.2" && \
[ -z "${SKIP_ETHERLAB}" ]; then
git clone ${GIT_OPTS} --branch stable-1.5 https://gitlab.com/etherlab.org/ethercat.git
pushd ethercat
./bootstrap
@ -110,10 +111,12 @@ fi
# Build & Install libiec61850
if ! pkg-config "libiec61850 >= 1.5.0" && \
[ -z "${SKIP_LIBIEC61850}" ]; then
git clone ${GIT_OPTS} --branch v1.5 https://github.com/mz-automation/libiec61850
git clone ${GIT_OPTS} --branch v1.5.1 https://github.com/mz-automation/libiec61850
mkdir -p libiec61850/build
pushd libiec61850/build
cmake ${CMAKE_OPTS} ..
cmake -DBUILD_EXAMPLES=OFF \
-DBUILD_PYTHON_BINDINGS=OFF \
${CMAKE_OPTS} ..
make ${MAKE_OPTS} install
popd
fi
@ -121,10 +124,12 @@ fi
# Build & Install lib60870
if ! pkg-config "lib60870 >= 2.3.1" && \
[ -z "${SKIP_LIB60870}" ]; then
git clone ${GIT_OPTS} https://github.com/mz-automation/lib60870.git
git clone ${GIT_OPTS} --branch v2.3.2 https://github.com/mz-automation/lib60870.git
mkdir -p lib60870/build
pushd lib60870/build
cmake ${CMAKE_OPTS} ../lib60870-C
cmake -DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF \
${CMAKE_OPTS} ../lib60870-C
make ${MAKE_OPTS} install
popd
fi
@ -132,11 +137,12 @@ fi
# Build & Install librdkafka
if ! pkg-config "rdkafka >= 1.5.0" && \
[ -z "${SKIP_RDKAFKA}" ]; then
git clone ${GIT_OPTS} --branch v1.6.0 https://github.com/edenhill/librdkafka
git clone ${GIT_OPTS} --branch v2.0.1 https://github.com/edenhill/librdkafka
mkdir -p librdkafka/build
pushd librdkafka/build
cmake -DRDKAFKA_BUILD_TESTS=OFF \
-DRDKAFKA_BUILD_EXAMPLES=OFF \
-DWITH_CURL=OFF \
${CMAKE_OPTS} ..
make ${MAKE_OPTS} install
popd
@ -146,7 +152,7 @@ fi
if ! ( pkg-config "libcgraph >= 2.30" && \
pkg-config "libgvc >= 2.30" \
) && [ -z "${SKIP_GRAPHVIZ}" ]; then
git clone ${GIT_OPTS} --branch 2.49.0 https://gitlab.com/graphviz/graphviz.git
git clone ${GIT_OPTS} --branch 2.50.0 https://gitlab.com/graphviz/graphviz.git
mkdir -p graphviz/build
pushd graphviz/build
cmake ${CMAKE_OPTS} ..
@ -157,7 +163,7 @@ fi
# Build & Install uldaq
if ! pkg-config "libuldaq >= 1.2.0" && \
[ -z "${SKIP_ULDAQ}" ]; then
git clone ${GIT_OPTS} --branch v1.2.0 https://github.com/mccdaq/uldaq
git clone ${GIT_OPTS} --branch v1.2.1 https://github.com/mccdaq/uldaq
pushd uldaq
autoreconf -i
./configure \
@ -171,7 +177,7 @@ fi
if ! ( pkg-config "libnl-3.0 >= 3.2.25" && \
pkg-config "libnl-route-3.0 >= 3.2.25" \
) && [ -z "${SKIP_ULDAQ}" ]; then
git clone ${GIT_OPTS} --branch libnl3_5_0 https://github.com/thom311/libnl
git clone ${GIT_OPTS} --branch libnl3_7_0 https://github.com/thom311/libnl
pushd libnl
autoreconf -i
./configure \
@ -220,7 +226,7 @@ fi
# Build & Install nanomsg
if ! pkg-config "nanomsg >= 1.0.0" && \
[ -z "${SKIP_NANOMSG}" ]; then
git clone ${GIT_OPTS} --branch 1.1.5 https://github.com/nanomsg/nanomsg.git
git clone ${GIT_OPTS} --branch 1.2 https://github.com/nanomsg/nanomsg.git
mkdir -p nanomsg/build
pushd nanomsg/build
cmake -DNN_TESTS=OFF \
@ -236,7 +242,7 @@ fi
# Build & Install libxil
if ! pkg-config "libxil >= 1.0.0" && \
[ -z "${SKIP_LIBXIL}" ]; then
git clone ${GIT_OPTS} --branch v0.1.0 https://git.rwth-aachen.de/acs/public/villas/fpga/libxil.git
git clone ${GIT_OPTS} --branch master https://git.rwth-aachen.de/acs/public/villas/fpga/libxil.git
mkdir -p libxil/build
pushd libxil/build
cmake ${CMAKE_OPTS} ..
@ -246,8 +252,9 @@ fi
# Build & Install hiredis
if ! pkg-config "hiredis >= 1.0.0" && \
[ -z "${SKIP_HIREDIS}" -a -z "${SKIP_REDIS}" ]; then
git clone ${GIT_OPTS} --branch v1.0.0 https://github.com/redis/hiredis.git
[ -z "${SKIP_HIREDIS}" ] && \
[ -z "${SKIP_REDIS}" ]; then
git clone ${GIT_OPTS} --branch v1.1.0 https://github.com/redis/hiredis.git
mkdir -p hiredis/build
pushd hiredis/build
cmake -DDISABLE_TESTS=ON \
@ -258,13 +265,15 @@ if ! pkg-config "hiredis >= 1.0.0" && \
fi
# Build & Install redis++
if [ -z "${SKIP_REDISPP}" -a -z "${SKIP_REDIS}" ]; then
git clone ${GIT_OPTS} --branch 1.2.3 https://github.com/sewenew/redis-plus-plus.git
if ! pkg-config "redis++ >= 1.2.3" && \
[ -z "${SKIP_REDISPP}" ] && \
[ -z "${SKIP_REDIS}" ]; then
git clone ${GIT_OPTS} --branch 1.3.7 https://github.com/sewenew/redis-plus-plus.git
mkdir -p redis-plus-plus/build
pushd redis-plus-plus/build
# Somehow redis++ fails to find the hiredis include path on Debian multiarch builds
REDISPP_CMAKE_OPTS+="-DCMAKE_CXX_FLAGS=-I/usr/local/include"
REDISPP_CMAKE_OPTS+="-DCMAKE_CXX_FLAGS=-I${PREFIX}/include"
cmake -DREDIS_PLUS_PLUS_BUILD_TEST=OFF \
-DREDIS_PLUS_PLUS_BUILD_STATIC=OFF \
@ -337,7 +346,7 @@ if ! cmake --find-package -DNAME=LibDataChannel -DCOMPILER_ID=GNU -DLANGUAGE=CXX
fi
popd
rm -rf ${DIR}
rm -rf ${TMPDIR}
# Update linker cache
if [ -z "${SKIP_LDCONFIG}" ]; then

View file

@ -111,7 +111,7 @@ protected:
std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl;
}
std::cout << std::endl;
#endif /* WITH_HOOKS */
#endif // WITH_HOOKS
#ifdef WITH_API
std::cout << "Supported API commands:" << std::endl;
@ -120,7 +120,7 @@ protected:
std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl;
}
std::cout << std::endl;
#endif /* WITH_API */
#endif // WITH_API
printCopyright();
}
@ -204,9 +204,9 @@ protected:
}
};
} /* namespace tools */
} /* namespace node */
} /* namespace villas */
} // namespace tools
} // namespace node
} // namespace villas
int main(int argc, char *argv[])
{

View file

@ -5,16 +5,6 @@
# @license Apache 2.0
###################################################################################
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
add_executable(rmshm rmshm.cpp)
target_link_libraries(rmshm PUBLIC Threads::Threads rt)
add_executable(rmsem rmsem.cpp)
target_link_libraries(rmsem PUBLIC Threads::Threads rt)
list(APPEND TOOLS rmsem rmshm)
endif()
install(
TARGETS ${TOOLS}
COMPONENT tools

View file

@ -1,20 +0,0 @@
/** Delete semaphores.
*
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#include <semaphore.h>
#include <iostream>
int main(int argc, char *argv[])
{
for (int i = 1; i < argc; i++) {
int ret = sem_unlink(argv[i]);
if (ret)
std::cerr << "Failed to unlink: " << argv[i] << std::endl;
}
return 0;
}

View file

@ -1,20 +0,0 @@
/** Delete shared memory regions.
*
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#include <sys/mman.h>
#include <iostream>
int main(int argc, char *argv[])
{
for (int i = 1; i < argc; i++) {
int ret = shm_unlink(argv[i]);
if (ret)
std::cerr << "Failed to unlink: " << argv[i] << std::endl;
}
return 0;
}