From 950e7621c81ab6b2ded68b6d27c110fbb120a02a Mon Sep 17 00:00:00 2001 From: Florian Fontan Date: Fri, 12 Apr 2024 21:59:29 +0200 Subject: [PATCH] Update build files --- .github/workflows/build.yml | 2 ++ README.md | 4 ++-- scripts/run_tests.py | 14 ++++++-------- src/knapsack/CMakeLists.txt | 2 ++ src/multiple_choice_subset_sum/CMakeLists.txt | 2 ++ src/subset_sum/CMakeLists.txt | 2 ++ 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 247b9bb..292419c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,7 @@ jobs: run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel + cmake --install build --prefix install - name: Run unit tests working-directory: build/test run: ctest --parallel @@ -48,6 +49,7 @@ jobs: run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel + cmake --install build --prefix install - name: Run tests run: python3 -u scripts/run_tests.py test_results_ref - name: Process tests diff --git a/README.md b/README.md index c0918fb..51bb217 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ python3 scripts/download_data.py Solve: ```shell -./build/src/knapsack/KnapsackSolver_knapsack_main --verbosity-level 1 --algorithm dynamic-programming-primal-dual --input data/knapsack/largecoeff/knapPI_2_10000_10000000/knapPI_2_10000_10000000_50.csv --format pisinger +./build/src/knapsack/KnapsackSolver_knapsack --verbosity-level 1 --algorithm dynamic-programming-primal-dual --input data/knapsack/largecoeff/knapPI_2_10000_10000000/knapPI_2_10000_10000000_50.csv --format pisinger ``` ``` ==================================== @@ -205,7 +205,7 @@ Feasible: 1 ``` ```shell -./build/src/subset_sum/KnapsackSolver_subset_sum_main --verbosity-level 1 --input data/subset_sum/pthree/pthree_1000_1 --algorithm dynamic-programming-bellman-word-ram-rec +./build/src/subset_sum/KnapsackSolver_subset_sum --verbosity-level 1 --input data/subset_sum/pthree/pthree_1000_1 --algorithm dynamic-programming-bellman-word-ram-rec ``` ``` ==================================== diff --git a/scripts/run_tests.py b/scripts/run_tests.py index 49f71ff..840579f 100644 --- a/scripts/run_tests.py +++ b/scripts/run_tests.py @@ -14,10 +14,9 @@ knapsack_main = os.path.join( - "build", - "src", - "knapsack", - "KnapsackSolver_knapsack_main") + "install", + "bin", + "KnapsackSolver_knapsack") knapsack_data = os.environ['KNAPSACK_DATA'] @@ -53,10 +52,9 @@ subset_sum_main = os.path.join( - "build", - "src", - "subset_sum", - "KnapsackSolver_subset_sum_main") + "install", + "bin", + "KnapsackSolver_subset_sum") subset_sum_data = os.environ['SUBSET_SUM_DATA'] diff --git a/src/knapsack/CMakeLists.txt b/src/knapsack/CMakeLists.txt index b7ddb8f..d9a84b0 100644 --- a/src/knapsack/CMakeLists.txt +++ b/src/knapsack/CMakeLists.txt @@ -23,6 +23,8 @@ target_link_libraries(KnapsackSolver_knapsack_main PUBLIC KnapsackSolver_knapsack_dynamic_programming_bellman KnapsackSolver_knapsack_dynamic_programming_primal_dual Boost::program_options) +set_target_properties(KnapsackSolver_knapsack_main PROPERTIES OUTPUT_NAME "KnapsackSolver_knapsack" ) +install(TARGETS KnapsackSolver_knapsack_main DESTINATION bin) add_library(KnapsackSolver_knapsack_generator) target_sources(KnapsackSolver_knapsack_generator PRIVATE diff --git a/src/multiple_choice_subset_sum/CMakeLists.txt b/src/multiple_choice_subset_sum/CMakeLists.txt index 2dd0c6b..d4dab46 100644 --- a/src/multiple_choice_subset_sum/CMakeLists.txt +++ b/src/multiple_choice_subset_sum/CMakeLists.txt @@ -18,3 +18,5 @@ target_sources(KnapsackSolver_multiple_choice_subset_sum_main PRIVATE target_link_libraries(KnapsackSolver_multiple_choice_subset_sum_main PUBLIC KnapsackSolver_multiple_choice_subset_sum_dynamic_programming_bellman Boost::program_options) +set_target_properties(KnapsackSolver_multiple_choice_subset_sum_main PROPERTIES OUTPUT_NAME "KnapsackSolver_multiple_choice_subset_sum" ) +install(TARGETS KnapsackSolver_multiple_choice_subset_sum_main DESTINATION bin) diff --git a/src/subset_sum/CMakeLists.txt b/src/subset_sum/CMakeLists.txt index ae1a7f0..24ce42c 100644 --- a/src/subset_sum/CMakeLists.txt +++ b/src/subset_sum/CMakeLists.txt @@ -20,6 +20,8 @@ target_link_libraries(KnapsackSolver_subset_sum_main PUBLIC KnapsackSolver_subset_sum_dynamic_programming_balancing KnapsackSolver_subset_sum_dynamic_programming_primal_dual Boost::program_options) +set_target_properties(KnapsackSolver_subset_sum_main PROPERTIES OUTPUT_NAME "KnapsackSolver_subset_sum" ) +install(TARGETS KnapsackSolver_subset_sum_main DESTINATION bin) add_library(KnapsackSolver_subset_sum_generator) target_sources(KnapsackSolver_subset_sum_generator PRIVATE