diff --git a/.gitignore b/.gitignore
index be457cd..2da8b45 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,4 +45,4 @@ docs/man3
docs/man
docs/Doxyfile
.cache
-
+vcpkg_installed
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 7a453f1..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,21 +0,0 @@
-[submodule "lib/json"]
- path = lib/json
- url = https://github.com/nlohmann/json.git
- master = master
- update = merge
-[submodule "lib/folding"]
- path = lib/folding
- url = https://github.com/rmontanana/folding
- main = main
- update = merge
-[submodule "tests/lib/catch2"]
- path = tests/lib/catch2
- url = https://github.com/catchorg/Catch2.git
- main = main
- update = merge
-[submodule "tests/lib/Files"]
- path = tests/lib/Files
- url = https://github.com/rmontanana/ArffFiles
-[submodule "lib/mdlp"]
- path = lib/mdlp
- url = https://github.com/rmontanana/mdlp
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a716115..59f08a4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,9 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [1.1.0] - 2025-04-27
+
### 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 ajust to vscode format style thanks to
+- Remove all the dependencies as git submodules and add them as vcpkg dependencies.
+- Fix the dependencies versions for this specific BayesNet version.
## [1.0.7] 2025-03-16
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 359c806..5212607 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.20)
project(BayesNet
- VERSION 1.0.7
+ VERSION 1.1.0
DESCRIPTION "Bayesian Network and basic classifiers Library."
HOMEPAGE_URL "https://github.com/rmontanana/bayesnet"
LANGUAGES CXX
@@ -41,7 +41,6 @@ option(INSTALL_GTEST "Enable installation of googletest." OFF)
# CMakes modules
# --------------
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
-include(AddGitSubmodule)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
MESSAGE("Debug mode")
@@ -65,9 +64,10 @@ endif (ENABLE_CLANG_TIDY)
# External libraries - dependencies of BayesNet
# ---------------------------------------------
-# include(FetchContent)
-add_git_submodule("lib/json")
-add_git_submodule("lib/mdlp")
+find_package(Torch CONFIG REQUIRED)
+find_package(fimdlp CONFIG REQUIRED)
+find_package(nlohmann_json CONFIG REQUIRED)
+find_package(folding CONFIG REQUIRED)
# Subdirectories
# --------------
@@ -78,7 +78,7 @@ add_subdirectory(bayesnet)
# -------
if (ENABLE_TESTING)
MESSAGE(STATUS "Testing enabled")
- add_subdirectory(tests/lib/catch2)
+ find_package(Catch2 CONFIG REQUIRED)
include(CTest)
add_subdirectory(tests)
endif (ENABLE_TESTING)
diff --git a/Makefile b/Makefile
index a77c862..0f36fae 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
SHELL := /bin/bash
.DEFAULT_GOAL := help
-.PHONY: viewcoverage coverage setup help install uninstall diagrams buildr buildd test clean debug release sample updatebadge doc doc-install
+.PHONY: viewcoverage coverage setup help install uninstall diagrams buildr buildd test clean debug release sample updatebadge doc doc-install init clean-test
f_release = build_Release
f_debug = build_Debug
@@ -63,7 +63,7 @@ buildd: ## Build the debug targets
buildr: ## Build the release targets
cmake --build $(f_release) -t $(app_targets) --parallel $(CMAKE_BUILD_PARALLEL_LEVEL)
-clean: ## Clean the tests info
+clean-test: ## Clean the tests info
@echo ">>> Cleaning Debug BayesNet tests...";
$(call ClearTests)
@echo ">>> Done";
@@ -79,18 +79,32 @@ install: ## Install library
@cmake --install $(f_release) --prefix $(prefix)
@echo ">>> Done";
+init: ## Initialize the project installing dependencies
+ @echo ">>> Installing dependencies"
+ @vcpkg install
+ @echo ">>> Done";
+
+clean: ## Clean 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 -d vcpkg_installed ; then echo "- Deleting vcpkg_installed folder" ; rm -rf vcpkg_installed; fi
+ @$(MAKE) clean-test
+ @echo ">>> Done";
+
debug: ## Build a debug version of the project
@echo ">>> Building Debug BayesNet...";
@if [ -d ./$(f_debug) ]; then rm -rf ./$(f_debug); fi
@mkdir $(f_debug);
- @cmake -S . -B $(f_debug) -D CMAKE_BUILD_TYPE=Debug -D ENABLE_TESTING=ON -D CODE_COVERAGE=ON
+ @cmake -S . -B $(f_debug) -D CMAKE_BUILD_TYPE=Debug -D ENABLE_TESTING=ON -D CODE_COVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
@echo ">>> Done";
release: ## Build a Release version of the project
@echo ">>> Building Release BayesNet...";
@if [ -d ./$(f_release) ]; then rm -rf ./$(f_release); fi
@mkdir $(f_release);
- @cmake -S . -B $(f_release) -D CMAKE_BUILD_TYPE=Release
+ @cmake -S . -B $(f_release) -D CMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
@echo ">>> Done";
fname = "tests/data/iris.arff"
@@ -112,7 +126,7 @@ sample2: ## Build sample2
opt = ""
test: ## Run tests (opt="-s") to verbose output the tests, (opt="-c='Test Maximum Spanning Tree'") to run only that section
@echo ">>> Running BayesNet tests...";
- @$(MAKE) clean
+ @$(MAKE) clean-test
@cmake --build $(f_debug) -t $(test_targets) --parallel $(CMAKE_BUILD_PARALLEL_LEVEL)
@for t in $(test_targets); do \
echo ">>> Running $$t...";\
@@ -133,6 +147,7 @@ coverage: ## Run tests and generate coverage report (build/index.html)
$(lcov) --directory CMakeFiles --capture --demangle-cpp --ignore-errors source,source --output-file coverage.info >/dev/null 2>&1; \
$(lcov) --remove coverage.info '/usr/*' --output-file coverage.info >/dev/null 2>&1; \
$(lcov) --remove coverage.info 'lib/*' --output-file coverage.info >/dev/null 2>&1; \
+ $(lcov) --remove coverage.info 'include/*' --output-file coverage.info >/dev/null 2>&1; \
$(lcov) --remove coverage.info 'libtorch/*' --output-file coverage.info >/dev/null 2>&1; \
$(lcov) --remove coverage.info 'tests/*' --output-file coverage.info >/dev/null 2>&1; \
$(lcov) --remove coverage.info 'bayesnet/utils/loguru.*' --ignore-errors unused --output-file coverage.info >/dev/null 2>&1; \
diff --git a/bayesnet/classifiers/Proposal.h b/bayesnet/classifiers/Proposal.h
index dd011d8..26118bf 100644
--- a/bayesnet/classifiers/Proposal.h
+++ b/bayesnet/classifiers/Proposal.h
@@ -9,7 +9,7 @@
#include
#include