Skip to content
Draft
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
19 changes: 4 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.14)

project(villas-node
VERSION 1.0.1
DESCRIPTION "VILLASnode"
DESCRIPTION "Open-Source Real-time Multi-protocol Gateway"
HOMEPAGE_URL "https://www.fein-aachen.org/projects/villas-node/"
LANGUAGES C CXX
)
Expand Down Expand Up @@ -48,7 +48,6 @@ include(FindPkgConfig)
include(CheckIncludeFile)
include(FeatureSummary)
include(GNUInstallDirs)
include(GetVersion)
include(FindSymbol)
include(CMakeDependentOption)

Expand Down Expand Up @@ -77,6 +76,7 @@ find_package(LibDataChannel)
find_package(re)
find_package(OpenDSSC)
find_package(FileSystem)
find_package(Criterion)

# Check for tools
find_program(PROTOBUFC_COMPILER NAMES protoc-c)
Expand Down Expand Up @@ -237,9 +237,6 @@ if(WITH_GHC_FS)
include_directories($<TARGET_PROPERTY:ghcFilesystem::ghc_filesystem,INTERFACE_INCLUDE_DIRECTORIES>)
endif()

# Get version info and buildid from Git
GetVersion(${PROJECT_SOURCE_DIR} "CMAKE_PROJECT")

if(WITH_FPGA)
add_subdirectory(fpga)
endif()
Expand Down Expand Up @@ -324,19 +321,11 @@ add_feature_info(NODE_ZEROMQ WITH_NODE_ZEROMQ "Build with

if(TOPLEVEL_PROJECT)
feature_summary(WHAT ALL VAR FEATURES)
message(STATUS "Building ${CMAKE_PROJECT_DESCRIPTION}:")
message(STATUS "Building ${PROJECT_NAME}:")
message(STATUS "${FEATURES}")

if(FOUND_GIT_VERSION)
message(STATUS " VERSION: ${CMAKE_PROJECT_VERSION}")
message(STATUS " RELEASE: ${CMAKE_PROJECT_RELEASE}")
message(STATUS " GIT_REV: ${CMAKE_PROJECT_GIT_REV}")
message(STATUS " GIT_BRANCH: ${CMAKE_PROJECT_GIT_BRANCH}")
message(STATUS " VARIANT: ${CMAKE_PROJECT_VARIANT}")
message(STATUS " BUILD_ID: ${CMAKE_PROJECT_BUILD_ID}")
message(STATUS " BUILD_DATE: ${CMAKE_PROJECT_BUILD_DATE}")
endif()

message(STATUS " VERSION: ${CMAKE_PROJECT_VERSION}")
message(STATUS " ARCH: ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS " OS: ${CMAKE_SYSTEM_NAME}")
endif()
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ For attribution, please refer to the SPDX headers in each file.
The [Apache 2.0 license](./LICENSE) covers most of the codebase and is preferred for new contributions.
License compliance is automatically checked in CI, including validation of licenses in the `LICENSES/` directory.

We kindly ask all academic publications employing components of VILLASframework to cite one of the following papers:
We kindly ask all academic publications employing components of VILLASframework to cite one of the following paper:

- A. Monti et al., "[A Global Real-Time Superlab: Enabling High Penetration of Power Electronics in the Electric Grid](https://ieeexplore.ieee.org/document/8458285/)," in IEEE Power Electronics Magazine, vol. 5, no. 3, pp. 35-44, Sept. 2018.
- S. Vogel, M. Mirz, L. Razik and A. Monti, "[An open solution for next-generation real-time power system simulation](http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8245739&isnumber=8244404)," 2017 IEEE Conference on Energy Internet and Energy System Integration (EI2), Beijing, 2017, pp. 1-6.
- S. Vogel, N. Eiling, M. Pitz, A. Bach, M. Stevic, and P. A. Monti, “VILLASnode: An Open-Source Real-time Multi-protocol Gateway,” Journal of Open Source Software, vol. 10, no. 112, p. 8401, Aug. 2025, doi: [10.21105/joss.08401](https://doi.org/10.21105/joss.08401).

For other licensing options please consult [Prof. Antonello Monti](mailto:[email protected]).

Expand Down
105 changes: 0 additions & 105 deletions cmake/GetVersion.cmake

This file was deleted.

8 changes: 1 addition & 7 deletions cmake/VILLASnodePackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ list(REMOVE_ITEM CPACK_COMPONENTS_ALL "Unspecified")

set(CPACK_BUILD_SOURCE_DIRS ${PROJECT_SOURCE_DIR}/src;${PROJECT_SOURCE_DIR}/lib;${PROJECT_SOURCE_DIR}/include)

set(CPACK_PACKAGE_NAME "villas-node")
set(CPACK_PACKAGE_VENDOR ${PROJECT_AUTHOR})
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})
set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_PROJECT_PATCH_VERSION})

set(CPACK_RPM_PACKAGE_RELEASE ${CMAKE_PROJECT_RELEASE})
set(CPACK_RPM_PACKAGE_RELEASE ${CMAKE_PROJECT_VERSION_TWEAK})
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")

set(CPACK_RPM_COMPONENT_INSTALL ON)
Expand Down
1 change: 0 additions & 1 deletion common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ find_package(OpenSSL 1.0.0 REQUIRED)
find_package(CURL 7.29 REQUIRED)
find_package(spdlog 1.6.0 REQUIRED)
find_package(fmt 6.0.0 REQUIRED)
find_package(Criterion)

pkg_check_modules(JANSSON IMPORTED_TARGET REQUIRED jansson>=2.7)
pkg_check_modules(LIBCONFIG IMPORTED_TARGET libconfig>=1.4.9)
Expand Down
17 changes: 2 additions & 15 deletions common/include/villas/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,11 @@

// clang-format off

#define PROJECT_VERSION_STR "@CMAKE_PROJECT_VERSION_STR@"
#define PROJECT_VERSION "@CMAKE_PROJECT_VERSION@"
#define PROJECT_MAJOR_VERSION @CMAKE_PROJECT_MAJOR_VERSION@
#define PROJECT_MINOR_VERSION @CMAKE_PROJECT_MINOR_VERSION@
#define PROJECT_PATCH_VERSION @CMAKE_PROJECT_PATCH_VERSION@
#define PROJECT_RELEASE "@CMAKE_PROJECT_RELEASE@"
#define PROJECT_GIT_REV "@CMAKE_PROJECT_GIT_REV@"
#define PROJECT_GIT_BRANCH "@CMAKE_PROJECT_GIT_BRANCH@"
#define PROJECT_GIT_BRANCH_NORM "@CMAKE_PROJECT_GIT_BRANCH_NORM@"
#define PROJECT_VARIANT "@CMAKE_PROJECT_VARIANT@"
#define PROJECT_VARIANT_NORM "@CMAKE_PROJECT_VARIANT_NORM@"
#define PROJECT_BUILD_ID "@CMAKE_PROJECT_BUILD_ID@"
#define PROJECT_BUILD_DATE "@CMAKE_PROJECT_BUILD_DATE@"

#define PROJECT_NAME "@CMAKE_PROJECT_NAME@"
#define PROJECT_HOMEPAGE_URL "@CMAKE_PROJECT_HOMEPAGE_URL@"
#define PROJECT_NAME "@CMAKE_PROJECT_DESCRIPTION@"

#define HTTP_USER_AGENT PROJECT_NAME " (" PROJECT_BUILD_ID ")"
#define HTTP_USER_AGENT PROJECT_NAME " (" PROJECT_VERSION ")"

// Hard-coded cache line size
#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \
Expand Down
6 changes: 3 additions & 3 deletions common/lib/tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ void Tool::staticHandler(int signal, siginfo_t *sinfo, void *ctx) {

void Tool::printCopyright() {
// cppcheck-suppress unknownMacro
std::cout << PROJECT_NAME " " << CLR_BLU(PROJECT_BUILD_ID)
std::cout << PROJECT_NAME " " << CLR_BLU(PROJECT_VERSION)
<< " (built on " CLR_MAG(__DATE__) " " CLR_MAG(__TIME__) ")"
<< std::endl
<< " Copyright 2014-2025 The VILLASframework Authors" << std::endl
<< " Steffen Vogel <[email protected]>" << std::endl;
}

// cppcheck-suppress unknownMacro
void Tool::printVersion() { std::cout << PROJECT_BUILD_ID << std::endl; }
void Tool::printVersion() { std::cout << PROJECT_VERSION << std::endl; }

Tool::Tool(int ac, char *av[], const std::string &nme,
const std::list<int> &sigs)
Expand All @@ -41,7 +41,7 @@ int Tool::run() {
int ret;

logger->info("This is VILLASnode {} (built on {}, {})",
CLR_BLD(CLR_YEL(PROJECT_BUILD_ID)), CLR_BLD(CLR_MAG(__DATE__)),
CLR_BLD(CLR_YEL(PROJECT_VERSION)), CLR_BLD(CLR_MAG(__DATE__)),
CLR_BLD(CLR_MAG(__TIME__)));

ret = utils::signalsInit(staticHandler, handlerSignals);
Expand Down
29 changes: 0 additions & 29 deletions fpga/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@
# SPDX-FileCopyrightText: 2018 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0

include(FindPkgConfig)

set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/share/pkgconfig:/usr/lib64/pkgconfig")

pkg_check_modules(JANSSON REQUIRED IMPORTED_TARGET jansson)

find_package(Threads)
find_package(Criterion)

include_directories(thirdparty/CLI11)
include_directories(thirdparty/rang)

Expand All @@ -23,23 +14,3 @@ add_subdirectory(src)
if(CRITERION_FOUND)
add_subdirectory(tests/unit)
endif()

# Project settings
set(PROJECT_NAME "VILLASfpga")
set(PROJECT_DESCRIPTION "Host library for configuring and communicating with VILLASfpga")
set(PROJECT_VENDOR "Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_URL "https://www.fein-aachen.org/projects/villas-fpga/")
set(PROJECT_VERSION_MAJOR "0")
set(PROJECT_VERSION_MINOR "1")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_RELEASE "1")

# pkg-config
configure_file("libvillas-fpga.pc.in" "libvillas-fpga.pc" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libvillas-fpga.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig")

# As close as possible to Fedoras naming
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_RPM_PACKAGE_RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")

set(CPACK_GENERATOR "RPM")
include(CPack)
13 changes: 0 additions & 13 deletions fpga/libvillas-fpga.pc.in

This file was deleted.

79 changes: 54 additions & 25 deletions lib/api/requests/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,60 @@ class StatusRequest : public Request {
json_error_t err;
json_t *json_status = json_pack_ex(
&err, 0,
"{ s: s, s: s, s: s, s: s, s: s, s: s, s: s, s: f, s: f, s: { s: s, s: "
"I, s: b }, s: { s: s, s: s, s: s, s: s, s: s, s: s}, s: { s: i, s: i, "
"s: I, s: I, s: [ f, f, f ], s: { s: I, s, I, s: I, s: I }, s: { s: I, "
"s: I }, s: { s: I, s: I } } }",
"state", stateToString(sn->getState()).c_str(), "version",
PROJECT_VERSION_STR, "release", PROJECT_RELEASE, "build_id",
PROJECT_BUILD_ID, "build_date", PROJECT_BUILD_DATE, "hostname", hname,
"uuid", uuid::toString(sn->getUuid()).c_str(), "time_now",
time_to_double(&now), "time_started", time_to_double(&started),
"timezone", "name", tzname[daylight], "offset", (json_int_t)timezone,
"dst", daylight, "kernel", "sysname", uts.sysname, "nodename",
uts.nodename, "release", uts.release, "version", uts.version, "machine",
uts.machine, "domainname", uts.domainname, "system", "cores_configured",
get_nprocs_conf(), "cores", get_nprocs(), "processes",
(json_int_t)sinfo.procs, "uptime", (json_int_t)sinfo.uptime, "load",
f_load * sinfo.loads[0], f_load * sinfo.loads[1],
f_load * sinfo.loads[2], "ram", "total",
(json_int_t)(sinfo.totalram * sinfo.mem_unit), "free",
(json_int_t)(sinfo.freeram * sinfo.mem_unit), "shared",
(json_int_t)(sinfo.sharedram * sinfo.mem_unit), "buffer",
(json_int_t)(sinfo.bufferram * sinfo.mem_unit), "swap", "total",
(json_int_t)(sinfo.totalswap * sinfo.mem_unit), "free",
(json_int_t)(sinfo.freeswap * sinfo.mem_unit), "highmem", "total",
(json_int_t)(sinfo.totalhigh * sinfo.mem_unit), "free",
(json_int_t)(sinfo.freehigh * sinfo.mem_unit));
"{"
"s: s, s: s, s: s, s: s, s: f, s: f,"
/* timezone */ "s: { s: s, s: I, s: b },"
/* kernel */ "s: { s: s, s: s, s: s, s: s, s: s, s: s},"
/* system */ "s: { s: i, s: i, s: I, s: I,"
/* system load */ "s: [ f, f, f ],"
/* system ram */ "s: { s: I, s, I, s: I, s: I },"
/* system swap */ "s: { s: I, s: I },"
/* system highmem */ "s: { s: I, s: I }}}", //

"state", stateToString(sn->getState()).c_str(), //
"version", PROJECT_VERSION, //
"hostname", hname, //
"uuid", uuid::toString(sn->getUuid()).c_str(), //
"time_now", time_to_double(&now), //
"time_started", time_to_double(&started), //

"timezone", //
"name", tzname[daylight], //
"offset", (json_int_t)timezone, //
"dst", daylight, //

"kernel", //
"sysname", uts.sysname, //
"nodename", uts.nodename, //
"release", uts.release, //
"version", uts.version, //
"machine", uts.machine, //
"domainname", uts.domainname, //

"system", //
"cores_configured", get_nprocs_conf(), //
"cores", get_nprocs(), //
"processes", (json_int_t)sinfo.procs, //
"uptime", (json_int_t)sinfo.uptime, //

/* system */ "load", //
f_load * sinfo.loads[0], //
f_load * sinfo.loads[1], //
f_load * sinfo.loads[2], //

/* system */ "ram", //
"total", (json_int_t)(sinfo.totalram * sinfo.mem_unit), //
"free", (json_int_t)(sinfo.freeram * sinfo.mem_unit), //
"shared", (json_int_t)(sinfo.sharedram * sinfo.mem_unit), //
"buffer", (json_int_t)(sinfo.bufferram * sinfo.mem_unit), //

/* system */ "swap", //
"total", (json_int_t)(sinfo.totalswap * sinfo.mem_unit), //
"free", (json_int_t)(sinfo.freeswap * sinfo.mem_unit), //

/* system */ "highmem", //
"total", (json_int_t)(sinfo.totalhigh * sinfo.mem_unit), //
"free", (json_int_t)(sinfo.freehigh * sinfo.mem_unit));
if (!json_status)
throw Error(HTTP_STATUS_INTERNAL_SERVER_ERROR,
"Failed to prepare response: {}", err.text);
Expand Down
Loading