From f75a53a83377c436fed7d02cbf81bc87e7996453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Montan=CC=83ana?= Date: Fri, 8 Mar 2024 12:01:33 +0100 Subject: [PATCH] Remove bayesnet submodule --- .gitmodules | 6 ++++++ CMakeLists.txt | 4 +++- lib/catch2 | 1 + lib/mdlp | 1 + src/CMakeLists.txt | 5 ++--- tests/CMakeLists.txt | 15 +++++---------- 6 files changed, 18 insertions(+), 14 deletions(-) create mode 160000 lib/catch2 create mode 160000 lib/mdlp diff --git a/.gitmodules b/.gitmodules index 0122614..65a5706 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,9 @@ [submodule "lib/json"] path = lib/json url = https://github.com/nlohmann/json.git +[submodule "lib/catch2"] + path = lib/catch2 + url = https://github.com/catchorg/Catch2.git +[submodule "lib/mdlp"] + path = lib/mdlp + url = https://github.com/rmontanana/mdlp diff --git a/CMakeLists.txt b/CMakeLists.txt index 696dd3b..7c1c7d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,13 +69,15 @@ find_library(BayesNet NAMES libBayesNet BayesNet) # Subdirectories # -------------- -file(GLOB PyClassifiers_SOURCES CONFIGURE_DEPENDS ${PyClassifiers_SOURCE_DIR}/src/*.cc ${PyClassifiers_SOURCE_DIR}/src/*.hpp) add_subdirectory(src) # Testing # ------- if (ENABLE_TESTING) MESSAGE("Testing enabled") + add_git_submodule(lib/catch2) + add_git_submodule(lib/mdlp) + add_subdirectory(lib/Files) include(CTest) add_subdirectory(tests) endif (ENABLE_TESTING) diff --git a/lib/catch2 b/lib/catch2 new file mode 160000 index 0000000..8ac8190 --- /dev/null +++ b/lib/catch2 @@ -0,0 +1 @@ +Subproject commit 8ac8190e494a381072c89f5e161b92a08d98b37b diff --git a/lib/mdlp b/lib/mdlp new file mode 160000 index 0000000..5708dc3 --- /dev/null +++ b/lib/mdlp @@ -0,0 +1 @@ +Subproject commit 5708dc3de944fc22d61a2dd071b63aa338e04db3 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2050e8c..9e84718 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,9 +1,8 @@ include_directories( - ${PyClassifiers_SOURCE_DIR}/lib/Files - ${PyClassifiers_SOURCE_DIR}/lib/json/include ${Python3_INCLUDE_DIRS} ${TORCH_INCLUDE_DIRS} + ${PyClassifiers_SOURCE_DIR}/lib/json/include /usr/local/include/bayesnet ) -add_library(PyClassifiers ${PyClassifiers_SOURCES}) +add_library(PyClassifiers ODTE.cc STree.cc SVC.cc RandomForest.cc XGBoost.cc PyClassifier.cc) target_link_libraries(PyClassifiers ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9671bb4..047d879 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,20 +2,15 @@ if(ENABLE_TESTING) set(TEST_PYCLASSIFIERS "unit_tests_pyclassifiers") include_directories( ${PyClassifiers_SOURCE_DIR}/src/ - ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/lib/json/include - ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/lib/Files - ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/lib/mdlp - ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src - ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/classifiers - ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/ensembles - ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/bayesian_network - ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/utils + ${PyClassifiers_SOURCE_DIR}/lib/Files + ${PyClassifiers_SOURCE_DIR}/lib/mdlp + ${PyClassifiers_SOURCE_DIR}/lib/json/include ${Python3_INCLUDE_DIRS} ${TORCH_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/configured_files/include + /usr/local/include/bayesnet ) + file(GLOB_RECURSE PyClassifiers_SOURCES "${PyClassifiers_SOURCE_DIR}/src/*.cc") set(TEST_SOURCES_PYCLASSIFIERS TestPythonClassifiers.cc TestUtils.cc ${PyClassifiers_SOURCES}) add_executable(${TEST_PYCLASSIFIERS} ${TEST_SOURCES_PYCLASSIFIERS}) target_link_libraries(${TEST_PYCLASSIFIERS} PUBLIC "${TORCH_LIBRARIES}" ${Python3_LIBRARIES} ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy ArffFiles mdlp Catch2::Catch2WithMain) - add_test(NAME ${TEST_PYCLASSIFIERS} COMMAND ${TEST_PYCLASSIFIERS}) endif(ENABLE_TESTING) \ No newline at end of file