Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 51 additions & 49 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ find_package(re)
find_package(OpenDSSC)
find_package(FileSystem)
find_package(Criterion)
find_package(OpalOrchestra)
find_package(LibXml2)

# Check for tools
find_program(PROTOBUFC_COMPILER NAMES protoc-c)
Expand Down Expand Up @@ -161,55 +163,55 @@ else()
endif()

# Build options
cmake_dependent_option(WITHOUT_GPL "Build VILLASnode without any GPL code" OFF "" ON)
cmake_dependent_option(WITH_GHC_FS "Build using ghc::filesystem, a drop in replacement for std::filesystem" ON "STDCXX_FS_NOT_FOUND" OFF)
cmake_dependent_option(WITH_DEFAULTS "Defaults for non required build options" ON "" OFF)

cmake_dependent_option(WITH_API "Build with remote control API" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_CLIENTS "Build client applications" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_CONFIG "Build with support for libconfig configuration syntax" "${WITH_DEFAULTS}" "LIBCONFIG_FOUND" OFF)
cmake_dependent_option(WITH_FPGA "Build with support for VILLASfpga" "${WITH_DEFAULTS}" "FOUND_FPGA_SUBMODULES" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Build with Graphviz" "${WITH_DEFAULTS}" "CGRAPH_FOUND; GVC_FOUND" OFF)
cmake_dependent_option(WITH_HOOKS "Build with support for processing hook plugins" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_LUA "Build with Lua" "${WITH_DEFAULTS}" "LUA_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Build with support for OpenMP for parallel hooks" "${WITH_DEFAULTS}" "OPENMP_FOUND" OFF)
cmake_dependent_option(WITH_PLUGINS "Build plugins" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_SRC "Build executables" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_TESTS "Run tests" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_TOOLS "Build auxilary tools" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_WEB "Build with internal webserver" "${WITH_DEFAULTS}" "LIBWEBSOCKETS_FOUND" OFF)

cmake_dependent_option(WITH_NODE_AMQP "Build with amqp node-type" "${WITH_DEFAULTS}" "RABBITMQ_C_FOUND" OFF)
cmake_dependent_option(WITH_NODE_CAN "Build with can node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_COMEDI "Build with comedi node-type" "${WITH_DEFAULTS}" "COMEDILIB_FOUND" OFF)
cmake_dependent_option(WITH_NODE_ETHERCAT "Build with ethercat node-type" "${WITH_DEFAULTS}" "ETHERLAB_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_EXAMPLE "Build with example node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_EXEC "Build with exec node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_FILE "Build with file node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_FPGA "Build with fpga node-type" "${WITH_DEFAULTS}" "WITH_FPGA" OFF)
cmake_dependent_option(WITH_NODE_IEC61850 "Build with iec61850 node-types" "${WITH_DEFAULTS}" "LIBIEC61850_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_IEC60870 "Build with iec60870 node-types" "${WITH_DEFAULTS}" "LIB60870_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_INFINIBAND "Build with infiniband node-type" "${WITH_DEFAULTS}" "IBVerbs_FOUND; RDMACM_FOUND" OFF) # Infiniband node-type is currenly broken
cmake_dependent_option(WITH_NODE_INFLUXDB "Build with influxdb node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_KAFKA "Build with kafka node-type" "${WITH_DEFAULTS}" "RDKAFKA_FOUND" OFF)
cmake_dependent_option(WITH_NODE_LOOPBACK "Build with loopback node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_MODBUS "Build with modbus node-type" "${WITH_DEFAULTS}" "MODBUS_FOUND" OFF)
cmake_dependent_option(WITH_NODE_MQTT "Build with mqtt node-type" "${WITH_DEFAULTS}" "MOSQUITTO_FOUND" OFF)
cmake_dependent_option(WITH_NODE_NANOMSG "Build with nanomsg node-type" "${WITH_DEFAULTS}" "NANOMSG_FOUND" OFF)
cmake_dependent_option(WITH_NODE_NGSI "Build with ngsi node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_REDIS "Build with redis node-type" "${WITH_DEFAULTS}" "HIREDIS_FOUND; REDISPP_FOUND" OFF)
cmake_dependent_option(WITH_NODE_RTP "Build with rtp node-type" "${WITH_DEFAULTS}" "re_FOUND" OFF)
cmake_dependent_option(WITH_NODE_SHMEM "Build with shmem node-type" "${WITH_DEFAULTS}" "HAS_SEMAPHORE; HAS_MMAN" OFF)
cmake_dependent_option(WITH_NODE_SIGNAL "Build with signal node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_SOCKET "Build with socket node-type" "${WITH_DEFAULTS}" "LIBNL3_ROUTE_FOUND" OFF)
cmake_dependent_option(WITH_NODE_STATS "Build with stats node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_TEMPER "Build with temper node-type" "${WITH_DEFAULTS}" "LIBUSB_FOUND" OFF)
cmake_dependent_option(WITH_NODE_TEST_RTT "Build with test_rtt node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_ULDAQ "Build with uldaq node-type" "${WITH_DEFAULTS}" "LIBULDAQ_FOUND" OFF)
cmake_dependent_option(WITH_NODE_WEBRTC "Build with webrtc node-type" "${WITH_DEFAULTS}" "WITH_WEB; LibDataChannel_FOUND" OFF)
cmake_dependent_option(WITH_NODE_WEBSOCKET "Build with websocket node-type" "${WITH_DEFAULTS}" "WITH_WEB" OFF)
cmake_dependent_option(WITH_NODE_ZEROMQ "Build with zeromq node-type" "${WITH_DEFAULTS}" "LIBZMQ_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_OPENDSS "Build with opendss node-type" "${WITH_DEFAULTS}" "OpenDSSC_FOUND" OFF)
cmake_dependent_option(WITHOUT_GPL "Build VILLASnode without any GPL code" OFF "" ON)
cmake_dependent_option(WITH_GHC_FS "Build using ghc::filesystem, a drop in replacement for std::filesystem" ON "STDCXX_FS_NOT_FOUND" OFF)
cmake_dependent_option(WITH_DEFAULTS "Defaults for non required build options" ON "" OFF)
cmake_dependent_option(WITH_API "Build with remote control API" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_CLIENTS "Build client applications" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_CONFIG "Build with support for libconfig configuration syntax" "${WITH_DEFAULTS}" "LIBCONFIG_FOUND" OFF)
cmake_dependent_option(WITH_FPGA "Build with support for VILLASfpga" "${WITH_DEFAULTS}" "FOUND_FPGA_SUBMODULES" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Build with Graphviz" "${WITH_DEFAULTS}" "CGRAPH_FOUND; GVC_FOUND" OFF)
cmake_dependent_option(WITH_HOOKS "Build with support for processing hook plugins" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_LUA "Build with Lua" "${WITH_DEFAULTS}" "LUA_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Build with support for OpenMP for parallel hooks" "${WITH_DEFAULTS}" "OPENMP_FOUND" OFF)
cmake_dependent_option(WITH_PLUGINS "Build plugins" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_SRC "Build executables" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_TESTS "Run tests" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_TOOLS "Build auxilary tools" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_WEB "Build with internal webserver" "${WITH_DEFAULTS}" "LIBWEBSOCKETS_FOUND" OFF)

cmake_dependent_option(WITH_NODE_AMQP "Build with amqp node-type" "${WITH_DEFAULTS}" "RABBITMQ_C_FOUND" OFF)
cmake_dependent_option(WITH_NODE_CAN "Build with can node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_COMEDI "Build with comedi node-type" "${WITH_DEFAULTS}" "COMEDILIB_FOUND" OFF)
cmake_dependent_option(WITH_NODE_ETHERCAT "Build with ethercat node-type" "${WITH_DEFAULTS}" "ETHERLAB_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_EXAMPLE "Build with example node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_EXEC "Build with exec node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_FILE "Build with file node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_FPGA "Build with fpga node-type" "${WITH_DEFAULTS}" "WITH_FPGA" OFF)
cmake_dependent_option(WITH_NODE_IEC61850 "Build with iec61850 node-types" "${WITH_DEFAULTS}" "LIBIEC61850_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_IEC60870 "Build with iec60870 node-types" "${WITH_DEFAULTS}" "LIB60870_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_INFINIBAND "Build with infiniband node-type" "${WITH_DEFAULTS}" "IBVerbs_FOUND; RDMACM_FOUND" OFF) # Infiniband node-type is currenly broken
cmake_dependent_option(WITH_NODE_INFLUXDB "Build with influxdb node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_KAFKA "Build with kafka node-type" "${WITH_DEFAULTS}" "RDKAFKA_FOUND" OFF)
cmake_dependent_option(WITH_NODE_LOOPBACK "Build with loopback node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_MODBUS "Build with modbus node-type" "${WITH_DEFAULTS}" "MODBUS_FOUND" OFF)
cmake_dependent_option(WITH_NODE_MQTT "Build with mqtt node-type" "${WITH_DEFAULTS}" "MOSQUITTO_FOUND" OFF)
cmake_dependent_option(WITH_NODE_NANOMSG "Build with nanomsg node-type" "${WITH_DEFAULTS}" "NANOMSG_FOUND" OFF)
cmake_dependent_option(WITH_NODE_NGSI "Build with ngsi node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_OPAL_ORCHESTRA "Build with the opal-orchestra node-type" "${WITH_DEFAULTS}" "OpalOrchestra_FOUND; LibXml2_FOUND" OFF)
cmake_dependent_option(WITH_NODE_REDIS "Build with redis node-type" "${WITH_DEFAULTS}" "HIREDIS_FOUND; REDISPP_FOUND" OFF)
cmake_dependent_option(WITH_NODE_RTP "Build with rtp node-type" "${WITH_DEFAULTS}" "re_FOUND" OFF)
cmake_dependent_option(WITH_NODE_SHMEM "Build with shmem node-type" "${WITH_DEFAULTS}" "HAS_SEMAPHORE; HAS_MMAN" OFF)
cmake_dependent_option(WITH_NODE_SIGNAL "Build with signal node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_SOCKET "Build with socket node-type" "${WITH_DEFAULTS}" "LIBNL3_ROUTE_FOUND" OFF)
cmake_dependent_option(WITH_NODE_STATS "Build with stats node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_TEMPER "Build with temper node-type" "${WITH_DEFAULTS}" "LIBUSB_FOUND" OFF)
cmake_dependent_option(WITH_NODE_TEST_RTT "Build with test_rtt node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_ULDAQ "Build with uldaq node-type" "${WITH_DEFAULTS}" "LIBULDAQ_FOUND" OFF)
cmake_dependent_option(WITH_NODE_WEBRTC "Build with webrtc node-type" "${WITH_DEFAULTS}" "WITH_WEB; LibDataChannel_FOUND" OFF)
cmake_dependent_option(WITH_NODE_WEBSOCKET "Build with websocket node-type" "${WITH_DEFAULTS}" "WITH_WEB" OFF)
cmake_dependent_option(WITH_NODE_ZEROMQ "Build with zeromq node-type" "${WITH_DEFAULTS}" "LIBZMQ_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_OPENDSS "Build with opendss node-type" "${WITH_DEFAULTS}" "OpenDSSC_FOUND" OFF)

# Set a default for the build type
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
Expand Down
29 changes: 29 additions & 0 deletions cmake/FindOpalOrchestra.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# CMakeLists.txt.
#
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2025, OPAL-RT Germany GmbH
# SPDX-License-Identifier: Apache-2.0

find_path(OPAL_ORCHESTRA_INCLUDE_DIR
NAMES RTAPI.h
PATHS
/usr/opalrt/common/bin
)

find_library(OPAL_ORCHESTRA_LIBRARY
NAMES OpalOrchestra
PATHS
/usr/opalrt/common/include
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpalOrchestra DEFAULT_MSG OPAL_ORCHESTRA_LIBRARY OPAL_ORCHESTRA_INCLUDE_DIR)

mark_as_advanced(OPAL_ORCHESTRA_INCLUDE_DIR OPAL_ORCHESTRA_LIBRARY)

set(OPAL_ORCHESTRA_LIBRARIES ${OPAL_ORCHESTRA_LIBRARY})
set(OPAL_ORCHESTRA_INCLUDE_DIRS ${OPAL_ORCHESTRA_INCLUDE_DIR})

add_library(OpalOrchestra INTERFACE)
target_link_libraries(OpalOrchestra INTERFACE ${OPAL_ORCHESTRA_LIBRARY})
target_include_directories(OpalOrchestra INTERFACE ${OPAL_ORCHESTRA_INCLUDE_DIR})
6 changes: 3 additions & 3 deletions common/include/villas/graph/directed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include <algorithm>
#include <fstream>
#include <list>
#include <map>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
#include <unordered_map>

#include <villas/graph/edge.hpp>
#include <villas/graph/vertex.hpp>
Expand Down Expand Up @@ -245,8 +245,8 @@ class DirectedGraph {
VertexIdentifier lastVertexId;
EdgeIdentifier lastEdgeId;

std::map<VertexIdentifier, std::shared_ptr<VertexType>> vertices;
std::map<EdgeIdentifier, std::shared_ptr<EdgeType>> edges;
std::unordered_map<VertexIdentifier, std::shared_ptr<VertexType>> vertices;
std::unordered_map<EdgeIdentifier, std::shared_ptr<EdgeType>> edges;

Logger logger;
};
Expand Down
3 changes: 2 additions & 1 deletion common/include/villas/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ class HostDmaRam {
static HostDmaRamAllocator &getAllocator(int num = 0);

private:
static std::map<int, std::unique_ptr<HostDmaRamAllocator>> allocators;
static std::unordered_map<int, std::unique_ptr<HostDmaRamAllocator>>
allocators;

static std::string getUdmaBufName(int num);

Expand Down
4 changes: 2 additions & 2 deletions common/include/villas/memory_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#pragma once

#include <cstdint>
#include <map>
#include <stdexcept>
#include <string>
#include <unordered_map>

#include <fmt/ostream.h>
#include <unistd.h>
Expand Down Expand Up @@ -214,7 +214,7 @@ class MemoryManager {
MemoryGraph memoryGraph;

// Cache mapping of names to address space ids for fast lookup
std::map<std::string, AddressSpaceId> addrSpaceLookup;
std::unordered_map<std::string, AddressSpaceId> addrSpaceLookup;

// Logger for universal access in this class
Logger logger;
Expand Down
4 changes: 2 additions & 2 deletions common/include/villas/popen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#pragma once

#include <istream>
#include <map>
#include <memory>
#include <ostream>
#include <string>
#include <unordered_map>
#include <vector>

#include <ext/stdio_filebuf.h>
Expand All @@ -24,7 +24,7 @@ class Popen {

public:
using arg_list = std::vector<std::string>;
using env_map = std::map<std::string, std::string>;
using env_map = std::unordered_map<std::string, std::string>;

using char_type = char;
using stdio_buf = __gnu_cxx::stdio_filebuf<char_type>;
Expand Down
4 changes: 2 additions & 2 deletions common/lib/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <algorithm>
#include <list>
#include <map>
#include <unordered_map>

#include <fnmatch.h>
#include <spdlog/sinks/basic_file_sink.h>
Expand All @@ -19,7 +19,7 @@

using namespace villas;

static std::map<spdlog::level::level_enum, std::string> levelNames = {
static std::unordered_map<spdlog::level::level_enum, std::string> levelNames = {
{spdlog::level::trace, "trc"}, {spdlog::level::debug, "dbg"},
{spdlog::level::info, "info"}, {spdlog::level::warn, "warn"},
{spdlog::level::err, "err"}, {spdlog::level::critical, "crit"},
Expand Down
2 changes: 1 addition & 1 deletion common/lib/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ HostRam::HostRamAllocator::HostRamAllocator()
};
}

std::map<int, std::unique_ptr<HostDmaRam::HostDmaRamAllocator>>
std::unordered_map<int, std::unique_ptr<HostDmaRam::HostDmaRamAllocator>>
HostDmaRam::allocators;

HostDmaRam::HostDmaRamAllocator::HostDmaRamAllocator(int num)
Expand Down
1 change: 1 addition & 0 deletions doc/openapi/components/schemas/config/node_obj.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ discriminator:
nanomsg: nodes/_nanomsg.yaml
ngsi: nodes/_ngsi.yaml
opendss: nodes/_opendss.yaml
opal.orchestra: nodes/_opal_orchestra.yaml
redis: nodes/_redis.yaml
rtp: nodes/_rtp.yaml
shmem: nodes/_shmem.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
# SPDX-FileCopyrightText: 2025 OPAL-RT Germany GmbH
# SPDX-License-Identifier: Apache-2.0
---
allOf:
- $ref: ../node_obj.yaml
- $ref: opal_orchestra.yaml
Loading