From bf8a2213c1acba9232092b994ee636ae9337ff4b Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Wed, 26 Jul 2023 13:31:51 +0200 Subject: [PATCH] Add the ovniver program to report the version --- CHANGELOG.md | 1 + src/emu/CMakeLists.txt | 5 ++++- src/emu/ovniver.c | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/emu/ovniver.c diff --git a/CHANGELOG.md b/CHANGELOG.md index a0a007d..cdc2f6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add `ovni_version_get()` function. +- Add the `ovniver` program to report the `libovni.so` version. ## [1.2.2] - 2022-07-26 diff --git a/src/emu/CMakeLists.txt b/src/emu/CMakeLists.txt index 380c146..a781429 100644 --- a/src/emu/CMakeLists.txt +++ b/src/emu/CMakeLists.txt @@ -70,6 +70,9 @@ target_link_libraries(ovnisort emu parson-static ovni-static) add_executable(ovnitop ovnitop.c) target_link_libraries(ovnitop emu parson-static ovni-static) +add_executable(ovniver ovniver.c) +target_link_libraries(ovniver ovni) + set(USE_MPI ON CACHE BOOL "Use MPI (required by ovnisync)") if(USE_MPI) # Use _ROOT variables if available, commonly used by MPI @@ -85,5 +88,5 @@ else() message(STATUS "Disabling ovnisync as MPI is disabled") endif() -install(TARGETS ovniemu ovnidump ovnisort ovnitop) +install(TARGETS ovniemu ovnidump ovnisort ovnitop ovniver) install(FILES ovnitop.1 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") diff --git a/src/emu/ovniver.c b/src/emu/ovniver.c new file mode 100644 index 0000000..41c6b7a --- /dev/null +++ b/src/emu/ovniver.c @@ -0,0 +1,14 @@ +/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC) + * SPDX-License-Identifier: GPL-3.0-or-later */ + +#include +#include "ovni.h" + +int +main(void) +{ + printf("libovni version compiled %s, dynamic %s\n", + OVNI_LIB_VERSION, ovni_version_get()); + + return 0; +}