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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ 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)
pkg_check_modules(NLOHMANN_JSON IMPORTED_TARGET nlohmann_json)

if(NOT NANOMSG_FOUND)
pkg_check_modules(NANOMSG IMPORTED_TARGET libnanomsg>=1.0.0)
endif()
Expand Down Expand Up @@ -191,6 +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; 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)
Expand Down
26 changes: 26 additions & 0 deletions packaging/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,32 @@ if ! cmake --find-package -DNAME=ghc_filesystem -DCOMPILER_ID=GNU -DLANGUAGE=CXX
popd
fi

# 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
Comment thread
riteshk001 marked this conversation as resolved.
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 ${CMAKE_OPTS} ..
cmake --build . \
--target install \
--parallel ${PARALLEL}
popd
fi

popd >/dev/null

# Update linker cache
Expand Down
4 changes: 3 additions & 1 deletion packaging/docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion packaging/docker/Dockerfile.debian-multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ RUN apt-get update && \
libusb-1.0-0:${ARCH} \
liblua5.3-0:${ARCH} \
libhiredis0.14:${ARCH} \
libmodbus5:${ARCH} && \
libmodbus5:${ARCH} \
libbz2-dev:${ARCH} \
nlohmann-json3-dev:${ARCH} && \
rm -rf /var/lib/apt/lists/*

COPY --from=builder ${PREFIX} ${PREFIX}
Expand Down
4 changes: 3 additions & 1 deletion packaging/docker/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion packaging/docker/Dockerfile.fedora-minimal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion packaging/docker/Dockerfile.rocky
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion packaging/docker/Dockerfile.rocky9
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion packaging/docker/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ RUN apt-get update && \
libusb-1.0-0-dev \
libwebsockets-dev \
libzmq3-dev \
uuid-dev
uuid-dev \
libbz2-dev \
nlohmann-json3-dev

# Install unpackaged dependencies from source
ADD packaging/patches /deps/patches
Expand Down
4 changes: 4 additions & 0 deletions packaging/nix/villas.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
pkg-config,
stdenv,
system,
nlohmann_json,
bzip2,
# Optional dependencies
boxfort,
comedilib,
Expand Down Expand Up @@ -151,6 +153,8 @@ stdenv.mkDerivation {
curl
spdlog
bash
nlohmann_json
bzip2
]
++ lib.optionals withExtraTesting [
boxfort
Expand Down
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,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 PkgConfig::BZIP2)

list(APPEND SRCS villas-chronics)
endif()

install(
TARGETS ${SRCS}
COMPONENT bin
Expand Down
Loading
Loading