Skip to content

Commit

Permalink
Update cmake files
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanf committed Apr 12, 2024
1 parent 9b89bec commit 74fe3a4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Build
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
cmake --install build --prefix install
cmake --build build --config Release --parallel
cmake --install build --config Release --prefix install
- name: Run unit tests
working-directory: build/test
run: ctest --parallel
Expand All @@ -48,8 +48,8 @@ jobs:
- name: Build
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
cmake --install build --prefix install
cmake --build build --config Release --parallel
cmake --install build --config Release --prefix install
- name: Run tests
run: python3 -u scripts/run_tests.py test_results_ref
- name: Process tests
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ Here are some usage examples of this library:
Compile:
```shell
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
cmake --build build --config Release --parallel
cmake --install build --config Release --prefix install
```

Download data:
Expand All @@ -84,7 +85,7 @@ python3 scripts/download_data.py
Solve:

```shell
./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
./install/bin/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
```
```
====================================
Expand Down Expand Up @@ -205,7 +206,7 @@ Feasible: 1
```

```shell
./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
./install/bin/knapsacksolver_subset_sum --verbosity-level 1 --input data/subset_sum/pthree/pthree_1000_1 --algorithm dynamic-programming-bellman-word-ram-rec
```
```
====================================
Expand Down
2 changes: 1 addition & 1 deletion extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ FetchContent_MakeAvailable(Boost)
FetchContent_Declare(
optimizationtools
GIT_REPOSITORY https://github.com/fontanf/optimizationtools.git
GIT_TAG 95bd5064ef65ea964fe00a1547c2a556cd98d588)
GIT_TAG 33a3966ece149d390ec7ce08699669b5267e64aa)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../optimizationtools/")
FetchContent_MakeAvailable(optimizationtools)
4 changes: 2 additions & 2 deletions scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
knapsack_main = os.path.join(
"install",
"bin",
"KnapsackSolver_knapsack_main")
"knapsacksolver_knapsack")
knapsack_data = os.environ['KNAPSACK_DATA']


Expand Down Expand Up @@ -54,7 +54,7 @@
subset_sum_main = os.path.join(
"install",
"bin",
"KnapsackSolver_subset_sum_main")
"knapsacksolver_subset_sum")
subset_sum_data = os.environ['SUBSET_SUM_DATA']


Expand Down
1 change: 1 addition & 0 deletions src/knapsack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ 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)
Expand Down
1 change: 1 addition & 0 deletions src/multiple_choice_subset_sum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +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)
1 change: 1 addition & 0 deletions src/subset_sum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ 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)
Expand Down

0 comments on commit 74fe3a4

Please sign in to comment.