From 634ea3616919eb347dbe189e2b255c30a9d6ed1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Montan=CC=83ana?= Date: Mon, 18 Mar 2024 14:00:34 +0100 Subject: [PATCH] Add optimization to compile flags in Release --- CMakeLists.txt | 3 ++- src/CMakeLists.txt | 4 ++-- src/commands/b_list.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fce8386..3ddcd67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,8 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") +set(CMAKE_CXX_FLAGS_DEBUG " ${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -O0 -g") # Options # ------- @@ -60,7 +62,6 @@ if (CODE_COVERAGE) enable_testing() include(CodeCoverage) MESSAGE("Code coverage enabled") - set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -O0 -g") SET(GCC_COVERAGE_LINK_FLAGS " ${GCC_COVERAGE_LINK_FLAGS} -lgcov --coverage") endif (CODE_COVERAGE) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 62ab63c..4a3fdbc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,8 +37,8 @@ add_executable(b_grid commands/b_grid.cpp ${grid_sources} target_link_libraries(b_grid ${MPI_CXX_LIBRARIES} "${PyClassifiers}" "${BayesNet}" ArffFiles mdlp ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::python Boost::numpy) # b_list -add_executable(b_list commands/b_list.cpp ${list_sources} - common/Datasets.cpp common/Dataset.cpp +add_executable(b_list commands/b_list.cpp + common/Datasets.cpp common/Dataset.cpp main/Models.cpp reports/ReportExcel.cpp reports/ExcelFile.cpp reports/ReportBase.cpp reports/DatasetsExcel.cpp reports/DatasetsConsole.cpp reports/ResultsDatasetConsole.cpp reports/ReportsPaged.cpp results/Result.cpp results/ResultsDatasetExcel.cpp results/ResultsDataset.cpp diff --git a/src/commands/b_list.cpp b/src/commands/b_list.cpp index f48dd2e..f9cd901 100644 --- a/src/commands/b_list.cpp +++ b/src/commands/b_list.cpp @@ -106,7 +106,7 @@ int main(int argc, char** argv) } } if (!found) { - throw std::runtime_error("You must specify one of the following commands: datasets, results\n"); + throw std::runtime_error("You must specify one of the following commands: {datasets, results}\n"); } } catch (const exception& err) {