Update project version to 1.1.1
Fix CMakeLists and different configurations to fix vcpkg build & installation Fix sample build Update CHANGELOG
This commit is contained in:
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Internal
|
### Internal
|
||||||
|
|
||||||
- Add changes to .clang-format to ajust to vscode format style thanks to <https://clang-format-configurator.site/>
|
- Add changes to .clang-format to adjust to vscode format style thanks to <https://clang-format-configurator.site/>
|
||||||
- Remove all the dependencies as git submodules and add them as vcpkg dependencies.
|
- Remove all the dependencies as git submodules and add them as vcpkg dependencies.
|
||||||
- Fix the dependencies versions for this specific BayesNet version.
|
- Fix the dependencies versions for this specific BayesNet version.
|
||||||
|
|
||||||
|
121
CMakeLists.txt
121
CMakeLists.txt
@@ -1,21 +1,19 @@
|
|||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.27)
|
||||||
|
|
||||||
project(BayesNet
|
project(bayesnet
|
||||||
VERSION 1.1.0
|
VERSION 1.1.1
|
||||||
DESCRIPTION "Bayesian Network and basic classifiers Library."
|
DESCRIPTION "Bayesian Network and basic classifiers Library."
|
||||||
HOMEPAGE_URL "https://github.com/rmontanana/bayesnet"
|
HOMEPAGE_URL "https://github.com/rmontanana/bayesnet"
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
if (CODE_COVERAGE AND NOT ENABLE_TESTING)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
MESSAGE(FATAL_ERROR "Code coverage requires testing enabled")
|
|
||||||
endif (CODE_COVERAGE AND NOT ENABLE_TESTING)
|
|
||||||
|
|
||||||
find_package(Torch REQUIRED)
|
|
||||||
|
|
||||||
if (POLICY CMP0135)
|
|
||||||
cmake_policy(SET CMP0135 NEW)
|
cmake_policy(SET CMP0135 NEW)
|
||||||
endif ()
|
|
||||||
|
find_package(Torch CONFIG REQUIRED)
|
||||||
|
find_package(fimdlp CONFIG REQUIRED)
|
||||||
|
find_package(nlohmann_json CONFIG REQUIRED)
|
||||||
|
find_package(folding CONFIG REQUIRED)
|
||||||
|
|
||||||
# Global CMake variables
|
# Global CMake variables
|
||||||
# ----------------------
|
# ----------------------
|
||||||
@@ -33,76 +31,83 @@ endif()
|
|||||||
|
|
||||||
# Options
|
# Options
|
||||||
# -------
|
# -------
|
||||||
option(ENABLE_CLANG_TIDY "Enable to add clang tidy." OFF)
|
option(ENABLE_CLANG_TIDY "Enable to add clang tidy" OFF)
|
||||||
option(ENABLE_TESTING "Unit testing build" OFF)
|
option(ENABLE_TESTING "Unit testing build" OFF)
|
||||||
option(CODE_COVERAGE "Collect coverage from test library" OFF)
|
option(CODE_COVERAGE "Collect coverage from test library" OFF)
|
||||||
option(INSTALL_GTEST "Enable installation of googletest." OFF)
|
option(INSTALL_GTEST "Enable installation of googletest" OFF)
|
||||||
|
|
||||||
# CMakes modules
|
add_subdirectory(config)
|
||||||
# --------------
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
|
||||||
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
||||||
MESSAGE("Debug mode")
|
|
||||||
set(ENABLE_TESTING ON)
|
|
||||||
set(CODE_COVERAGE ON)
|
|
||||||
endif (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
||||||
|
|
||||||
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
|
|
||||||
message(STATUS "Languages=${LANGUAGES}")
|
|
||||||
if (CODE_COVERAGE)
|
|
||||||
enable_testing()
|
|
||||||
include(CodeCoverage)
|
|
||||||
MESSAGE(STATUS "Code coverage enabled")
|
|
||||||
SET(GCC_COVERAGE_LINK_FLAGS " ${GCC_COVERAGE_LINK_FLAGS} -lgcov --coverage")
|
|
||||||
endif (CODE_COVERAGE)
|
|
||||||
|
|
||||||
if (ENABLE_CLANG_TIDY)
|
if (ENABLE_CLANG_TIDY)
|
||||||
include(StaticAnalyzers) # clang-tidy
|
include(StaticAnalyzers) # clang-tidy
|
||||||
endif (ENABLE_CLANG_TIDY)
|
endif (ENABLE_CLANG_TIDY)
|
||||||
|
|
||||||
# External libraries - dependencies of BayesNet
|
# Add the library
|
||||||
# ---------------------------------------------
|
# ---------------
|
||||||
|
include_directories(
|
||||||
|
${bayesnet_SOURCE_DIR}
|
||||||
|
${CMAKE_BINARY_DIR}/configured_files/include
|
||||||
|
)
|
||||||
|
|
||||||
find_package(Torch CONFIG REQUIRED)
|
file(GLOB_RECURSE Sources "bayesnet/*.cc")
|
||||||
find_package(fimdlp CONFIG REQUIRED)
|
|
||||||
find_package(nlohmann_json CONFIG REQUIRED)
|
|
||||||
find_package(folding CONFIG REQUIRED)
|
|
||||||
|
|
||||||
# Subdirectories
|
add_library(bayesnet ${Sources})
|
||||||
# --------------
|
target_link_libraries(bayesnet fimdlp::fimdlp folding::folding "${TORCH_LIBRARIES}")
|
||||||
add_subdirectory(config)
|
|
||||||
add_subdirectory(bayesnet)
|
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
# -------
|
# -------
|
||||||
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
MESSAGE("Debug mode")
|
||||||
|
set(ENABLE_TESTING ON)
|
||||||
|
set(CODE_COVERAGE ON)
|
||||||
|
endif (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
if (ENABLE_TESTING)
|
if (ENABLE_TESTING)
|
||||||
MESSAGE(STATUS "Testing enabled")
|
MESSAGE(STATUS "Testing enabled")
|
||||||
find_package(Catch2 CONFIG REQUIRED)
|
find_package(Catch2 CONFIG REQUIRED)
|
||||||
|
find_package(arff-files CONFIG REQUIRED)
|
||||||
|
enable_testing()
|
||||||
include(CTest)
|
include(CTest)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
else(ENABLE_TESTING)
|
||||||
|
message("Release mode")
|
||||||
endif (ENABLE_TESTING)
|
endif (ENABLE_TESTING)
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
# ------------
|
# ------------
|
||||||
install(TARGETS BayesNet
|
include(CMakePackageConfigHelpers)
|
||||||
|
write_basic_package_version_file(
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/bayesnetConfigVersion.cmake"
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
|
COMPATIBILITY AnyNewerVersion
|
||||||
|
)
|
||||||
|
|
||||||
|
configure_package_config_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/bayesnetConfig.cmake.in
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/bayesnetConfig.cmake"
|
||||||
|
INSTALL_DESTINATION share/bayesnet)
|
||||||
|
|
||||||
|
install(TARGETS bayesnet
|
||||||
|
EXPORT bayesnetTargets
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
CONFIGURATIONS Release)
|
CONFIGURATIONS Release)
|
||||||
install(DIRECTORY bayesnet/ DESTINATION include/bayesnet FILES_MATCHING CONFIGURATIONS Release PATTERN "*.h")
|
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/bayesnet/config.h DESTINATION include/bayesnet CONFIGURATIONS Release)
|
|
||||||
|
|
||||||
# Documentation
|
install(DIRECTORY bayesnet/
|
||||||
# -------------
|
DESTINATION include/bayesnet
|
||||||
find_package(Doxygen)
|
FILES_MATCHING
|
||||||
if (Doxygen_FOUND)
|
CONFIGURATIONS Release
|
||||||
set(DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs)
|
PATTERN "*.h")
|
||||||
set(doxyfile_in ${DOC_DIR}/Doxyfile.in)
|
install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/bayesnet/config.h
|
||||||
set(doxyfile ${DOC_DIR}/Doxyfile)
|
DESTINATION include/bayesnet
|
||||||
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
|
CONFIGURATIONS Release)
|
||||||
doxygen_add_docs(doxygen
|
|
||||||
WORKING_DIRECTORY ${DOC_DIR}
|
install(EXPORT bayesnetTargets
|
||||||
CONFIG_FILE ${doxyfile})
|
FILE bayesnetTargets.cmake
|
||||||
else (Doxygen_FOUND)
|
NAMESPACE bayesnet::
|
||||||
MESSAGE("* Doxygen not found")
|
DESTINATION share/bayesnet)
|
||||||
endif (Doxygen_FOUND)
|
|
||||||
|
install(FILES
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/bayesnetConfig.cmake"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/bayesnetConfigVersion.cmake"
|
||||||
|
DESTINATION share/bayesnet
|
||||||
|
)
|
||||||
|
11
Makefile
11
Makefile
@@ -5,7 +5,7 @@ SHELL := /bin/bash
|
|||||||
f_release = build_Release
|
f_release = build_Release
|
||||||
f_debug = build_Debug
|
f_debug = build_Debug
|
||||||
f_diagrams = diagrams
|
f_diagrams = diagrams
|
||||||
app_targets = BayesNet
|
app_targets = bayesnet
|
||||||
test_targets = TestBayesNet
|
test_targets = TestBayesNet
|
||||||
clang-uml = clang-uml
|
clang-uml = clang-uml
|
||||||
plantuml = plantuml
|
plantuml = plantuml
|
||||||
@@ -86,10 +86,13 @@ init: ## Initialize the project installing dependencies
|
|||||||
|
|
||||||
clean: ## Clean the project
|
clean: ## Clean the project
|
||||||
@echo ">>> Cleaning the project..."
|
@echo ">>> Cleaning the project..."
|
||||||
@if test -d build_Debug ; then echo "- Deleting build_Debug folder" ; rm -rf build_Debug; fi
|
|
||||||
@if test -d build_Release ; then echo "- Deleting build_Release folder" ; rm -rf build_Release; fi
|
|
||||||
@if test -f CMakeCache.txt ; then echo "- Deleting CMakeCache.txt"; rm -f CMakeCache.txt; fi
|
@if test -f CMakeCache.txt ; then echo "- Deleting CMakeCache.txt"; rm -f CMakeCache.txt; fi
|
||||||
@if test -d vcpkg_installed ; then echo "- Deleting vcpkg_installed folder" ; rm -rf vcpkg_installed; fi
|
@for folder in $(f_release) $(f_debug) vpcpkg_installed install_test ; do \
|
||||||
|
if test -d "$$folder" ; then \
|
||||||
|
echo "- Deleting $$folder folder" ; \
|
||||||
|
rm -rf "$$folder"; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
@$(MAKE) clean-test
|
@$(MAKE) clean-test
|
||||||
@echo ">>> Done";
|
@echo ">>> Done";
|
||||||
|
|
||||||
|
4
bayesnetConfig.cmake.in
Normal file
4
bayesnetConfig.cmake.in
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/bayesnetTargets.cmake")
|
||||||
|
|
@@ -11,4 +11,4 @@ static constexpr std::string_view project_name = "@PROJECT_NAME@";
|
|||||||
static constexpr std::string_view project_version = "@PROJECT_VERSION@";
|
static constexpr std::string_view project_version = "@PROJECT_VERSION@";
|
||||||
static constexpr std::string_view project_description = "@PROJECT_DESCRIPTION@";
|
static constexpr std::string_view project_description = "@PROJECT_DESCRIPTION@";
|
||||||
static constexpr std::string_view git_sha = "@GIT_SHA@";
|
static constexpr std::string_view git_sha = "@GIT_SHA@";
|
||||||
static constexpr std::string_view data_path = "@BayesNet_SOURCE_DIR@/tests/data/";
|
static constexpr std::string_view data_path = "@bayesnet_SOURCE_DIR@/tests/data/";
|
@@ -1,15 +1,16 @@
|
|||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
project(bayesnet_sample)
|
project(bayesnet_sample VERSION 0.1.0 LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
|
||||||
find_package(Torch CONFIG REQUIRED)
|
find_package(Torch CONFIG REQUIRED)
|
||||||
find_package(bayesnet CONFIG REQUIRED)
|
|
||||||
find_package(fimdlp CONFIG REQUIRED)
|
find_package(fimdlp CONFIG REQUIRED)
|
||||||
find_package(folding CONFIG REQUIRED)
|
find_package(folding CONFIG REQUIRED)
|
||||||
find_package(arff-files CONFIG REQUIRED)
|
find_package(arff-files CONFIG REQUIRED)
|
||||||
find_package(nlohman_json CONFIG REQUIRED)
|
find_package(bayesnet CONFIG REQUIRED)
|
||||||
|
|
||||||
add_executable(bayesnet_sample sample.cc)
|
add_executable(bayesnet_sample sample.cc)
|
||||||
target_link_libraries(bayesnet_sample PRIVATE
|
target_link_libraries(bayesnet_sample PRIVATE
|
||||||
@@ -17,6 +18,5 @@ target_link_libraries(bayesnet_sample PRIVATE
|
|||||||
arff-files::arff-files
|
arff-files::arff-files
|
||||||
"${TORCH_LIBRARIES}"
|
"${TORCH_LIBRARIES}"
|
||||||
bayesnet::bayesnet
|
bayesnet::bayesnet
|
||||||
nlohmann_json::nlohmann_json
|
|
||||||
folding::folding
|
folding::folding
|
||||||
)
|
)
|
||||||
|
@@ -1,21 +1,21 @@
|
|||||||
{
|
{
|
||||||
|
"default-registry": {
|
||||||
|
"kind": "git",
|
||||||
|
"baseline": "760bfd0c8d7c89ec640aec4df89418b7c2745605",
|
||||||
|
"repository": "https://github.com/microsoft/vcpkg"
|
||||||
|
},
|
||||||
"registries": [
|
"registries": [
|
||||||
{
|
{
|
||||||
"kind": "git",
|
"kind": "git",
|
||||||
"repository": "https://github.com/rmontanana/vcpkg-stash",
|
"repository": "https://github.com/rmontanana/vcpkg-stash",
|
||||||
"baseline": "393efa4e74e053b6f02c4ab03738c8fe796b28e5",
|
"baseline": "1ea69243c0e8b0de77c9d1dd6e1d7593ae7f3627",
|
||||||
"packages": [
|
"packages": [
|
||||||
"folding",
|
|
||||||
"bayesnet",
|
|
||||||
"arff-files",
|
"arff-files",
|
||||||
|
"bayesnet",
|
||||||
"fimdlp",
|
"fimdlp",
|
||||||
|
"folding",
|
||||||
"libtorch-bin"
|
"libtorch-bin"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"default-registry": {
|
|
||||||
"kind": "git",
|
|
||||||
"repository": "https://github.com/microsoft/vcpkg",
|
|
||||||
"baseline": "760bfd0c8d7c89ec640aec4df89418b7c2745605"
|
|
||||||
}
|
|
||||||
}
|
}
|
@@ -2,11 +2,32 @@
|
|||||||
"name": "sample-project",
|
"name": "sample-project",
|
||||||
"version-string": "0.1.0",
|
"version-string": "0.1.0",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"bayesnet",
|
|
||||||
"folding",
|
|
||||||
"arff-files",
|
"arff-files",
|
||||||
"fimdlp",
|
"fimdlp",
|
||||||
"nlohmann-json",
|
"libtorch-bin",
|
||||||
"libtorch-bin"
|
"folding",
|
||||||
|
"bayesnet"
|
||||||
|
],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"name": "arff-files",
|
||||||
|
"version": "1.1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fimdlp",
|
||||||
|
"version": "2.0.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "libtorch-bin",
|
||||||
|
"version": "2.7.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bayesnet",
|
||||||
|
"version": "1.1.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "folding",
|
||||||
|
"version": "1.1.1"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@@ -1,18 +1,13 @@
|
|||||||
if(ENABLE_TESTING)
|
if(ENABLE_TESTING)
|
||||||
include_directories(
|
include_directories(
|
||||||
${BayesNet_SOURCE_DIR}/tests/lib/Files
|
|
||||||
${BayesNet_SOURCE_DIR}/lib/folding
|
|
||||||
${BayesNet_SOURCE_DIR}/lib/mdlp/src
|
|
||||||
${BayesNet_SOURCE_DIR}/lib/log
|
|
||||||
${BayesNet_SOURCE_DIR}/lib/json/include
|
|
||||||
${BayesNet_SOURCE_DIR}
|
${BayesNet_SOURCE_DIR}
|
||||||
${CMAKE_BINARY_DIR}/configured_files/include
|
${CMAKE_BINARY_DIR}/configured_files/include
|
||||||
)
|
)
|
||||||
file(GLOB_RECURSE BayesNet_SOURCES "${BayesNet_SOURCE_DIR}/bayesnet/*.cc")
|
file(GLOB_RECURSE BayesNet_SOURCES "${bayesnet_SOURCE_DIR}/bayesnet/*.cc")
|
||||||
add_executable(TestBayesNet TestBayesNetwork.cc TestBayesNode.cc TestBayesClassifier.cc TestXSPnDE.cc TestXBA2DE.cc
|
add_executable(TestBayesNet TestBayesNetwork.cc TestBayesNode.cc TestBayesClassifier.cc TestXSPnDE.cc TestXBA2DE.cc
|
||||||
TestBayesModels.cc TestBayesMetrics.cc TestFeatureSelection.cc TestBoostAODE.cc TestXBAODE.cc TestA2DE.cc
|
TestBayesModels.cc TestBayesMetrics.cc TestFeatureSelection.cc TestBoostAODE.cc TestXBAODE.cc TestA2DE.cc
|
||||||
TestUtils.cc TestBayesEnsemble.cc TestModulesVersions.cc TestBoostA2DE.cc TestMST.cc TestXSPODE.cc ${BayesNet_SOURCES})
|
TestUtils.cc TestBayesEnsemble.cc TestModulesVersions.cc TestBoostA2DE.cc TestMST.cc TestXSPODE.cc ${BayesNet_SOURCES})
|
||||||
target_link_libraries(TestBayesNet PUBLIC "${TORCH_LIBRARIES}" fimdlp PRIVATE Catch2::Catch2WithMain)
|
target_link_libraries(TestBayesNet PUBLIC "${TORCH_LIBRARIES}" fimdlp::fimdlp PRIVATE Catch2::Catch2WithMain)
|
||||||
add_test(NAME BayesNetworkTest COMMAND TestBayesNet)
|
add_test(NAME BayesNetworkTest COMMAND TestBayesNet)
|
||||||
add_test(NAME A2DE COMMAND TestBayesNet "[A2DE]")
|
add_test(NAME A2DE COMMAND TestBayesNet "[A2DE]")
|
||||||
add_test(NAME BoostA2DE COMMAND TestBayesNet "[BoostA2DE]")
|
add_test(NAME BoostA2DE COMMAND TestBayesNet "[BoostA2DE]")
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
#include "bayesnet/ensembles/AODELd.h"
|
#include "bayesnet/ensembles/AODELd.h"
|
||||||
#include "bayesnet/ensembles/BoostAODE.h"
|
#include "bayesnet/ensembles/BoostAODE.h"
|
||||||
|
|
||||||
const std::string ACTUAL_VERSION = "1.1.0";
|
const std::string ACTUAL_VERSION = "1.1.1";
|
||||||
|
|
||||||
TEST_CASE("Test Bayesian Classifiers score & version", "[Models]")
|
TEST_CASE("Test Bayesian Classifiers score & version", "[Models]")
|
||||||
{
|
{
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
{
|
{
|
||||||
"kind": "git",
|
"kind": "git",
|
||||||
"repository": "https://github.com/rmontanana/vcpkg-stash",
|
"repository": "https://github.com/rmontanana/vcpkg-stash",
|
||||||
"baseline": "393efa4e74e053b6f02c4ab03738c8fe796b28e5",
|
"baseline": "1ea69243c0e8b0de77c9d1dd6e1d7593ae7f3627",
|
||||||
"packages": [
|
"packages": [
|
||||||
"arff-files",
|
"arff-files",
|
||||||
"fimdlp",
|
"fimdlp",
|
||||||
|
Reference in New Issue
Block a user