From a6041398395b2ffb57e7d6b98aa80d06fb70bb1b Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 13 Apr 2026 12:19:28 +0200 Subject: [PATCH 01/15] feat (villas-chronics): Implementation of villas-chronics Signed-off-by: Ritesh.K --- CMakeLists.txt | 3 + src/CMakeLists.txt | 8 + src/villas-chronics.cpp | 409 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 420 insertions(+) create mode 100644 src/villas-chronics.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 69f9e307c..37b0259eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,6 +125,8 @@ pkg_check_modules(CGRAPH IMPORTED_TARGET libcgraph>=2.30) pkg_check_modules(GVC IMPORTED_TARGET libgvc>=2.30) pkg_check_modules(LIBUSB IMPORTED_TARGET libusb-1.0>=1.0.23) pkg_check_modules(NANOMSG IMPORTED_TARGET nanomsg) +pkg_check_modules(BZIP2 IMPORTED_TARGET bzip2) + if(NOT NANOMSG_FOUND) pkg_check_modules(NANOMSG IMPORTED_TARGET libnanomsg>=1.0.0) endif() @@ -191,6 +193,7 @@ cmake_dependent_option(WITH_SRC "Build executables" 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_VILLAS_CHRONICS "Build with villas-chronics" "${WITH_DEFAULTS}" "BZIP2_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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7fd670bb4..8ecd32e9e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,6 +11,7 @@ set(SRCS villas-signal villas-compare villas-test-config + villas-chronics ) add_executable(villas-node villas-node.cpp) @@ -74,6 +75,13 @@ if(WITH_NODE_OPAL) list(APPEND SRCS opal-async-param) endif() +if(WITH_VILLAS_CHRONICS) + add_executable(villas-chronics villas-chronics.cpp) + target_link_libraries(villas-chronics PUBLIC villas) + + list(APPEND SRCS villas-chronics) +endif() + install( TARGETS ${SRCS} COMPONENT bin diff --git a/src/villas-chronics.cpp b/src/villas-chronics.cpp new file mode 100644 index 000000000..fcc593742 --- /dev/null +++ b/src/villas-chronics.cpp @@ -0,0 +1,409 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +namespace villas { +namespace node { +namespace tools { + +static int extract_file_number(const std::filesystem::path &file) { + static const std::regex re("(\\d+)"); + std::smatch match; + + const std::string name = file.stem().string(); + if (!std::regex_search(name, match, re)) { + throw std::runtime_error("No numeric index in filename: " + file.string()); + } + return std::stoi(match.str(1)); +} + +static double round_dec(double value, unsigned decimals) { + return std::round(value * static_cast(std::pow(10, decimals))) / + std::pow(10, decimals); +} + +static void parse_table(const nlohmann::json &table_df, + std::unordered_map &target, + const std::string &col) { + const nlohmann::json &load = table_df.at("_object").at(col); + const std::string load_obj_str = load.at("_object").get(); + nlohmann::json load_df = nlohmann::json::parse(load_obj_str); + + const auto &cols = load_df.at("columns"); + auto it = std::find(cols.begin(), cols.end(), "bus"); + if (it == cols.end()) { + throw std::runtime_error( + "load dataframe does not contain a 'bus' column"); + } + const size_t bus_col = + static_cast(std::distance(cols.begin(), it)); + + const auto &idxs = load_df.at("index"); + const auto &rows = load_df.at("data"); + if (idxs.size() != rows.size()) { + throw std::runtime_error("'index' and 'data' length mismatch"); + } + + for (size_t i = 0; i < rows.size(); ++i) { + const int idx = idxs.at(i).get(); + const auto &row = rows.at(i); + const auto &bus_cell = row.at(bus_col); + const int bus = bus_cell.get(); + target[idx] = bus; + } +} + +static std::vector +glob_sorted(const std::filesystem::path &dir, const std::string &prefix) { + std::vector files; + if (!std::filesystem::exists(dir)) { + throw std::runtime_error("Directory missing: " + dir.string()); + } + + for (auto &entry : std::filesystem::directory_iterator(dir)) { + if (!entry.is_regular_file()) + continue; + const auto name = entry.path().filename().string(); + if (name.rfind(prefix, 0) == 0 && entry.path().extension() == ".csv") + files.push_back(entry.path()); + } + + std::sort(files.begin(), files.end(), [](const auto &a, const auto &b) { + return extract_file_number(a) < extract_file_number(b); + }); + return files; +} + +static size_t find_column_index(const std::vector &columns, + const std::string &name, + const std::filesystem::path &path) { + auto it = std::find(columns.begin(), columns.end(), name); + if (it == columns.end()) + throw std::runtime_error("Column " + name + " missing in " + path.string()); + return static_cast(std::distance(columns.begin(), it)); +} + +static std::pair, std::vector> +load_pq_series_csv(const std::filesystem::path &path) { + std::ifstream in(path); + if (!in) + throw std::runtime_error("Cannot open CSV: " + path.string()); + + std::string header; + if (!std::getline(in, header)) + throw std::runtime_error("Empty CSV: " + path.string()); + + std::vector columns; + { + std::stringstream ss(header); + std::string token; + while (std::getline(ss, token, ',')) { + columns.push_back(token); + } + } + + const size_t p_idx = find_column_index(columns, "P_norm", path); + const size_t q_idx = find_column_index(columns, "Q_norm", path); + + std::vector p_norm; + std::vector q_norm; + + std::string line; + while (std::getline(in, line)) { + if (line.empty()) + continue; + + std::stringstream ss(line); + std::string cell; + size_t col = 0; + double p = 0.0; + double q = 0.0; + + while (std::getline(ss, cell, ',')) { + if (col == p_idx) + p = std::stod(cell); + else if (col == q_idx) + q = std::stod(cell); + ++col; + } + + p_norm.push_back(p); + q_norm.push_back(q); + } + + return {std::move(p_norm), std::move(q_norm)}; +} + +static void write_csv(const std::filesystem::path &path, + const std::string &header, + const std::vector> &columns) { + std::ofstream out(path); + if (!out) { + throw std::runtime_error("Cannot open output file: " + path.string()); + } + + out << header << '\n'; + + const size_t rows = columns.empty() ? 0 : columns.front().size(); + for (size_t r = 0; r < rows; ++r) { + for (size_t c = 0; c < columns.size(); ++c) { + if (c) + out << ';'; + out << columns[c][r]; + } + out << '\n'; + } +} + +class CreateChronics : public Tool { +public: + CreateChronics(int argc, char *argv[]) : Tool(argc, argv, "chronics") {} + +protected: + std::filesystem::path config_path; + + void usage() override { + std::cout << "Usage: villas-chronics [OPTIONS] CONFIG.json" << std::endl + << std::endl + << "OPTIONS:" << std::endl + << " -d LVL set debug log level" << std::endl + << " -h show this help" << std::endl + << " -V show version and exit" << std::endl + << std::endl; + printCopyright(); + } + + void parse() override { + int c; + while ((c = getopt(argc, argv, "d:Vh")) != -1) { + switch (c) { + case 'd': + Log::getInstance().setLevel(optarg); + break; + case 'V': + printVersion(); + exit(EXIT_SUCCESS); + case 'h': + case '?': + usage(); + exit(c == '?' ? EXIT_FAILURE : EXIT_SUCCESS); + } + } + + if (argc - optind < 1) { + usage(); + exit(EXIT_FAILURE); + } + + config_path = argv[optind]; + } + + int main() override { + nlohmann::json cfg; + { + std::ifstream in(config_path); + if (!in) + throw std::runtime_error("Cannot open config file: " + + config_path.string()); + in >> cfg; + } + + options = ChronicsOptions::from_json(cfg); + sgen_idx = 0; + + mapping = load_grid(); + discover_files(); + process_load_files(); + process_sgen_files(); + round_values(); + write_outputs(); + + return 0; + } + +private: + struct GridMapping { + std::unordered_map load_bus; + std::unordered_map sgen_bus; + }; + + struct ChronicsOptions { + std::filesystem::path loads_dir; + std::filesystem::path sgens_dir; + std::filesystem::path grid_path; + std::filesystem::path output_dir; + + unsigned round_decimals = 3; + bool compress = true; + bool negate_sgens = true; + + float voltage = 20.0; + + static ChronicsOptions from_json(const nlohmann::json &cfg) { + if (!cfg.contains("loads_dir") || !cfg.contains("sgens_dir") || + !cfg.contains("grid") || !cfg.contains("output")) { + throw std::runtime_error( + "chronics: loads_dir, sgens_dir, grid, output are required"); + } + + ChronicsOptions opts; + opts.loads_dir = cfg.at("loads_dir").get(); + opts.sgens_dir = cfg.at("sgens_dir").get(); + opts.grid_path = cfg.at("grid").get(); + opts.output_dir = cfg.at("output").get(); + + if (cfg.contains("round_decimals")) + opts.round_decimals = cfg.at("round_decimals").get(); + if (cfg.contains("compress")) + opts.compress = cfg.at("compress").get(); + if (cfg.contains("negate_sgens")) + opts.negate_sgens = cfg.at("negate_sgens").get(); + if (cfg.contains("voltage")) + opts.voltage = cfg.at("voltage").get(); + + return opts; + } + }; + + ChronicsOptions options; + GridMapping mapping; + + std::vector load_files; + std::vector sgen_files; + + std::vector> load_p_columns; + std::vector> load_q_columns; + + std::vector> prod_p_columns; + std::vector> prod_q_columns; + std::vector> prod_v_columns; + + std::string load_col_names; + std::string sgen_col_names; + unsigned sgen_idx = 0; + + GridMapping load_grid() { + std::ifstream in(options.grid_path); + if (!in) + throw std::runtime_error("Cannot open grid file: " + + options.grid_path.string()); + + nlohmann::json grid_json; + in >> grid_json; + + GridMapping m; + parse_table(grid_json, m.load_bus, "load"); + parse_table(grid_json, m.sgen_bus, "sgen"); + return m; + } + + void discover_files() { + load_files = glob_sorted(options.loads_dir, "Load"); + sgen_files = glob_sorted(options.sgens_dir, "SGen"); + + if (load_files.empty() && sgen_files.empty()) { + throw std::runtime_error("chronics_hook: no csv files found"); + } + } + + void process_load_files() { + for (const auto &file : load_files) { + const int element_index = extract_file_number(file); + auto it = mapping.load_bus.find(element_index); + if (it == mapping.load_bus.end()) + throw std::runtime_error("Load index missing in grid mapping: " + + std::to_string(element_index)); + + const auto [p_norm, q_norm] = load_pq_series_csv(file); + load_p_columns.push_back(p_norm); + load_q_columns.push_back(q_norm); + + const int bus_id = it->second; + const size_t col_idx = load_p_columns.size() - 1; + const std::string col_name = "load_" + std::to_string(bus_id) + "_" + + std::to_string(col_idx); + + if (!load_col_names.empty()) + load_col_names += ';'; + load_col_names += col_name; + } + } + + void process_sgen_files() { + for (const auto &file : sgen_files) { + const int element_index = extract_file_number(file); + auto it = mapping.sgen_bus.find(element_index); + if (it == mapping.sgen_bus.end()) + throw std::runtime_error( + "SGen index missing in grid mapping: " + + std::to_string(element_index)); + + const auto [p_norm, q_norm] = load_pq_series_csv(file); + const int bus_id = it->second; + + prod_p_columns.push_back(p_norm); + prod_q_columns.push_back(q_norm); + prod_v_columns.push_back(std::vector(p_norm.size(), options.voltage)); + + const std::string col_name = + "sgen_" + std::to_string(bus_id) + "_" + std::to_string(sgen_idx); + if (!sgen_col_names.empty()) + sgen_col_names += ';'; + sgen_col_names += col_name; + + ++sgen_idx; + } + } + + void round_values() { + for (auto &col : load_p_columns) + for (double &v : col) + v = round_dec(v, options.round_decimals); + + for (auto &col : load_q_columns) + for (double &v : col) + v = round_dec(v, options.round_decimals); + } + + void write_outputs() { + std::filesystem::create_directories(options.output_dir); + + write_csv(options.output_dir / "load_p.csv", load_col_names, + load_p_columns); + write_csv(options.output_dir / "load_q.csv", load_col_names, + load_q_columns); + + write_csv(options.output_dir / "prod_p.csv", sgen_col_names, + prod_p_columns); + write_csv(options.output_dir / "prod_q.csv", sgen_col_names, + prod_q_columns); + write_csv(options.output_dir / "prod_v.csv", sgen_col_names, + prod_v_columns); + } +}; + +} // namespace tools +} // namespace node +} // namespace villas + +int main(int argc, char *argv[]) { + return villas::node::tools::CreateChronics(argc, argv).run(); +} From d93d4ad33307a7f146cc407e8475059e22b21dc2 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 13 Apr 2026 12:20:12 +0200 Subject: [PATCH 02/15] feat (villas-chronics): Add bzip2 and nlohmann/json packages for villas-chronics Signed-off-by: Ritesh.K --- packaging/deps.sh | 900 ++++++++++--------- packaging/docker/Dockerfile.debian | 4 +- packaging/docker/Dockerfile.debian-multiarch | 4 +- packaging/docker/Dockerfile.fedora | 4 +- packaging/docker/Dockerfile.fedora-minimal | 5 +- packaging/docker/Dockerfile.rocky | 4 +- packaging/docker/Dockerfile.rocky9 | 4 +- packaging/docker/Dockerfile.ubuntu | 4 +- packaging/nix/villas.nix | 4 + 9 files changed, 488 insertions(+), 445 deletions(-) diff --git a/packaging/deps.sh b/packaging/deps.sh index 35e0f840c..69720f3e9 100644 --- a/packaging/deps.sh +++ b/packaging/deps.sh @@ -15,71 +15,70 @@ set -u set -o pipefail should_build() { - local id="$1" - local use="$2" - local requirement="${3:-optional}" - - case "${requirement}" in - optional) ;; - required) ;; - *) - echo >&2 "Error: invalid parameter '$2' for should_build. should be one of 'optional' and 'required', default is 'optional'" - exit 1 - ;; - esac - - local deps="${@:4}" - - if [[ -n "${DEPS_SCAN+x}" ]]; then - echo "${requirement} dependendency ${id} should be installed ${use}." - [[ -n "${deps[*]}" ]] && echo " transitive dependencies: ${deps}" - echo - return 1 - fi - - if { [[ "${DEPS_SKIP:-}" == *"${id}"* ]] || { [[ -n "${DEPS_INCLUDE+x}" ]] && [[ ! "${DEPS_INCLUDE}" == *"${id}"* ]]; }; } - then - echo "Skipping ${requirement} dependency '${id}'" - return 1 - fi - - if [[ -z "${DEPS_NONINTERACTIVE+x}" ]] && [[ -t 1 ]]; then - echo - read -p "Do you wan't to install '${id}' into '${PREFIX}'? This is used ${use}. (y/N) " - case "${REPLY}" in - y | Y) - echo "Installing '${id}'" - return 0 - ;; - - *) - echo "Skipping '${id}'" - return 1 - ;; - esac - fi - - return 0 + local id="$1" + local use="$2" + local requirement="${3:-optional}" + + case "${requirement}" in + optional) ;; + required) ;; + *) + echo >&2 "Error: invalid parameter '$2' for should_build. should be one of 'optional' and 'required', default is 'optional'" + exit 1 + ;; + esac + + local deps="${@:4}" + + if [[ -n "${DEPS_SCAN+x}" ]]; then + echo "${requirement} dependendency ${id} should be installed ${use}." + [[ -n "${deps[*]}" ]] && echo " transitive dependencies: ${deps}" + echo + return 1 + fi + + if { [[ "${DEPS_SKIP:-}" == *"${id}"* ]] || { [[ -n "${DEPS_INCLUDE+x}" ]] && [[ ! "${DEPS_INCLUDE}" == *"${id}"* ]]; }; }; then + echo "Skipping ${requirement} dependency '${id}'" + return 1 + fi + + if [[ -z "${DEPS_NONINTERACTIVE+x}" ]] && [[ -t 1 ]]; then + echo + read -p "Do you wan't to install '${id}' into '${PREFIX}'? This is used ${use}. (y/N) " + case "${REPLY}" in + y | Y) + echo "Installing '${id}'" + return 0 + ;; + + *) + echo "Skipping '${id}'" + return 1 + ;; + esac + fi + + return 0 } has_command() { - command -v "$1" >/dev/null 2>&1 + command -v "$1" >/dev/null 2>&1 } has_git_svn() { - git svn --version > /dev/null 2>&1 + git svn --version >/dev/null 2>&1 } check_cmake_version() { - local cmake_version - cmake_version=$(cmake --version | head -n1 | awk '{print $3}') - local required_version=$1 - - if [ "$(printf '%s\n%s\n' "$required_version" "$cmake_version" | sort -V | head -n1)" = "$required_version" ]; then - return 0 - else - return 1 - fi + local cmake_version + cmake_version=$(cmake --version | head -n1 | awk '{print $3}') + local required_version=$1 + + if [ "$(printf '%s\n%s\n' "$required_version" "$cmake_version" | sort -V | head -n1)" = "$required_version" ]; then + return 0 + else + return 1 + fi } ## Build configuration @@ -90,11 +89,11 @@ GIT_OPTS+=" --depth=1 --recurse-submodules --shallow-submodules --config advice. # Install destination PREFIX=${PREFIX:-/usr/local} if [[ "${PREFIX}" == "/usr/local" ]]; then - PIP_PREFIX="$(pwd)/venv" - PATH="${PIP_PREFIX}/bin:${PREFIX}/bin:${PATH}" + PIP_PREFIX="$(pwd)/venv" + PATH="${PIP_PREFIX}/bin:${PREFIX}/bin:${PATH}" else - PIP_PREFIX="${PREFIX}" - PATH="${PREFIX}/bin:${PATH}" + PIP_PREFIX="${PREFIX}" + PATH="${PREFIX}/bin:${PATH}" fi # Cross-compile @@ -129,8 +128,8 @@ pushd ${TMPDIR} >/dev/null # Check for pkg-config if ! has_command pkg-config; then - echo -e "Error: pkg-config is required to check for existing dependencies." - exit 1 + echo -e "Error: pkg-config is required to check for existing dependencies." + exit 1 fi # Enter python venv @@ -139,472 +138,497 @@ python3 -m venv ${PIP_PREFIX} # Install some build-tools python3 -m pip install \ - --prefix=${PIP_PREFIX} \ - --upgrade \ - pip==25.3 \ - setuptools \ + --prefix=${PIP_PREFIX} \ + --upgrade \ + pip==25.3 \ + setuptools python3 -m pip install \ - --prefix=${PIP_PREFIX} \ - cmake==3.31.6 \ - meson==1.9.1 \ - ninja==1.11.1.4 + --prefix=${PIP_PREFIX} \ + cmake==3.31.6 \ + meson==1.9.1 \ + ninja==1.11.1.4 # Build & Install Criterion -if ! pkg-config "criterion >= 2.4.1" && \ - [ "${ARCH}" == "x86_64" ] && \ - should_build "criterion" "for unit tests"; then - git clone ${GIT_OPTS} --branch v2.4.3 --recursive https://github.com/Snaipe/Criterion.git - pushd Criterion - - meson setup \ - --prefix=${PREFIX} \ - --cmake-prefix-path=${PREFIX} \ - --backend=ninja \ - build - meson compile -C build - meson install -C build - - popd +if ! pkg-config "criterion >= 2.4.1" && + [ "${ARCH}" == "x86_64" ] && + should_build "criterion" "for unit tests"; then + git clone ${GIT_OPTS} --branch v2.4.3 --recursive https://github.com/Snaipe/Criterion.git + pushd Criterion + + meson setup \ + --prefix=${PREFIX} \ + --cmake-prefix-path=${PREFIX} \ + --backend=ninja \ + build + meson compile -C build + meson install -C build + + popd fi # Build & Install jansson -if ! pkg-config "jansson >= 2.13" && \ - should_build "jansson" "for configuration parsing" "required"; then - git clone ${GIT_OPTS} --branch v2.14.1 https://github.com/akheron/jansson.git - mkdir -p jansson/build - pushd jansson/build - cmake -DJANSSON_BUILD_SHARED_LIBS=ON \ - -DJANSSON_BUILD_STATIC_LIBS=OFF \ - -DJANSSON_WITHOUT_TESTS=ON \ - -DJANSSON_EXAMPLES=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "jansson >= 2.13" && + should_build "jansson" "for configuration parsing" "required"; then + git clone ${GIT_OPTS} --branch v2.14.1 https://github.com/akheron/jansson.git + mkdir -p jansson/build + pushd jansson/build + cmake -DJANSSON_BUILD_SHARED_LIBS=ON \ + -DJANSSON_BUILD_STATIC_LIBS=OFF \ + -DJANSSON_WITHOUT_TESTS=ON \ + -DJANSSON_EXAMPLES=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install Lua -if ! ( pkg-config "lua >= 5.1" || \ - pkg-config "lua54" || \ - pkg-config "lua53" || \ - pkg-config "lua52" || \ - pkg-config "lua51" || \ - { [[ -n "${RTLAB_ROOT:+x}" ]] && [[ -f "/usr/local/include/lua.h" ]]; } \ - ) && should_build "lua" "for the lua hook"; then - curl -L http://www.lua.org/ftp/lua-5.4.7.tar.gz | tar -xz - pushd lua-5.4.7 - make ${MAKE_OPTS} MYCFLAGS=-fPIC linux - make ${MAKE_OPTS} MYCFLAGS=-fPIC INSTALL_TOP=${PREFIX} install - popd +if ! ( + pkg-config "lua >= 5.1" || + pkg-config "lua54" || + pkg-config "lua53" || + pkg-config "lua52" || + pkg-config "lua51" || + { [[ -n "${RTLAB_ROOT:+x}" ]] && [[ -f "/usr/local/include/lua.h" ]]; } +) && should_build "lua" "for the lua hook"; then + curl -L http://www.lua.org/ftp/lua-5.4.7.tar.gz | tar -xz + pushd lua-5.4.7 + make ${MAKE_OPTS} MYCFLAGS=-fPIC linux + make ${MAKE_OPTS} MYCFLAGS=-fPIC INSTALL_TOP=${PREFIX} install + popd fi # Build & Install mosquitto -if ! pkg-config "libmosquitto >= 1.4.15" && \ - should_build "mosquitto" "for the mqtt node-type"; then - git clone ${GIT_OPTS} --branch v2.0.22 https://github.com/eclipse/mosquitto.git - mkdir -p mosquitto/build - pushd mosquitto/build - cmake -DWITH_BROKER=OFF \ - -DWITH_CLIENTS=OFF \ - -DWITH_APPS=OFF \ - -DDOCUMENTATION=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libmosquitto >= 1.4.15" && + should_build "mosquitto" "for the mqtt node-type"; then + git clone ${GIT_OPTS} --branch v2.0.22 https://github.com/eclipse/mosquitto.git + mkdir -p mosquitto/build + pushd mosquitto/build + cmake -DWITH_BROKER=OFF \ + -DWITH_CLIENTS=OFF \ + -DWITH_APPS=OFF \ + -DDOCUMENTATION=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install rabbitmq-c -if ! pkg-config "librabbitmq >= 0.13.0" && \ - should_build "rabbitmq" "for the amqp node-node and VILLAScontroller"; then - git clone ${GIT_OPTS} --branch v0.15.0 https://github.com/alanxz/rabbitmq-c.git - mkdir -p rabbitmq-c/build - pushd rabbitmq-c/build - cmake ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "librabbitmq >= 0.13.0" && + should_build "rabbitmq" "for the amqp node-node and VILLAScontroller"; then + git clone ${GIT_OPTS} --branch v0.15.0 https://github.com/alanxz/rabbitmq-c.git + mkdir -p rabbitmq-c/build + pushd rabbitmq-c/build + cmake ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libzmq -if ! pkg-config "libzmq >= 2.2.0" && \ - should_build "zmq" "for the zeromq node-type"; then - git clone ${GIT_OPTS} --branch v4.3.5 https://github.com/zeromq/libzmq.git - mkdir -p libzmq/build - pushd libzmq/build - cmake -DWITH_PERF_TOOL=OFF \ - -DZMQ_BUILD_TESTS=OFF \ - -DENABLE_CPACK=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libzmq >= 2.2.0" && + should_build "zmq" "for the zeromq node-type"; then + git clone ${GIT_OPTS} --branch v4.3.5 https://github.com/zeromq/libzmq.git + mkdir -p libzmq/build + pushd libzmq/build + cmake -DWITH_PERF_TOOL=OFF \ + -DZMQ_BUILD_TESTS=OFF \ + -DENABLE_CPACK=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install EtherLab -if ! pkg-config "libethercat >= 1.5.2" && \ - should_build "ethercat" "for the ethercat node-type"; then - git clone ${GIT_OPTS} --branch 1.6.8 https://gitlab.com/etherlab.org/ethercat.git - pushd ethercat - ./bootstrap - ./configure --enable-userlib=yes --enable-kernel=no ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! pkg-config "libethercat >= 1.5.2" && + should_build "ethercat" "for the ethercat node-type"; then + git clone ${GIT_OPTS} --branch 1.6.8 https://gitlab.com/etherlab.org/ethercat.git + pushd ethercat + ./bootstrap + ./configure --enable-userlib=yes --enable-kernel=no ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install libiec61850 -if ! pkg-config "libiec61850 >= 1.6.0" && \ - should_build "iec61850" "for the iec61850 node-type"; then - git clone ${GIT_OPTS} --branch v1.6.1 https://github.com/mz-automation/libiec61850.git - - pushd libiec61850/third_party/mbedtls/ - curl -L https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.6.0.tar.gz | tar -xz - popd - - mkdir -p libiec61850/build - pushd libiec61850/build - cmake -DBUILD_EXAMPLES=OFF \ - -DBUILD_PYTHON_BINDINGS=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libiec61850 >= 1.6.0" && + should_build "iec61850" "for the iec61850 node-type"; then + git clone ${GIT_OPTS} --branch v1.6.1 https://github.com/mz-automation/libiec61850.git + + pushd libiec61850/third_party/mbedtls/ + curl -L https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.6.0.tar.gz | tar -xz + popd + + mkdir -p libiec61850/build + pushd libiec61850/build + cmake -DBUILD_EXAMPLES=OFF \ + -DBUILD_PYTHON_BINDINGS=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install lib60870 -if ! pkg-config "lib60870 >= 2.3.1" && \ - should_build "iec60870" "for the iec60870 node-type"; then - git clone ${GIT_OPTS} --branch v2.3.6 https://github.com/mz-automation/lib60870.git - mkdir -p lib60870/build - pushd lib60870/build - cmake -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF \ - ${CMAKE_OPTS} ../lib60870-C - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "lib60870 >= 2.3.1" && + should_build "iec60870" "for the iec60870 node-type"; then + git clone ${GIT_OPTS} --branch v2.3.6 https://github.com/mz-automation/lib60870.git + mkdir -p lib60870/build + pushd lib60870/build + cmake -DBUILD_EXAMPLES=OFF \ + -DBUILD_TESTS=OFF \ + ${CMAKE_OPTS} ../lib60870-C + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install librdkafka -if ! pkg-config "rdkafka >= 1.5.0" && \ - should_build "rdkafka" "for the kafka node-type"; then - git clone ${GIT_OPTS} --branch v2.12.1 https://github.com/edenhill/librdkafka.git - mkdir -p librdkafka/build - pushd librdkafka/build - cmake -DRDKAFKA_BUILD_TESTS=OFF \ - -DRDKAFKA_BUILD_EXAMPLES=OFF \ - -DWITH_CURL=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "rdkafka >= 1.5.0" && + should_build "rdkafka" "for the kafka node-type"; then + git clone ${GIT_OPTS} --branch v2.12.1 https://github.com/edenhill/librdkafka.git + mkdir -p librdkafka/build + pushd librdkafka/build + cmake -DRDKAFKA_BUILD_TESTS=OFF \ + -DRDKAFKA_BUILD_EXAMPLES=OFF \ + -DWITH_CURL=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install Graphviz -if ! ( pkg-config "libcgraph >= 2.30" && \ - pkg-config "libgvc >= 2.30" \ - ) && should_build "graphviz" "for villas-graph"; then - curl -L https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/14.0.2/graphviz-14.0.2.tar.gz | tar -xz - mkdir -p graphviz-14.0.2 - pushd graphviz-14.0.2 - ./configure --enable-shared ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! ( + pkg-config "libcgraph >= 2.30" && + pkg-config "libgvc >= 2.30" +) && should_build "graphviz" "for villas-graph"; then + curl -L https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/14.0.2/graphviz-14.0.2.tar.gz | tar -xz + mkdir -p graphviz-14.0.2 + pushd graphviz-14.0.2 + ./configure --enable-shared ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install uldaq -if ! pkg-config "libuldaq >= 1.2.0" && \ - should_build "uldaq" "for the uldaq node-type"; then - git clone ${GIT_OPTS} --branch v1.2.1 https://github.com/mccdaq/uldaq.git - pushd uldaq - autoreconf -i - ./configure \ - --disable-examples \ - ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! pkg-config "libuldaq >= 1.2.0" && + should_build "uldaq" "for the uldaq node-type"; then + git clone ${GIT_OPTS} --branch v1.2.1 https://github.com/mccdaq/uldaq.git + pushd uldaq + autoreconf -i + ./configure \ + --disable-examples \ + ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install libnl -if ! ( pkg-config "libnl-3.0 >= 3.2.25" && \ - pkg-config "libnl-route-3.0 >= 3.2.25" \ - ) && should_build "libnl" "for network emulation"; then - git clone ${GIT_OPTS} --branch libnl3_11_0 https://github.com/thom311/libnl.git - pushd libnl - autoreconf -i - ./configure \ - --enable-cli=no \ - ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! ( + pkg-config "libnl-3.0 >= 3.2.25" && + pkg-config "libnl-route-3.0 >= 3.2.25" +) && should_build "libnl" "for network emulation"; then + git clone ${GIT_OPTS} --branch libnl3_11_0 https://github.com/thom311/libnl.git + pushd libnl + autoreconf -i + ./configure \ + --enable-cli=no \ + ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install libconfig -if ! pkg-config "libconfig >= 1.4.9" && \ - should_build "libconfig" "for libconfig configuration syntax"; then - git clone ${GIT_OPTS} --branch v1.8.1 https://github.com/hyperrealm/libconfig.git - mkdir -p libconfig/build - pushd libconfig/build - cmake -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF \ - -DBUILD_CXX=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libconfig >= 1.4.9" && + should_build "libconfig" "for libconfig configuration syntax"; then + git clone ${GIT_OPTS} --branch v1.8.1 https://github.com/hyperrealm/libconfig.git + mkdir -p libconfig/build + pushd libconfig/build + cmake -DBUILD_EXAMPLES=OFF \ + -DBUILD_TESTS=OFF \ + -DBUILD_CXX=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install comedilib -if ! pkg-config "comedilib >= 0.11.0" && \ - should_build "comedi" "for the comedi node-type"; then - git clone ${GIT_OPTS} --branch r0_12_0 https://github.com/Linux-Comedi/comedilib.git - pushd comedilib - ./autogen.sh - ./configure \ - --disable-docbook \ - ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! pkg-config "comedilib >= 0.11.0" && + should_build "comedi" "for the comedi node-type"; then + git clone ${GIT_OPTS} --branch r0_12_0 https://github.com/Linux-Comedi/comedilib.git + pushd comedilib + ./autogen.sh + ./configure \ + --disable-docbook \ + ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install libre -if ! pkg-config "libre >= 3.6.0" && \ - should_build "libre" "for the rtp node-type"; then - git clone ${GIT_OPTS} --branch v4.2.0 https://github.com/baresip/re.git - mkdir -p re/build - pushd re/build - cmake -DUSE_BFCP=OFF \ - -DUSE_PCP=OFF \ - -DUSE_RTMP=OFF \ - -DUSE_SIP=OFF \ - -DLIBRE_BUILD_STATIC=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libre >= 3.6.0" && + should_build "libre" "for the rtp node-type"; then + git clone ${GIT_OPTS} --branch v4.2.0 https://github.com/baresip/re.git + mkdir -p re/build + pushd re/build + cmake -DUSE_BFCP=OFF \ + -DUSE_PCP=OFF \ + -DUSE_RTMP=OFF \ + -DUSE_SIP=OFF \ + -DLIBRE_BUILD_STATIC=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install nanomsg -if ! pkg-config "nanomsg >= 1.0.0" && \ - should_build "nanomsg" "for the nanomsg node-type"; then - # TODO: v1.2.1 seems to be broken: https://github.com/nanomsg/nanomsg/issues/1111 - git clone ${GIT_OPTS} --branch 1.2.2 https://github.com/nanomsg/nanomsg.git - mkdir -p nanomsg/build - pushd nanomsg/build - cmake -DNN_TESTS=OFF \ - -DNN_TOOLS=OFF \ - -DNN_STATIC_LIB=OFF \ - -DNN_ENABLE_DOC=OFF \ - -DNN_ENABLE_COVERAGE=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "nanomsg >= 1.0.0" && + should_build "nanomsg" "for the nanomsg node-type"; then + # TODO: v1.2.1 seems to be broken: https://github.com/nanomsg/nanomsg/issues/1111 + git clone ${GIT_OPTS} --branch 1.2.2 https://github.com/nanomsg/nanomsg.git + mkdir -p nanomsg/build + pushd nanomsg/build + cmake -DNN_TESTS=OFF \ + -DNN_TOOLS=OFF \ + -DNN_STATIC_LIB=OFF \ + -DNN_ENABLE_DOC=OFF \ + -DNN_ENABLE_COVERAGE=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libxil -if ! pkg-config "libxil >= 1.0.0" && \ - should_build "libxil" "for the fpga node-type"; then - git clone ${GIT_OPTS} --branch master https://github.com/VILLASframework/libxil.git - mkdir -p libxil/build - pushd libxil/build - cmake ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libxil >= 1.0.0" && + should_build "libxil" "for the fpga node-type"; then + git clone ${GIT_OPTS} --branch master https://github.com/VILLASframework/libxil.git + mkdir -p libxil/build + pushd libxil/build + cmake ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install hiredis -if ! pkg-config "hiredis >= 1.0.0" && \ - should_build "hiredis" "for the redis node-type"; then - git clone ${GIT_OPTS} --branch v1.3.0 https://github.com/redis/hiredis.git - mkdir -p hiredis/build - pushd hiredis/build - cmake -DDISABLE_TESTS=ON \ - -DENABLE_SSL=ON \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "hiredis >= 1.0.0" && + should_build "hiredis" "for the redis node-type"; then + git clone ${GIT_OPTS} --branch v1.3.0 https://github.com/redis/hiredis.git + mkdir -p hiredis/build + pushd hiredis/build + cmake -DDISABLE_TESTS=ON \ + -DENABLE_SSL=ON \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install redis++ -if ! pkg-config "redis++ >= 1.2.3" && \ - should_build "redis++" "for the redis node-type"; then - git clone ${GIT_OPTS} --branch 1.3.15 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${PREFIX}/include" - - cmake -DREDIS_PLUS_PLUS_BUILD_TEST=OFF \ - -DREDIS_PLUS_PLUS_BUILD_STATIC=OFF \ - -DREDIS_PLUS_PLUS_CXX_STANDARD=17 \ - ${REDISPP_CMAKE_OPTS} ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "redis++ >= 1.2.3" && + should_build "redis++" "for the redis node-type"; then + git clone ${GIT_OPTS} --branch 1.3.15 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${PREFIX}/include" + + cmake -DREDIS_PLUS_PLUS_BUILD_TEST=OFF \ + -DREDIS_PLUS_PLUS_BUILD_STATIC=OFF \ + -DREDIS_PLUS_PLUS_CXX_STANDARD=17 \ + ${REDISPP_CMAKE_OPTS} ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install Fmtlib -if ! pkg-config "fmt >= 6.1.2" && \ - should_build "fmt" "for logging" "required"; then - git clone ${GIT_OPTS} --branch 12.1.0 --recursive https://github.com/fmtlib/fmt.git - mkdir -p fmt/build - pushd fmt/build - cmake -DBUILD_SHARED_LIBS=1 \ - -DFMT_TEST=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "fmt >= 6.1.2" && + should_build "fmt" "for logging" "required"; then + git clone ${GIT_OPTS} --branch 12.1.0 --recursive https://github.com/fmtlib/fmt.git + mkdir -p fmt/build + pushd fmt/build + cmake -DBUILD_SHARED_LIBS=1 \ + -DFMT_TEST=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install spdlog -if ! pkg-config "spdlog >= 1.8.2" && \ - should_build "spdlog" "for logging" "required"; then - git clone ${GIT_OPTS} --branch v1.16.0 --recursive https://github.com/gabime/spdlog.git - mkdir -p spdlog/build - pushd spdlog/build - cmake -DSPDLOG_FMT_EXTERNAL=ON \ - -DSPDLOG_BUILD_BENCH=OFF \ - -DSPDLOG_BUILD_SHARED=ON \ - -DSPDLOG_BUILD_TESTS=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "spdlog >= 1.8.2" && + should_build "spdlog" "for logging" "required"; then + git clone ${GIT_OPTS} --branch v1.16.0 --recursive https://github.com/gabime/spdlog.git + mkdir -p spdlog/build + pushd spdlog/build + cmake -DSPDLOG_FMT_EXTERNAL=ON \ + -DSPDLOG_BUILD_BENCH=OFF \ + -DSPDLOG_BUILD_SHARED=ON \ + -DSPDLOG_BUILD_TESTS=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libwebsockets -if ! pkg-config "libwebsockets >= 4.3.0" && \ - should_build "libwebsockets" "for the websocket node and VILLASweb" "required"; then - git clone ${GIT_OPTS} --branch v4.3.6 https://github.com/warmcat/libwebsockets.git - mkdir -p libwebsockets/build - pushd libwebsockets/build - cmake -DLWS_WITH_IPV6=ON \ - -DLWS_WITHOUT_TESTAPPS=ON \ - -DLWS_WITHOUT_EXTENSIONS=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libwebsockets >= 4.3.0" && + should_build "libwebsockets" "for the websocket node and VILLASweb" "required"; then + git clone ${GIT_OPTS} --branch v4.3.6 https://github.com/warmcat/libwebsockets.git + mkdir -p libwebsockets/build + pushd libwebsockets/build + cmake -DLWS_WITH_IPV6=ON \ + -DLWS_WITHOUT_TESTAPPS=ON \ + -DLWS_WITHOUT_EXTENSIONS=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libnice -if ! pkg-config "nice >= 0.1.16" && \ - should_build "libnice" "for the webrtc node-type"; then - git clone ${GIT_OPTS} --branch 0.1.22 https://gitlab.freedesktop.org/libnice/libnice.git - mkdir -p libnice/build - pushd libnice - - meson setup \ - --prefix=${PREFIX} \ - --cmake-prefix-path=${PREFIX} \ - --backend=ninja \ - build - meson compile -C build - meson install -C build - - popd +if ! pkg-config "nice >= 0.1.16" && + should_build "libnice" "for the webrtc node-type"; then + git clone ${GIT_OPTS} --branch 0.1.22 https://gitlab.freedesktop.org/libnice/libnice.git + mkdir -p libnice/build + pushd libnice + + meson setup \ + --prefix=${PREFIX} \ + --cmake-prefix-path=${PREFIX} \ + --backend=ninja \ + build + meson compile -C build + meson install -C build + + popd fi # Build & Install libdatachannel -if ! cmake --find-package -DNAME=LibDataChannel -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST >/dev/null 2>/dev/null && \ - should_build "libdatachannel" "for the webrtc node-type"; then - git clone ${GIT_OPTS} --recursive --branch v0.23.2 https://github.com/paullouisageneau/libdatachannel.git - mkdir -p libdatachannel/build - pushd libdatachannel/build - - if pkg-config "nice >= 0.1.16"; then - CMAKE_DATACHANNEL_USE_NICE=-DUSE_NICE=ON - fi - - cmake -DNO_MEDIA=ON \ - -DNO_WEBSOCKET=ON \ - ${CMAKE_DATACHANNEL_USE_NICE-} \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! cmake --find-package -DNAME=LibDataChannel -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST >/dev/null 2>/dev/null && + should_build "libdatachannel" "for the webrtc node-type"; then + git clone ${GIT_OPTS} --recursive --branch v0.23.2 https://github.com/paullouisageneau/libdatachannel.git + mkdir -p libdatachannel/build + pushd libdatachannel/build + + if pkg-config "nice >= 0.1.16"; then + CMAKE_DATACHANNEL_USE_NICE=-DUSE_NICE=ON + fi + + cmake -DNO_MEDIA=ON \ + -DNO_WEBSOCKET=ON \ + ${CMAKE_DATACHANNEL_USE_NICE-} \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libmodbus -if ! pkg-config "libmodbus >= 3.1.0" && \ - should_build "libmodbus" "for the modbus node-type"; then - git clone ${GIT_OPTS} --recursive --branch v3.1.11 https://github.com/stephane/libmodbus.git - mkdir -p libmodbus/build - pushd libmodbus - autoreconf -i - ./configure ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! pkg-config "libmodbus >= 3.1.0" && + should_build "libmodbus" "for the modbus node-type"; then + git clone ${GIT_OPTS} --recursive --branch v3.1.11 https://github.com/stephane/libmodbus.git + mkdir -p libmodbus/build + pushd libmodbus + autoreconf -i + ./configure ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install OpenDSS if ! find /usr/{local/,}{lib,bin} -name "libOpenDSSC.so" | grep -q . && - should_build "opendss" "For opendss node-type" && - has_git_svn; then - git svn clone -r 4020:4020 https://svn.code.sf.net/p/electricdss/code/trunk/VersionC OpenDSS-C - mkdir -p OpenDSS-C/build - pushd OpenDSS-C - for i in ${SOURCE_DIR}/patches/*-opendssc-*.patch; do patch --strip=1 --binary < "$i"; done - popd - pushd OpenDSS-C/build - if command -v g++-14 2>&1 >/dev/null; then - # OpenDSS rev 4020 is not compatible with GCC 15 - OPENDSS_CMAKE_OPTS="-DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14" - else - OPENDSS_CMAKE_OPTS="" - fi - cmake -DMyOutputType=DLL \ - ${OPENDSS_CMAKE_OPTS} \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd - - echo "${PREFIX}/openDSSC/bin/" > /etc/ld.so.conf.d/opendssc.conf + should_build "opendss" "For opendss node-type" && + has_git_svn; then + git svn clone -r 4020:4020 https://svn.code.sf.net/p/electricdss/code/trunk/VersionC OpenDSS-C + mkdir -p OpenDSS-C/build + pushd OpenDSS-C + for i in ${SOURCE_DIR}/patches/*-opendssc-*.patch; do patch --strip=1 --binary <"$i"; done + popd + pushd OpenDSS-C/build + if command -v g++-14 2>&1 >/dev/null; then + # OpenDSS rev 4020 is not compatible with GCC 15 + OPENDSS_CMAKE_OPTS="-DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14" + else + OPENDSS_CMAKE_OPTS="" + fi + cmake -DMyOutputType=DLL \ + ${OPENDSS_CMAKE_OPTS} \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd + + echo "${PREFIX}/openDSSC/bin/" >/etc/ld.so.conf.d/opendssc.conf fi # Build & Install ghc::filesystem -if ! cmake --find-package -DNAME=ghc_filesystem -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST >/dev/null 2>/dev/null && \ - should_build "ghc_filesystem" "for compatability with older compilers"; then - git clone ${GIT_OPTS} --branch v1.5.14 https://github.com/gulrak/filesystem.git - mkdir -p filesystem/build - pushd filesystem/build - cmake -DGHC_FILESYSTEM_BUILD_TESTING=OFF \ - -DGHC_FILESYSTEM_BUILD_EXAMPLES=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! cmake --find-package -DNAME=ghc_filesystem -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST >/dev/null 2>/dev/null && + should_build "ghc_filesystem" "for compatability with older compilers"; then + git clone ${GIT_OPTS} --branch v1.5.14 https://github.com/gulrak/filesystem.git + mkdir -p filesystem/build + pushd filesystem/build + cmake -DGHC_FILESYSTEM_BUILD_TESTING=OFF \ + -DGHC_FILESYSTEM_BUILD_EXAMPLES=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd +fi + +# Build and install nlohmann/josn required for villas-chronics +if ! pkg-config "nlohmann_json" && + should_build "nlohman_json" "for the delta-sharing node-type"; then + git clone https://github.com/nlohmann/json.git json + mkdir -p json/build + pushd json/build + cmake .. + make ${MAKE_OPTS} install + popd +fi + +# Build and install Bzip2 required for villas-chronics +if ! pkg-config "bzip2" && + should_build "BZip2" "for create_chronics hook"; then + git clone https://github.com/libarchive/bzip2.git bzip2 + mkdir -p bzip2/build + pushd bzip2/build + cmake .. + make ${MAKE_OPTS} install + popd fi popd >/dev/null # Update linker cache if [ -z "${SKIP_LDCONFIG+x}${DEPS_SCAN+x}" ]; then - ldconfig + ldconfig fi diff --git a/packaging/docker/Dockerfile.debian b/packaging/docker/Dockerfile.debian index 631e16f86..dfa401ee8 100644 --- a/packaging/docker/Dockerfile.debian +++ b/packaging/docker/Dockerfile.debian @@ -52,7 +52,9 @@ RUN apt-get update && \ libssl-dev \ libusb-1.0-0-dev \ libzmq3-dev \ - uuid-dev + uuid-dev \ + libbz2-dev \ + nlohmann-json3-dev # Install unpackaged dependencies from source ADD packaging/patches /deps/patches diff --git a/packaging/docker/Dockerfile.debian-multiarch b/packaging/docker/Dockerfile.debian-multiarch index 6007a9efd..e57d62f89 100644 --- a/packaging/docker/Dockerfile.debian-multiarch +++ b/packaging/docker/Dockerfile.debian-multiarch @@ -58,7 +58,9 @@ RUN apt-get update && \ libssl-dev:${ARCH} \ libusb-1.0-0-dev:${ARCH} \ libzmq3-dev:${ARCH} \ - uuid-dev:${ARCH} + uuid-dev:${ARCH} \ + nlohmann-json3-dev:${ARCH} \ + libbz2:${ARCH} ADD cmake/toolchains/debian-${ARCH}.cmake / diff --git a/packaging/docker/Dockerfile.fedora b/packaging/docker/Dockerfile.fedora index 2beee634f..a68b68f80 100644 --- a/packaging/docker/Dockerfile.fedora +++ b/packaging/docker/Dockerfile.fedora @@ -64,7 +64,9 @@ RUN dnf -y install \ protobuf-c-devel \ protobuf-devel \ spdlog-devel \ - zeromq-devel + zeromq-devel \ + bzip2-devel \ + json-devel # Install unpackaged dependencies from source # TODO: We currently need to build with GCC 14 to get OpenDSSC working diff --git a/packaging/docker/Dockerfile.fedora-minimal b/packaging/docker/Dockerfile.fedora-minimal index addcd6505..4df7777c4 100644 --- a/packaging/docker/Dockerfile.fedora-minimal +++ b/packaging/docker/Dockerfile.fedora-minimal @@ -24,7 +24,10 @@ RUN dnf -y install \ jansson-devel \ spdlog-devel \ fmt-devel \ - libwebsockets-devel + libwebsockets-devel \ + bzip2-devel \ + json-devel + ENV LC_ALL=C.UTF-8 ENV LANG=C.UTF-8 diff --git a/packaging/docker/Dockerfile.rocky b/packaging/docker/Dockerfile.rocky index 384bf6d68..766ab9741 100644 --- a/packaging/docker/Dockerfile.rocky +++ b/packaging/docker/Dockerfile.rocky @@ -53,7 +53,9 @@ RUN dnf -y install \ nanomsg-devel \ libnice-devel \ libre-devel \ - libwebsockets-devel + libwebsockets-devel \ + bzip2-devel \ + json-devel # Install unpackaged dependencies from source ADD packaging/patches /deps/patches diff --git a/packaging/docker/Dockerfile.rocky9 b/packaging/docker/Dockerfile.rocky9 index f7dfffd40..b150e72cc 100644 --- a/packaging/docker/Dockerfile.rocky9 +++ b/packaging/docker/Dockerfile.rocky9 @@ -48,7 +48,9 @@ RUN dnf -y install \ lua-devel \ hiredis-devel \ libnice-devel \ - libmodbus-devel + libmodbus-devel \ + bzip2-devel \ + json-devel # Install unpackaged dependencies from source ADD packaging/patches /deps/patches diff --git a/packaging/docker/Dockerfile.ubuntu b/packaging/docker/Dockerfile.ubuntu index 5a4a0c506..bf1fa27cb 100644 --- a/packaging/docker/Dockerfile.ubuntu +++ b/packaging/docker/Dockerfile.ubuntu @@ -59,7 +59,9 @@ RUN apt-get update && \ libusb-1.0-0-dev \ libwebsockets-dev \ libzmq3-dev \ - uuid-dev + uuid-dev \ + libbz2-dev \ + nlohmann-json-dev # Install unpackaged dependencies from source ADD packaging/patches /deps/patches diff --git a/packaging/nix/villas.nix b/packaging/nix/villas.nix index 246150a67..6e1483c11 100644 --- a/packaging/nix/villas.nix +++ b/packaging/nix/villas.nix @@ -48,6 +48,8 @@ pkg-config, stdenv, system, + nlohmann_json, + bzip2, # Optional dependencies boxfort, comedilib, @@ -151,6 +153,8 @@ stdenv.mkDerivation { curl spdlog bash + nlohmann_json + bzip2 ] ++ lib.optionals withExtraTesting [ boxfort From 296dc936d6b234ebbcfd2521f027f9c979397d6b Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 13 Apr 2026 16:52:03 +0200 Subject: [PATCH 03/15] fix (ci): copy fix for ci from master Signed-off-by: Ritesh.K --- .gitlab-ci.yml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d960bf2f..d2fe774a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,24 @@ variables: DOCKER_CLI_EXPERIMENTAL: enabled CMAKE_BUILD_OPTS: "--parallel 16" CMAKE_EXTRA_OPTS: "-DCMAKE_BUILD_TYPE=Release" + CMAKE_EXTRA_OPTS_FEDORA_MINIMAL: > + -DVILLAS_COMPILE_WARNING_AS_ERROR=ON + -DWITH_API=OFF + -DWITH_CLIENTS=OFF + -DWITH_CONFIG=OFF + -DWITH_DOC=OFF + -DWITH_FPGA=OFF + -DWITH_GRAPHVIZ=OFF + -DWITH_HOOKS=OFF + -DWITH_LUA=OFF + -DWITH_OPENMP=OFF + -DWITH_PLUGINS=OFF + -DWITH_SRC=OFF + -DWITH_TESTS=OFF + -DWITH_TOOLS=OFF + -DWITH_WEB=OFF + -DCMAKE_MODULE_PATH=/usr/local/lib64/cmake + -DCMAKE_PREFIX_PATH=/usr/local CACHIX_CACHE_NAME: villas stages: @@ -106,23 +124,7 @@ build:source: -DVILLAS_COMPILE_WARNING_AS_ERROR=ON - DISTRO: fedora-minimal CMAKE_EXTRA_OPTS: > - -DVILLAS_COMPILE_WARNING_AS_ERROR=ON - -DWITH_API=OFF - -DWITH_CLIENTS=OFF - -DWITH_CONFIG=OFF - -DWITH_DOC=OFF - -DWITH_FPGA=OFF - -DWITH_GRAPHVIZ=OFF - -DWITH_HOOKS=OFF - -DWITH_LUA=OFF - -DWITH_OPENMP=OFF - -DWITH_PLUGINS=OFF - -DWITH_SRC=OFF - -DWITH_TESTS=OFF - -DWITH_TOOLS=OFF - -DWITH_WEB=OFF - -DCMAKE_MODULE_PATH=/usr/local/lib64/cmake - -DCMAKE_PREFIX_PATH=/usr/local + ${CMAKE_EXTRA_OPTS_FEDORA_MINIMAL} build:nix: <<: *nix From a186bf4a0b2db469bfd350f67ca62e7ee2cf41f7 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Tue, 14 Apr 2026 13:04:23 +0200 Subject: [PATCH 04/15] fix (villas-chronics): Fix format issues and licensing Signed-off-by: Ritesh.K --- src/villas-chronics.cpp | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/villas-chronics.cpp b/src/villas-chronics.cpp index fcc593742..5af935dd6 100644 --- a/src/villas-chronics.cpp +++ b/src/villas-chronics.cpp @@ -1,3 +1,9 @@ +/* Executable to generate chronics for OpenDSS + * + * Author: Ritesh Karki + * SPDX-FileCopyrightText: 2014-2026 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include #include @@ -13,9 +19,8 @@ #include #include -#include - #include +#include #include #include @@ -41,8 +46,8 @@ static double round_dec(double value, unsigned decimals) { } static void parse_table(const nlohmann::json &table_df, - std::unordered_map &target, - const std::string &col) { + std::unordered_map &target, + const std::string &col) { const nlohmann::json &load = table_df.at("_object").at(col); const std::string load_obj_str = load.at("_object").get(); nlohmann::json load_df = nlohmann::json::parse(load_obj_str); @@ -50,11 +55,9 @@ static void parse_table(const nlohmann::json &table_df, const auto &cols = load_df.at("columns"); auto it = std::find(cols.begin(), cols.end(), "bus"); if (it == cols.end()) { - throw std::runtime_error( - "load dataframe does not contain a 'bus' column"); + throw std::runtime_error("loaded dataframe does not contain a 'bus' column"); } - const size_t bus_col = - static_cast(std::distance(cols.begin(), it)); + const size_t bus_col = static_cast(std::distance(cols.begin(), it)); const auto &idxs = load_df.at("index"); const auto &rows = load_df.at("data"); @@ -93,8 +96,8 @@ glob_sorted(const std::filesystem::path &dir, const std::string &prefix) { } static size_t find_column_index(const std::vector &columns, - const std::string &name, - const std::filesystem::path &path) { + const std::string &name, + const std::filesystem::path &path) { auto it = std::find(columns.begin(), columns.end(), name); if (it == columns.end()) throw std::runtime_error("Column " + name + " missing in " + path.string()); @@ -153,8 +156,8 @@ load_pq_series_csv(const std::filesystem::path &path) { } static void write_csv(const std::filesystem::path &path, - const std::string &header, - const std::vector> &columns) { + const std::string &header, + const std::vector> &columns) { std::ofstream out(path); if (!out) { throw std::runtime_error("Cannot open output file: " + path.string()); @@ -338,8 +341,8 @@ class CreateChronics : public Tool { const int bus_id = it->second; const size_t col_idx = load_p_columns.size() - 1; - const std::string col_name = "load_" + std::to_string(bus_id) + "_" + - std::to_string(col_idx); + const std::string col_name = + "load_" + std::to_string(bus_id) + "_" + std::to_string(col_idx); if (!load_col_names.empty()) load_col_names += ';'; @@ -352,16 +355,16 @@ class CreateChronics : public Tool { const int element_index = extract_file_number(file); auto it = mapping.sgen_bus.find(element_index); if (it == mapping.sgen_bus.end()) - throw std::runtime_error( - "SGen index missing in grid mapping: " + - std::to_string(element_index)); + throw std::runtime_error("SGen index missing in grid mapping: " + + std::to_string(element_index)); const auto [p_norm, q_norm] = load_pq_series_csv(file); const int bus_id = it->second; prod_p_columns.push_back(p_norm); prod_q_columns.push_back(q_norm); - prod_v_columns.push_back(std::vector(p_norm.size(), options.voltage)); + prod_v_columns.push_back( + std::vector(p_norm.size(), options.voltage)); const std::string col_name = "sgen_" + std::to_string(bus_id) + "_" + std::to_string(sgen_idx); @@ -374,7 +377,7 @@ class CreateChronics : public Tool { } void round_values() { - for (auto &col : load_p_columns) + for (auto &col : load_p_columns) for (double &v : col) v = round_dec(v, options.round_decimals); From 773d12ab158286f1c8506250a5aedcab5d98c255 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Tue, 14 Apr 2026 13:05:50 +0200 Subject: [PATCH 05/15] fix (villas-chronics): Fix typo in nlohmann/json package name Signed-off-by: Ritesh.K --- packaging/docker/Dockerfile.ubuntu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/docker/Dockerfile.ubuntu b/packaging/docker/Dockerfile.ubuntu index bf1fa27cb..8fb1796ba 100644 --- a/packaging/docker/Dockerfile.ubuntu +++ b/packaging/docker/Dockerfile.ubuntu @@ -61,7 +61,7 @@ RUN apt-get update && \ libzmq3-dev \ uuid-dev \ libbz2-dev \ - nlohmann-json-dev + nlohmann-json3-dev # Install unpackaged dependencies from source ADD packaging/patches /deps/patches From 924d2d9e3475ff3efe28d65d73e279b0cfe513cc Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Tue, 14 Apr 2026 14:11:57 +0200 Subject: [PATCH 06/15] fix (villas-chronics): Fix formatting Signed-off-by: Ritesh.K --- src/villas-chronics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/villas-chronics.cpp b/src/villas-chronics.cpp index 5af935dd6..8732ced3b 100644 --- a/src/villas-chronics.cpp +++ b/src/villas-chronics.cpp @@ -55,7 +55,8 @@ static void parse_table(const nlohmann::json &table_df, const auto &cols = load_df.at("columns"); auto it = std::find(cols.begin(), cols.end(), "bus"); if (it == cols.end()) { - throw std::runtime_error("loaded dataframe does not contain a 'bus' column"); + throw std::runtime_error( + "loaded dataframe does not contain a 'bus' column"); } const size_t bus_col = static_cast(std::distance(cols.begin(), it)); From cc9cb63b551bf463d6a27937bcb64bf792c13aa1 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Tue, 14 Apr 2026 14:13:10 +0200 Subject: [PATCH 07/15] fix (villas-chronics): Fix nlohmann/json package name for debian multiarch dockerfile Signed-off-by: Ritesh.K --- packaging/docker/Dockerfile.debian-multiarch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/docker/Dockerfile.debian-multiarch b/packaging/docker/Dockerfile.debian-multiarch index e57d62f89..036c92dfa 100644 --- a/packaging/docker/Dockerfile.debian-multiarch +++ b/packaging/docker/Dockerfile.debian-multiarch @@ -58,9 +58,7 @@ RUN apt-get update && \ libssl-dev:${ARCH} \ libusb-1.0-0-dev:${ARCH} \ libzmq3-dev:${ARCH} \ - uuid-dev:${ARCH} \ - nlohmann-json3-dev:${ARCH} \ - libbz2:${ARCH} + uuid-dev:${ARCH} ADD cmake/toolchains/debian-${ARCH}.cmake / @@ -151,7 +149,9 @@ RUN apt-get update && \ libusb-1.0-0:${ARCH} \ liblua5.3-0:${ARCH} \ libhiredis0.14:${ARCH} \ - libmodbus5:${ARCH} && \ + libmodbus5:${ARCH} \ + nlohmann-json3-dev:${ARCH} \ + libbz2-dev:${ARCH} && \ rm -rf /var/lib/apt/lists/* COPY --from=builder ${PREFIX} ${PREFIX} From e4f9fc9356f994182f387b1591534f5c084493ab Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Tue, 14 Apr 2026 15:57:30 +0200 Subject: [PATCH 08/15] feat (villas-chronics): Add bzip2 compressing to executable villas-chronics Signed-off-by: Ritesh.K --- src/CMakeLists.txt | 2 +- src/villas-chronics.cpp | 99 +++++++++++++++++++++++++++++++++-------- 2 files changed, 81 insertions(+), 20 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8ecd32e9e..91197844b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -77,7 +77,7 @@ endif() if(WITH_VILLAS_CHRONICS) add_executable(villas-chronics villas-chronics.cpp) - target_link_libraries(villas-chronics PUBLIC villas) + target_link_libraries(villas-chronics PUBLIC villas PkgConfig::BZIP2) list(APPEND SRCS villas-chronics) endif() diff --git a/src/villas-chronics.cpp b/src/villas-chronics.cpp index 8732ced3b..fc91254ab 100644 --- a/src/villas-chronics.cpp +++ b/src/villas-chronics.cpp @@ -1,9 +1,3 @@ -/* Executable to generate chronics for OpenDSS - * - * Author: Ritesh Karki - * SPDX-FileCopyrightText: 2014-2026 Institute for Automation of Complex Power Systems, RWTH Aachen University - * SPDX-License-Identifier: Apache-2.0 - */ #include #include #include @@ -19,6 +13,7 @@ #include #include +#include #include #include @@ -55,8 +50,7 @@ static void parse_table(const nlohmann::json &table_df, const auto &cols = load_df.at("columns"); auto it = std::find(cols.begin(), cols.end(), "bus"); if (it == cols.end()) { - throw std::runtime_error( - "loaded dataframe does not contain a 'bus' column"); + throw std::runtime_error("load dataframe does not contain a 'bus' column"); } const size_t bus_col = static_cast(std::distance(cols.begin(), it)); @@ -177,6 +171,59 @@ static void write_csv(const std::filesystem::path &path, } } +static void bz2_write_all(BZFILE *bzf, const std::string &s) { + int err = BZ_OK; + BZ2_bzWrite(&err, bzf, const_cast(s.data()), + static_cast(s.size())); + if (err != BZ_OK) + throw std::runtime_error("BZ2_bzWrite failed"); +} + +static void write_bz2(const std::filesystem::path &path, + const std::string &header, + const std::vector> &columns) { + FILE *fp = std::fopen(path.string().c_str(), "wb"); + if (!fp) + throw std::runtime_error("Cannot open output file: " + path.string()); + + int err = BZ_OK; + BZFILE *bzf = BZ2_bzWriteOpen(&err, fp, 9, 0, 30); + if (!bzf || err != BZ_OK) { + std::fclose(fp); + throw std::runtime_error("BZ2_bzWriteOpen failed"); + } + + try { + bz2_write_all(bzf, header); + bz2_write_all(bzf, "\n"); + + const size_t rows = columns.empty() ? 0 : columns.front().size(); + for (size_t r = 0; r < rows; ++r) { + std::ostringstream line; + for (size_t c = 0; c < columns.size(); ++c) { + if (c) + line << ';'; + line << columns[c][r]; + } + line << '\n'; + bz2_write_all(bzf, line.str()); + } + + unsigned int nbytes_in = 0, nbytes_out = 0; + BZ2_bzWriteClose(&err, bzf, 0, &nbytes_in, &nbytes_out); + bzf = nullptr; + std::fclose(fp); + if (err != BZ_OK) + throw std::runtime_error("BZ2_bzWriteClose failed"); + } catch (...) { + int dummy = BZ_OK; + if (bzf) + BZ2_bzWriteClose(&dummy, bzf, 1, nullptr, nullptr); + std::fclose(fp); + throw; + } +} + class CreateChronics : public Tool { public: CreateChronics(int argc, char *argv[]) : Tool(argc, argv, "chronics") {} @@ -390,17 +437,31 @@ class CreateChronics : public Tool { void write_outputs() { std::filesystem::create_directories(options.output_dir); - write_csv(options.output_dir / "load_p.csv", load_col_names, - load_p_columns); - write_csv(options.output_dir / "load_q.csv", load_col_names, - load_q_columns); - - write_csv(options.output_dir / "prod_p.csv", sgen_col_names, - prod_p_columns); - write_csv(options.output_dir / "prod_q.csv", sgen_col_names, - prod_q_columns); - write_csv(options.output_dir / "prod_v.csv", sgen_col_names, - prod_v_columns); + if (!options.compress) { + write_csv(options.output_dir / "load_p.csv", load_col_names, + load_p_columns); + write_csv(options.output_dir / "load_q.csv", load_col_names, + load_q_columns); + + write_csv(options.output_dir / "prod_p.csv", sgen_col_names, + prod_p_columns); + write_csv(options.output_dir / "prod_q.csv", sgen_col_names, + prod_q_columns); + write_csv(options.output_dir / "prod_v.csv", sgen_col_names, + prod_v_columns); + } else { + write_bz2(options.output_dir / "load_p.csv.bz2", load_col_names, + load_p_columns); + write_bz2(options.output_dir / "load_q.csv.bz2", load_col_names, + load_q_columns); + + write_bz2(options.output_dir / "prod_p.csv.bz2", sgen_col_names, + prod_p_columns); + write_bz2(options.output_dir / "prod_q.csv.bz2", sgen_col_names, + prod_q_columns); + write_bz2(options.output_dir / "prod_v.csv.bz2", sgen_col_names, + prod_v_columns); + } } }; From 17bf119e297df54c1ac22d874a8c38778c1d788f Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Tue, 14 Apr 2026 20:16:19 +0200 Subject: [PATCH 09/15] fix (villas-chronics): Fix nlohmann/json package installation for debian-multiarch dockerfile Signed-off-by: Ritesh.K --- packaging/docker/Dockerfile.debian-multiarch | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packaging/docker/Dockerfile.debian-multiarch b/packaging/docker/Dockerfile.debian-multiarch index 036c92dfa..e311a646d 100644 --- a/packaging/docker/Dockerfile.debian-multiarch +++ b/packaging/docker/Dockerfile.debian-multiarch @@ -149,9 +149,12 @@ RUN apt-get update && \ libusb-1.0-0:${ARCH} \ liblua5.3-0:${ARCH} \ libhiredis0.14:${ARCH} \ - libmodbus5:${ARCH} \ - nlohmann-json3-dev:${ARCH} \ - libbz2-dev:${ARCH} && \ + libmodbus5:${ARCH} && \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update && apt-get install -y \ + libbz2-dev \ + nlohmann-json3-dev && \ rm -rf /var/lib/apt/lists/* COPY --from=builder ${PREFIX} ${PREFIX} From 7c473d66752903cc73b7bb891fb2df24520011a0 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Tue, 14 Apr 2026 22:38:59 +0200 Subject: [PATCH 10/15] fix (villas-chronics): Fix reuse license Signed-off-by: Ritesh.K --- src/villas-chronics.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/villas-chronics.cpp b/src/villas-chronics.cpp index fc91254ab..2a0e1232d 100644 --- a/src/villas-chronics.cpp +++ b/src/villas-chronics.cpp @@ -1,3 +1,10 @@ +/* Create chronics files for OpenDSS + * + * Author: Ritesh Karki + * SPDX-FileCopyrightText: 2014-2026 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ + #include #include #include From 62e7f59237633499fde9044dd96b5474d417138d Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Fri, 17 Apr 2026 16:28:46 +0200 Subject: [PATCH 11/15] fix (villas-chronics): Fix deps.sh formatting Signed-off-by: Ritesh.K --- packaging/deps.sh | 894 +++++++++++++++++++++++----------------------- 1 file changed, 448 insertions(+), 446 deletions(-) diff --git a/packaging/deps.sh b/packaging/deps.sh index 69720f3e9..cd6be1d63 100644 --- a/packaging/deps.sh +++ b/packaging/deps.sh @@ -15,70 +15,71 @@ set -u set -o pipefail should_build() { - local id="$1" - local use="$2" - local requirement="${3:-optional}" - - case "${requirement}" in - optional) ;; - required) ;; - *) - echo >&2 "Error: invalid parameter '$2' for should_build. should be one of 'optional' and 'required', default is 'optional'" - exit 1 - ;; - esac - - local deps="${@:4}" - - if [[ -n "${DEPS_SCAN+x}" ]]; then - echo "${requirement} dependendency ${id} should be installed ${use}." - [[ -n "${deps[*]}" ]] && echo " transitive dependencies: ${deps}" - echo - return 1 - fi - - if { [[ "${DEPS_SKIP:-}" == *"${id}"* ]] || { [[ -n "${DEPS_INCLUDE+x}" ]] && [[ ! "${DEPS_INCLUDE}" == *"${id}"* ]]; }; }; then - echo "Skipping ${requirement} dependency '${id}'" - return 1 - fi - - if [[ -z "${DEPS_NONINTERACTIVE+x}" ]] && [[ -t 1 ]]; then - echo - read -p "Do you wan't to install '${id}' into '${PREFIX}'? This is used ${use}. (y/N) " - case "${REPLY}" in - y | Y) - echo "Installing '${id}'" - return 0 - ;; - - *) - echo "Skipping '${id}'" - return 1 - ;; - esac - fi - - return 0 + local id="$1" + local use="$2" + local requirement="${3:-optional}" + + case "${requirement}" in + optional) ;; + required) ;; + *) + echo >&2 "Error: invalid parameter '$2' for should_build. should be one of 'optional' and 'required', default is 'optional'" + exit 1 + ;; + esac + + local deps="${@:4}" + + if [[ -n "${DEPS_SCAN+x}" ]]; then + echo "${requirement} dependendency ${id} should be installed ${use}." + [[ -n "${deps[*]}" ]] && echo " transitive dependencies: ${deps}" + echo + return 1 + fi + + if { [[ "${DEPS_SKIP:-}" == *"${id}"* ]] || { [[ -n "${DEPS_INCLUDE+x}" ]] && [[ ! "${DEPS_INCLUDE}" == *"${id}"* ]]; }; } + then + echo "Skipping ${requirement} dependency '${id}'" + return 1 + fi + + if [[ -z "${DEPS_NONINTERACTIVE+x}" ]] && [[ -t 1 ]]; then + echo + read -p "Do you wan't to install '${id}' into '${PREFIX}'? This is used ${use}. (y/N) " + case "${REPLY}" in + y | Y) + echo "Installing '${id}'" + return 0 + ;; + + *) + echo "Skipping '${id}'" + return 1 + ;; + esac + fi + + return 0 } has_command() { - command -v "$1" >/dev/null 2>&1 + command -v "$1" >/dev/null 2>&1 } has_git_svn() { - git svn --version >/dev/null 2>&1 + git svn --version > /dev/null 2>&1 } check_cmake_version() { - local cmake_version - cmake_version=$(cmake --version | head -n1 | awk '{print $3}') - local required_version=$1 - - if [ "$(printf '%s\n%s\n' "$required_version" "$cmake_version" | sort -V | head -n1)" = "$required_version" ]; then - return 0 - else - return 1 - fi + local cmake_version + cmake_version=$(cmake --version | head -n1 | awk '{print $3}') + local required_version=$1 + + if [ "$(printf '%s\n%s\n' "$required_version" "$cmake_version" | sort -V | head -n1)" = "$required_version" ]; then + return 0 + else + return 1 + fi } ## Build configuration @@ -89,11 +90,11 @@ GIT_OPTS+=" --depth=1 --recurse-submodules --shallow-submodules --config advice. # Install destination PREFIX=${PREFIX:-/usr/local} if [[ "${PREFIX}" == "/usr/local" ]]; then - PIP_PREFIX="$(pwd)/venv" - PATH="${PIP_PREFIX}/bin:${PREFIX}/bin:${PATH}" + PIP_PREFIX="$(pwd)/venv" + PATH="${PIP_PREFIX}/bin:${PREFIX}/bin:${PATH}" else - PIP_PREFIX="${PREFIX}" - PATH="${PREFIX}/bin:${PATH}" + PIP_PREFIX="${PREFIX}" + PATH="${PREFIX}/bin:${PATH}" fi # Cross-compile @@ -128,8 +129,8 @@ pushd ${TMPDIR} >/dev/null # Check for pkg-config if ! has_command pkg-config; then - echo -e "Error: pkg-config is required to check for existing dependencies." - exit 1 + echo -e "Error: pkg-config is required to check for existing dependencies." + exit 1 fi # Enter python venv @@ -138,497 +139,498 @@ python3 -m venv ${PIP_PREFIX} # Install some build-tools python3 -m pip install \ - --prefix=${PIP_PREFIX} \ - --upgrade \ - pip==25.3 \ - setuptools + --prefix=${PIP_PREFIX} \ + --upgrade \ + pip==25.3 \ + setuptools \ python3 -m pip install \ - --prefix=${PIP_PREFIX} \ - cmake==3.31.6 \ - meson==1.9.1 \ - ninja==1.11.1.4 + --prefix=${PIP_PREFIX} \ + cmake==3.31.6 \ + meson==1.9.1 \ + ninja==1.11.1.4 # Build & Install Criterion -if ! pkg-config "criterion >= 2.4.1" && - [ "${ARCH}" == "x86_64" ] && - should_build "criterion" "for unit tests"; then - git clone ${GIT_OPTS} --branch v2.4.3 --recursive https://github.com/Snaipe/Criterion.git - pushd Criterion +if ! pkg-config "criterion >= 2.4.1" && \ + [ "${ARCH}" == "x86_64" ] && \ + should_build "criterion" "for unit tests"; then + git clone ${GIT_OPTS} --branch v2.4.3 --recursive https://github.com/Snaipe/Criterion.git + pushd Criterion - meson setup \ - --prefix=${PREFIX} \ - --cmake-prefix-path=${PREFIX} \ - --backend=ninja \ - build - meson compile -C build - meson install -C build + meson setup \ + --prefix=${PREFIX} \ + --cmake-prefix-path=${PREFIX} \ + --backend=ninja \ + build + meson compile -C build + meson install -C build - popd + popd fi # Build & Install jansson -if ! pkg-config "jansson >= 2.13" && - should_build "jansson" "for configuration parsing" "required"; then - git clone ${GIT_OPTS} --branch v2.14.1 https://github.com/akheron/jansson.git - mkdir -p jansson/build - pushd jansson/build - cmake -DJANSSON_BUILD_SHARED_LIBS=ON \ - -DJANSSON_BUILD_STATIC_LIBS=OFF \ - -DJANSSON_WITHOUT_TESTS=ON \ - -DJANSSON_EXAMPLES=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "jansson >= 2.13" && \ + should_build "jansson" "for configuration parsing" "required"; then + git clone ${GIT_OPTS} --branch v2.14.1 https://github.com/akheron/jansson.git + mkdir -p jansson/build + pushd jansson/build + cmake -DJANSSON_BUILD_SHARED_LIBS=ON \ + -DJANSSON_BUILD_STATIC_LIBS=OFF \ + -DJANSSON_WITHOUT_TESTS=ON \ + -DJANSSON_EXAMPLES=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install Lua -if ! ( - pkg-config "lua >= 5.1" || - pkg-config "lua54" || - pkg-config "lua53" || - pkg-config "lua52" || - pkg-config "lua51" || - { [[ -n "${RTLAB_ROOT:+x}" ]] && [[ -f "/usr/local/include/lua.h" ]]; } -) && should_build "lua" "for the lua hook"; then - curl -L http://www.lua.org/ftp/lua-5.4.7.tar.gz | tar -xz - pushd lua-5.4.7 - make ${MAKE_OPTS} MYCFLAGS=-fPIC linux - make ${MAKE_OPTS} MYCFLAGS=-fPIC INSTALL_TOP=${PREFIX} install - popd +if ! ( pkg-config "lua >= 5.1" || \ + pkg-config "lua54" || \ + pkg-config "lua53" || \ + pkg-config "lua52" || \ + pkg-config "lua51" || \ + { [[ -n "${RTLAB_ROOT:+x}" ]] && [[ -f "/usr/local/include/lua.h" ]]; } \ + ) && should_build "lua" "for the lua hook"; then + curl -L http://www.lua.org/ftp/lua-5.4.7.tar.gz | tar -xz + pushd lua-5.4.7 + make ${MAKE_OPTS} MYCFLAGS=-fPIC linux + make ${MAKE_OPTS} MYCFLAGS=-fPIC INSTALL_TOP=${PREFIX} install + popd fi # Build & Install mosquitto -if ! pkg-config "libmosquitto >= 1.4.15" && - should_build "mosquitto" "for the mqtt node-type"; then - git clone ${GIT_OPTS} --branch v2.0.22 https://github.com/eclipse/mosquitto.git - mkdir -p mosquitto/build - pushd mosquitto/build - cmake -DWITH_BROKER=OFF \ - -DWITH_CLIENTS=OFF \ - -DWITH_APPS=OFF \ - -DDOCUMENTATION=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libmosquitto >= 1.4.15" && \ + should_build "mosquitto" "for the mqtt node-type"; then + git clone ${GIT_OPTS} --branch v2.0.22 https://github.com/eclipse/mosquitto.git + mkdir -p mosquitto/build + pushd mosquitto/build + cmake -DWITH_BROKER=OFF \ + -DWITH_CLIENTS=OFF \ + -DWITH_APPS=OFF \ + -DDOCUMENTATION=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install rabbitmq-c -if ! pkg-config "librabbitmq >= 0.13.0" && - should_build "rabbitmq" "for the amqp node-node and VILLAScontroller"; then - git clone ${GIT_OPTS} --branch v0.15.0 https://github.com/alanxz/rabbitmq-c.git - mkdir -p rabbitmq-c/build - pushd rabbitmq-c/build - cmake ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "librabbitmq >= 0.13.0" && \ + should_build "rabbitmq" "for the amqp node-node and VILLAScontroller"; then + git clone ${GIT_OPTS} --branch v0.15.0 https://github.com/alanxz/rabbitmq-c.git + mkdir -p rabbitmq-c/build + pushd rabbitmq-c/build + cmake ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libzmq -if ! pkg-config "libzmq >= 2.2.0" && - should_build "zmq" "for the zeromq node-type"; then - git clone ${GIT_OPTS} --branch v4.3.5 https://github.com/zeromq/libzmq.git - mkdir -p libzmq/build - pushd libzmq/build - cmake -DWITH_PERF_TOOL=OFF \ - -DZMQ_BUILD_TESTS=OFF \ - -DENABLE_CPACK=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libzmq >= 2.2.0" && \ + should_build "zmq" "for the zeromq node-type"; then + git clone ${GIT_OPTS} --branch v4.3.5 https://github.com/zeromq/libzmq.git + mkdir -p libzmq/build + pushd libzmq/build + cmake -DWITH_PERF_TOOL=OFF \ + -DZMQ_BUILD_TESTS=OFF \ + -DENABLE_CPACK=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install EtherLab -if ! pkg-config "libethercat >= 1.5.2" && - should_build "ethercat" "for the ethercat node-type"; then - git clone ${GIT_OPTS} --branch 1.6.8 https://gitlab.com/etherlab.org/ethercat.git - pushd ethercat - ./bootstrap - ./configure --enable-userlib=yes --enable-kernel=no ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! pkg-config "libethercat >= 1.5.2" && \ + should_build "ethercat" "for the ethercat node-type"; then + git clone ${GIT_OPTS} --branch 1.6.8 https://gitlab.com/etherlab.org/ethercat.git + pushd ethercat + ./bootstrap + ./configure --enable-userlib=yes --enable-kernel=no ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install libiec61850 -if ! pkg-config "libiec61850 >= 1.6.0" && - should_build "iec61850" "for the iec61850 node-type"; then - git clone ${GIT_OPTS} --branch v1.6.1 https://github.com/mz-automation/libiec61850.git +if ! pkg-config "libiec61850 >= 1.6.0" && \ + should_build "iec61850" "for the iec61850 node-type"; then + git clone ${GIT_OPTS} --branch v1.6.1 https://github.com/mz-automation/libiec61850.git - pushd libiec61850/third_party/mbedtls/ - curl -L https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.6.0.tar.gz | tar -xz - popd + pushd libiec61850/third_party/mbedtls/ + curl -L https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.6.0.tar.gz | tar -xz + popd - mkdir -p libiec61850/build - pushd libiec61850/build - cmake -DBUILD_EXAMPLES=OFF \ - -DBUILD_PYTHON_BINDINGS=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd + mkdir -p libiec61850/build + pushd libiec61850/build + cmake -DBUILD_EXAMPLES=OFF \ + -DBUILD_PYTHON_BINDINGS=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install lib60870 -if ! pkg-config "lib60870 >= 2.3.1" && - should_build "iec60870" "for the iec60870 node-type"; then - git clone ${GIT_OPTS} --branch v2.3.6 https://github.com/mz-automation/lib60870.git - mkdir -p lib60870/build - pushd lib60870/build - cmake -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF \ - ${CMAKE_OPTS} ../lib60870-C - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "lib60870 >= 2.3.1" && \ + should_build "iec60870" "for the iec60870 node-type"; then + git clone ${GIT_OPTS} --branch v2.3.6 https://github.com/mz-automation/lib60870.git + mkdir -p lib60870/build + pushd lib60870/build + cmake -DBUILD_EXAMPLES=OFF \ + -DBUILD_TESTS=OFF \ + ${CMAKE_OPTS} ../lib60870-C + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install librdkafka -if ! pkg-config "rdkafka >= 1.5.0" && - should_build "rdkafka" "for the kafka node-type"; then - git clone ${GIT_OPTS} --branch v2.12.1 https://github.com/edenhill/librdkafka.git - mkdir -p librdkafka/build - pushd librdkafka/build - cmake -DRDKAFKA_BUILD_TESTS=OFF \ - -DRDKAFKA_BUILD_EXAMPLES=OFF \ - -DWITH_CURL=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "rdkafka >= 1.5.0" && \ + should_build "rdkafka" "for the kafka node-type"; then + git clone ${GIT_OPTS} --branch v2.12.1 https://github.com/edenhill/librdkafka.git + mkdir -p librdkafka/build + pushd librdkafka/build + cmake -DRDKAFKA_BUILD_TESTS=OFF \ + -DRDKAFKA_BUILD_EXAMPLES=OFF \ + -DWITH_CURL=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install Graphviz -if ! ( - pkg-config "libcgraph >= 2.30" && - pkg-config "libgvc >= 2.30" -) && should_build "graphviz" "for villas-graph"; then - curl -L https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/14.0.2/graphviz-14.0.2.tar.gz | tar -xz - mkdir -p graphviz-14.0.2 - pushd graphviz-14.0.2 - ./configure --enable-shared ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! ( pkg-config "libcgraph >= 2.30" && \ + pkg-config "libgvc >= 2.30" \ + ) && should_build "graphviz" "for villas-graph"; then + curl -L https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/14.0.2/graphviz-14.0.2.tar.gz | tar -xz + mkdir -p graphviz-14.0.2 + pushd graphviz-14.0.2 + ./configure --enable-shared ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install uldaq -if ! pkg-config "libuldaq >= 1.2.0" && - should_build "uldaq" "for the uldaq node-type"; then - git clone ${GIT_OPTS} --branch v1.2.1 https://github.com/mccdaq/uldaq.git - pushd uldaq - autoreconf -i - ./configure \ - --disable-examples \ - ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! pkg-config "libuldaq >= 1.2.0" && \ + should_build "uldaq" "for the uldaq node-type"; then + git clone ${GIT_OPTS} --branch v1.2.1 https://github.com/mccdaq/uldaq.git + pushd uldaq + autoreconf -i + ./configure \ + --disable-examples \ + ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install libnl -if ! ( - pkg-config "libnl-3.0 >= 3.2.25" && - pkg-config "libnl-route-3.0 >= 3.2.25" -) && should_build "libnl" "for network emulation"; then - git clone ${GIT_OPTS} --branch libnl3_11_0 https://github.com/thom311/libnl.git - pushd libnl - autoreconf -i - ./configure \ - --enable-cli=no \ - ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! ( pkg-config "libnl-3.0 >= 3.2.25" && \ + pkg-config "libnl-route-3.0 >= 3.2.25" \ + ) && should_build "libnl" "for network emulation"; then + git clone ${GIT_OPTS} --branch libnl3_11_0 https://github.com/thom311/libnl.git + pushd libnl + autoreconf -i + ./configure \ + --enable-cli=no \ + ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install libconfig -if ! pkg-config "libconfig >= 1.4.9" && - should_build "libconfig" "for libconfig configuration syntax"; then - git clone ${GIT_OPTS} --branch v1.8.1 https://github.com/hyperrealm/libconfig.git - mkdir -p libconfig/build - pushd libconfig/build - cmake -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF \ - -DBUILD_CXX=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libconfig >= 1.4.9" && \ + should_build "libconfig" "for libconfig configuration syntax"; then + git clone ${GIT_OPTS} --branch v1.8.1 https://github.com/hyperrealm/libconfig.git + mkdir -p libconfig/build + pushd libconfig/build + cmake -DBUILD_EXAMPLES=OFF \ + -DBUILD_TESTS=OFF \ + -DBUILD_CXX=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install comedilib -if ! pkg-config "comedilib >= 0.11.0" && - should_build "comedi" "for the comedi node-type"; then - git clone ${GIT_OPTS} --branch r0_12_0 https://github.com/Linux-Comedi/comedilib.git - pushd comedilib - ./autogen.sh - ./configure \ - --disable-docbook \ - ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! pkg-config "comedilib >= 0.11.0" && \ + should_build "comedi" "for the comedi node-type"; then + git clone ${GIT_OPTS} --branch r0_12_0 https://github.com/Linux-Comedi/comedilib.git + pushd comedilib + ./autogen.sh + ./configure \ + --disable-docbook \ + ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install libre -if ! pkg-config "libre >= 3.6.0" && - should_build "libre" "for the rtp node-type"; then - git clone ${GIT_OPTS} --branch v4.2.0 https://github.com/baresip/re.git - mkdir -p re/build - pushd re/build - cmake -DUSE_BFCP=OFF \ - -DUSE_PCP=OFF \ - -DUSE_RTMP=OFF \ - -DUSE_SIP=OFF \ - -DLIBRE_BUILD_STATIC=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libre >= 3.6.0" && \ + should_build "libre" "for the rtp node-type"; then + git clone ${GIT_OPTS} --branch v4.2.0 https://github.com/baresip/re.git + mkdir -p re/build + pushd re/build + cmake -DUSE_BFCP=OFF \ + -DUSE_PCP=OFF \ + -DUSE_RTMP=OFF \ + -DUSE_SIP=OFF \ + -DLIBRE_BUILD_STATIC=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install nanomsg -if ! pkg-config "nanomsg >= 1.0.0" && - should_build "nanomsg" "for the nanomsg node-type"; then - # TODO: v1.2.1 seems to be broken: https://github.com/nanomsg/nanomsg/issues/1111 - git clone ${GIT_OPTS} --branch 1.2.2 https://github.com/nanomsg/nanomsg.git - mkdir -p nanomsg/build - pushd nanomsg/build - cmake -DNN_TESTS=OFF \ - -DNN_TOOLS=OFF \ - -DNN_STATIC_LIB=OFF \ - -DNN_ENABLE_DOC=OFF \ - -DNN_ENABLE_COVERAGE=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "nanomsg >= 1.0.0" && \ + should_build "nanomsg" "for the nanomsg node-type"; then + # TODO: v1.2.1 seems to be broken: https://github.com/nanomsg/nanomsg/issues/1111 + git clone ${GIT_OPTS} --branch 1.2.2 https://github.com/nanomsg/nanomsg.git + mkdir -p nanomsg/build + pushd nanomsg/build + cmake -DNN_TESTS=OFF \ + -DNN_TOOLS=OFF \ + -DNN_STATIC_LIB=OFF \ + -DNN_ENABLE_DOC=OFF \ + -DNN_ENABLE_COVERAGE=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libxil -if ! pkg-config "libxil >= 1.0.0" && - should_build "libxil" "for the fpga node-type"; then - git clone ${GIT_OPTS} --branch master https://github.com/VILLASframework/libxil.git - mkdir -p libxil/build - pushd libxil/build - cmake ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libxil >= 1.0.0" && \ + should_build "libxil" "for the fpga node-type"; then + git clone ${GIT_OPTS} --branch master https://github.com/VILLASframework/libxil.git + mkdir -p libxil/build + pushd libxil/build + cmake ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install hiredis -if ! pkg-config "hiredis >= 1.0.0" && - should_build "hiredis" "for the redis node-type"; then - git clone ${GIT_OPTS} --branch v1.3.0 https://github.com/redis/hiredis.git - mkdir -p hiredis/build - pushd hiredis/build - cmake -DDISABLE_TESTS=ON \ - -DENABLE_SSL=ON \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "hiredis >= 1.0.0" && \ + should_build "hiredis" "for the redis node-type"; then + git clone ${GIT_OPTS} --branch v1.3.0 https://github.com/redis/hiredis.git + mkdir -p hiredis/build + pushd hiredis/build + cmake -DDISABLE_TESTS=ON \ + -DENABLE_SSL=ON \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install redis++ -if ! pkg-config "redis++ >= 1.2.3" && - should_build "redis++" "for the redis node-type"; then - git clone ${GIT_OPTS} --branch 1.3.15 https://github.com/sewenew/redis-plus-plus.git - mkdir -p redis-plus-plus/build - pushd redis-plus-plus/build +if ! pkg-config "redis++ >= 1.2.3" && \ + should_build "redis++" "for the redis node-type"; then + git clone ${GIT_OPTS} --branch 1.3.15 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${PREFIX}/include" + # Somehow redis++ fails to find the hiredis include path on Debian multiarch builds + REDISPP_CMAKE_OPTS+="-DCMAKE_CXX_FLAGS=-I${PREFIX}/include" - cmake -DREDIS_PLUS_PLUS_BUILD_TEST=OFF \ - -DREDIS_PLUS_PLUS_BUILD_STATIC=OFF \ - -DREDIS_PLUS_PLUS_CXX_STANDARD=17 \ - ${REDISPP_CMAKE_OPTS} ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd + cmake -DREDIS_PLUS_PLUS_BUILD_TEST=OFF \ + -DREDIS_PLUS_PLUS_BUILD_STATIC=OFF \ + -DREDIS_PLUS_PLUS_CXX_STANDARD=17 \ + ${REDISPP_CMAKE_OPTS} ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install Fmtlib -if ! pkg-config "fmt >= 6.1.2" && - should_build "fmt" "for logging" "required"; then - git clone ${GIT_OPTS} --branch 12.1.0 --recursive https://github.com/fmtlib/fmt.git - mkdir -p fmt/build - pushd fmt/build - cmake -DBUILD_SHARED_LIBS=1 \ - -DFMT_TEST=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "fmt >= 6.1.2" && \ + should_build "fmt" "for logging" "required"; then + git clone ${GIT_OPTS} --branch 12.1.0 --recursive https://github.com/fmtlib/fmt.git + mkdir -p fmt/build + pushd fmt/build + cmake -DBUILD_SHARED_LIBS=1 \ + -DFMT_TEST=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install spdlog -if ! pkg-config "spdlog >= 1.8.2" && - should_build "spdlog" "for logging" "required"; then - git clone ${GIT_OPTS} --branch v1.16.0 --recursive https://github.com/gabime/spdlog.git - mkdir -p spdlog/build - pushd spdlog/build - cmake -DSPDLOG_FMT_EXTERNAL=ON \ - -DSPDLOG_BUILD_BENCH=OFF \ - -DSPDLOG_BUILD_SHARED=ON \ - -DSPDLOG_BUILD_TESTS=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "spdlog >= 1.8.2" && \ + should_build "spdlog" "for logging" "required"; then + git clone ${GIT_OPTS} --branch v1.16.0 --recursive https://github.com/gabime/spdlog.git + mkdir -p spdlog/build + pushd spdlog/build + cmake -DSPDLOG_FMT_EXTERNAL=ON \ + -DSPDLOG_BUILD_BENCH=OFF \ + -DSPDLOG_BUILD_SHARED=ON \ + -DSPDLOG_BUILD_TESTS=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libwebsockets -if ! pkg-config "libwebsockets >= 4.3.0" && - should_build "libwebsockets" "for the websocket node and VILLASweb" "required"; then - git clone ${GIT_OPTS} --branch v4.3.6 https://github.com/warmcat/libwebsockets.git - mkdir -p libwebsockets/build - pushd libwebsockets/build - cmake -DLWS_WITH_IPV6=ON \ - -DLWS_WITHOUT_TESTAPPS=ON \ - -DLWS_WITHOUT_EXTENSIONS=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! pkg-config "libwebsockets >= 4.3.0" && \ + should_build "libwebsockets" "for the websocket node and VILLASweb" "required"; then + git clone ${GIT_OPTS} --branch v4.3.6 https://github.com/warmcat/libwebsockets.git + mkdir -p libwebsockets/build + pushd libwebsockets/build + cmake -DLWS_WITH_IPV6=ON \ + -DLWS_WITHOUT_TESTAPPS=ON \ + -DLWS_WITHOUT_EXTENSIONS=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libnice -if ! pkg-config "nice >= 0.1.16" && - should_build "libnice" "for the webrtc node-type"; then - git clone ${GIT_OPTS} --branch 0.1.22 https://gitlab.freedesktop.org/libnice/libnice.git - mkdir -p libnice/build - pushd libnice +if ! pkg-config "nice >= 0.1.16" && \ + should_build "libnice" "for the webrtc node-type"; then + git clone ${GIT_OPTS} --branch 0.1.22 https://gitlab.freedesktop.org/libnice/libnice.git + mkdir -p libnice/build + pushd libnice - meson setup \ - --prefix=${PREFIX} \ - --cmake-prefix-path=${PREFIX} \ - --backend=ninja \ - build - meson compile -C build - meson install -C build + meson setup \ + --prefix=${PREFIX} \ + --cmake-prefix-path=${PREFIX} \ + --backend=ninja \ + build + meson compile -C build + meson install -C build - popd + popd fi # Build & Install libdatachannel -if ! cmake --find-package -DNAME=LibDataChannel -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST >/dev/null 2>/dev/null && - should_build "libdatachannel" "for the webrtc node-type"; then - git clone ${GIT_OPTS} --recursive --branch v0.23.2 https://github.com/paullouisageneau/libdatachannel.git - mkdir -p libdatachannel/build - pushd libdatachannel/build - - if pkg-config "nice >= 0.1.16"; then - CMAKE_DATACHANNEL_USE_NICE=-DUSE_NICE=ON - fi - - cmake -DNO_MEDIA=ON \ - -DNO_WEBSOCKET=ON \ - ${CMAKE_DATACHANNEL_USE_NICE-} \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! cmake --find-package -DNAME=LibDataChannel -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST >/dev/null 2>/dev/null && \ + should_build "libdatachannel" "for the webrtc node-type"; then + git clone ${GIT_OPTS} --recursive --branch v0.23.2 https://github.com/paullouisageneau/libdatachannel.git + mkdir -p libdatachannel/build + pushd libdatachannel/build + + if pkg-config "nice >= 0.1.16"; then + CMAKE_DATACHANNEL_USE_NICE=-DUSE_NICE=ON + fi + + cmake -DNO_MEDIA=ON \ + -DNO_WEBSOCKET=ON \ + ${CMAKE_DATACHANNEL_USE_NICE-} \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build & Install libmodbus -if ! pkg-config "libmodbus >= 3.1.0" && - should_build "libmodbus" "for the modbus node-type"; then - git clone ${GIT_OPTS} --recursive --branch v3.1.11 https://github.com/stephane/libmodbus.git - mkdir -p libmodbus/build - pushd libmodbus - autoreconf -i - ./configure ${CONFIGURE_OPTS} - make ${MAKE_OPTS} install - popd +if ! pkg-config "libmodbus >= 3.1.0" && \ + should_build "libmodbus" "for the modbus node-type"; then + git clone ${GIT_OPTS} --recursive --branch v3.1.11 https://github.com/stephane/libmodbus.git + mkdir -p libmodbus/build + pushd libmodbus + autoreconf -i + ./configure ${CONFIGURE_OPTS} + make ${MAKE_OPTS} install + popd fi # Build & Install OpenDSS if ! find /usr/{local/,}{lib,bin} -name "libOpenDSSC.so" | grep -q . && - should_build "opendss" "For opendss node-type" && - has_git_svn; then - git svn clone -r 4020:4020 https://svn.code.sf.net/p/electricdss/code/trunk/VersionC OpenDSS-C - mkdir -p OpenDSS-C/build - pushd OpenDSS-C - for i in ${SOURCE_DIR}/patches/*-opendssc-*.patch; do patch --strip=1 --binary <"$i"; done - popd - pushd OpenDSS-C/build - if command -v g++-14 2>&1 >/dev/null; then - # OpenDSS rev 4020 is not compatible with GCC 15 - OPENDSS_CMAKE_OPTS="-DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14" - else - OPENDSS_CMAKE_OPTS="" - fi - cmake -DMyOutputType=DLL \ - ${OPENDSS_CMAKE_OPTS} \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd - - echo "${PREFIX}/openDSSC/bin/" >/etc/ld.so.conf.d/opendssc.conf + should_build "opendss" "For opendss node-type" && + has_git_svn; then + git svn clone -r 4020:4020 https://svn.code.sf.net/p/electricdss/code/trunk/VersionC OpenDSS-C + mkdir -p OpenDSS-C/build + pushd OpenDSS-C + for i in ${SOURCE_DIR}/patches/*-opendssc-*.patch; do patch --strip=1 --binary < "$i"; done + popd + pushd OpenDSS-C/build + if command -v g++-14 2>&1 >/dev/null; then + # OpenDSS rev 4020 is not compatible with GCC 15 + OPENDSS_CMAKE_OPTS="-DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14" + else + OPENDSS_CMAKE_OPTS="" + fi + cmake -DMyOutputType=DLL \ + ${OPENDSS_CMAKE_OPTS} \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd + + echo "${PREFIX}/openDSSC/bin/" > /etc/ld.so.conf.d/opendssc.conf fi # Build & Install ghc::filesystem -if ! cmake --find-package -DNAME=ghc_filesystem -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST >/dev/null 2>/dev/null && - should_build "ghc_filesystem" "for compatability with older compilers"; then - git clone ${GIT_OPTS} --branch v1.5.14 https://github.com/gulrak/filesystem.git - mkdir -p filesystem/build - pushd filesystem/build - cmake -DGHC_FILESYSTEM_BUILD_TESTING=OFF \ - -DGHC_FILESYSTEM_BUILD_EXAMPLES=OFF \ - ${CMAKE_OPTS} .. - cmake --build . \ - --target install \ - --parallel ${PARALLEL} - popd +if ! cmake --find-package -DNAME=ghc_filesystem -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST >/dev/null 2>/dev/null && \ + should_build "ghc_filesystem" "for compatability with older compilers"; then + git clone ${GIT_OPTS} --branch v1.5.14 https://github.com/gulrak/filesystem.git + mkdir -p filesystem/build + pushd filesystem/build + cmake -DGHC_FILESYSTEM_BUILD_TESTING=OFF \ + -DGHC_FILESYSTEM_BUILD_EXAMPLES=OFF \ + ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build and install nlohmann/josn required for villas-chronics if ! pkg-config "nlohmann_json" && - should_build "nlohman_json" "for the delta-sharing node-type"; then - git clone https://github.com/nlohmann/json.git json - mkdir -p json/build - pushd json/build - cmake .. - make ${MAKE_OPTS} install - popd + should_build "nlohman_json" "for the delta-sharing node-type"; then + git clone https://github.com/nlohmann/json.git json + mkdir -p json/build + pushd json/build + cmake ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi # Build and install Bzip2 required for villas-chronics if ! pkg-config "bzip2" && - should_build "BZip2" "for create_chronics hook"; then - git clone https://github.com/libarchive/bzip2.git bzip2 - mkdir -p bzip2/build - pushd bzip2/build - cmake .. - make ${MAKE_OPTS} install - popd + should_build "BZip2" "for create_chronics hook"; then + git clone https://github.com/libarchive/bzip2.git bzip2 + mkdir -p bzip2/build + pushd bzip2/build + cmake ${CMAKE_OPTS} .. + cmake --build . \ + --target install \ + --parallel ${PARALLEL} + popd fi popd >/dev/null # Update linker cache if [ -z "${SKIP_LDCONFIG+x}${DEPS_SCAN+x}" ]; then - ldconfig + ldconfig fi From c5344f964aba0b7ea1e49a322210d3017959bf36 Mon Sep 17 00:00:00 2001 From: Ritesh Subhas Karki Date: Tue, 21 Apr 2026 22:23:25 +0200 Subject: [PATCH 12/15] Update src/villas-chronics.cpp Co-authored-by: Steffen Vogel Signed-off-by: Ritesh Subhas Karki --- src/villas-chronics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/villas-chronics.cpp b/src/villas-chronics.cpp index 2a0e1232d..2e8696748 100644 --- a/src/villas-chronics.cpp +++ b/src/villas-chronics.cpp @@ -1,4 +1,4 @@ -/* Create chronics files for OpenDSS +/* Create chronics files for OpenDSS. * * Author: Ritesh Karki * SPDX-FileCopyrightText: 2014-2026 Institute for Automation of Complex Power Systems, RWTH Aachen University From 4650ffd86ee271fe7a519102d5379a273ab20a41 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Thu, 23 Apr 2026 11:19:45 +0200 Subject: [PATCH 13/15] fix (villas-chronics): Fix villas-chronics build condition Signed-off-by: Ritesh.K --- CMakeLists.txt | 3 ++- src/CMakeLists.txt | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37b0259eb..be581694f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,6 +126,7 @@ pkg_check_modules(GVC IMPORTED_TARGET libgvc>=2.30) pkg_check_modules(LIBUSB IMPORTED_TARGET libusb-1.0>=1.0.23) pkg_check_modules(NANOMSG IMPORTED_TARGET nanomsg) pkg_check_modules(BZIP2 IMPORTED_TARGET bzip2) +pkg_check_modules(NLOHMANN_JSON IMPORTED_TARGET nlohmann_json) if(NOT NANOMSG_FOUND) pkg_check_modules(NANOMSG IMPORTED_TARGET libnanomsg>=1.0.0) @@ -193,7 +194,7 @@ cmake_dependent_option(WITH_SRC "Build executables" 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_VILLAS_CHRONICS "Build with villas-chronics" "${WITH_DEFAULTS}" "BZIP2_FOUND" OFF) +cmake_dependent_option(WITH_VILLAS_CHRONICS "Build with villas-chronics" "${WITH_DEFAULTS}" "BZIP2_FOUND; NLOHMANN_JSON_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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91197844b..a77a5bbc1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,7 +11,6 @@ set(SRCS villas-signal villas-compare villas-test-config - villas-chronics ) add_executable(villas-node villas-node.cpp) From 7d7a225807eb0c7af96510996a1e956dbf4ee9b3 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Thu, 23 Apr 2026 11:20:03 +0200 Subject: [PATCH 14/15] fix (villas-chronics): Fix typo in deps.sh and Dockerfile.debian-multiarch Signed-off-by: Ritesh.K --- packaging/deps.sh | 2 +- packaging/docker/Dockerfile.debian-multiarch | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packaging/deps.sh b/packaging/deps.sh index cd6be1d63..dc3e6a5ef 100644 --- a/packaging/deps.sh +++ b/packaging/deps.sh @@ -602,7 +602,7 @@ if ! cmake --find-package -DNAME=ghc_filesystem -DCOMPILER_ID=GNU -DLANGUAGE=CXX popd fi -# Build and install nlohmann/josn required for villas-chronics +# Build and install nlohmann/json required for villas-chronics if ! pkg-config "nlohmann_json" && should_build "nlohman_json" "for the delta-sharing node-type"; then git clone https://github.com/nlohmann/json.git json diff --git a/packaging/docker/Dockerfile.debian-multiarch b/packaging/docker/Dockerfile.debian-multiarch index e311a646d..ac3c3ab2a 100644 --- a/packaging/docker/Dockerfile.debian-multiarch +++ b/packaging/docker/Dockerfile.debian-multiarch @@ -149,12 +149,9 @@ RUN apt-get update && \ libusb-1.0-0:${ARCH} \ liblua5.3-0:${ARCH} \ libhiredis0.14:${ARCH} \ - libmodbus5:${ARCH} && \ - rm -rf /var/lib/apt/lists/* - -RUN apt-get update && apt-get install -y \ - libbz2-dev \ - nlohmann-json3-dev && \ + libmodbus5:${ARCH} \ + libbz2-dev:${ARCH} \ + nlohmann-json3-dev:${ARCH} && \ rm -rf /var/lib/apt/lists/* COPY --from=builder ${PREFIX} ${PREFIX} From c05422a8a95e9eeba454f972436cf6c56480f0f4 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Thu, 23 Apr 2026 11:46:13 +0200 Subject: [PATCH 15/15] fix (ci): Revert .gitlab-ci.yml Signed-off-by: Ritesh.K --- .gitlab-ci.yml | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2fe774a7..8d960bf2f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,24 +12,6 @@ variables: DOCKER_CLI_EXPERIMENTAL: enabled CMAKE_BUILD_OPTS: "--parallel 16" CMAKE_EXTRA_OPTS: "-DCMAKE_BUILD_TYPE=Release" - CMAKE_EXTRA_OPTS_FEDORA_MINIMAL: > - -DVILLAS_COMPILE_WARNING_AS_ERROR=ON - -DWITH_API=OFF - -DWITH_CLIENTS=OFF - -DWITH_CONFIG=OFF - -DWITH_DOC=OFF - -DWITH_FPGA=OFF - -DWITH_GRAPHVIZ=OFF - -DWITH_HOOKS=OFF - -DWITH_LUA=OFF - -DWITH_OPENMP=OFF - -DWITH_PLUGINS=OFF - -DWITH_SRC=OFF - -DWITH_TESTS=OFF - -DWITH_TOOLS=OFF - -DWITH_WEB=OFF - -DCMAKE_MODULE_PATH=/usr/local/lib64/cmake - -DCMAKE_PREFIX_PATH=/usr/local CACHIX_CACHE_NAME: villas stages: @@ -124,7 +106,23 @@ build:source: -DVILLAS_COMPILE_WARNING_AS_ERROR=ON - DISTRO: fedora-minimal CMAKE_EXTRA_OPTS: > - ${CMAKE_EXTRA_OPTS_FEDORA_MINIMAL} + -DVILLAS_COMPILE_WARNING_AS_ERROR=ON + -DWITH_API=OFF + -DWITH_CLIENTS=OFF + -DWITH_CONFIG=OFF + -DWITH_DOC=OFF + -DWITH_FPGA=OFF + -DWITH_GRAPHVIZ=OFF + -DWITH_HOOKS=OFF + -DWITH_LUA=OFF + -DWITH_OPENMP=OFF + -DWITH_PLUGINS=OFF + -DWITH_SRC=OFF + -DWITH_TESTS=OFF + -DWITH_TOOLS=OFF + -DWITH_WEB=OFF + -DCMAKE_MODULE_PATH=/usr/local/lib64/cmake + -DCMAKE_PREFIX_PATH=/usr/local build:nix: <<: *nix