Skip to content

Commit

Permalink
Switch to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanf committed Apr 14, 2024
1 parent 84d06c1 commit e9eccf2
Show file tree
Hide file tree
Showing 37 changed files with 586 additions and 242 deletions.
2 changes: 0 additions & 2 deletions .bazelrc

This file was deleted.

18 changes: 15 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8"]

env:
KNAPSACK_WITH_CONFLICTS_DATA: ${{ github.workspace }}/data/knapsack_with_conflicts
SEQUENTIAL_ORDERING: ${{ github.workspace }}/data/sequential_ordering
FLOWSHOP_SCHEDULING_DATA: ${{ github.workspace }}/data/flowshop_scheduling
SIMPLE_ASSEMBLY_LINE_BALANCING_1_DATA: ${{ github.workspace }}/data/simple_assembly_line_balancing_1

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -26,7 +32,10 @@ jobs:
python3 -m pip install gdown
python3 scripts/download_data.py
- name: Build
run: bazel build -- //...
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
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
- name: Checkout main branch
Expand All @@ -35,8 +44,11 @@ jobs:
git fetch --depth 1
git checkout main
- name: Build
run: bazel build -- //...
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
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
run: python3 ./bazel-treesearchsolver/external/optimizationtools/scripts/process_tests.py --ref test_results_ref --new test_results
run: python3 -u ./build/_deps/optimizationtools-src/scripts/process_tests.py --ref test_results_ref --new test_results
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.15.0)

project(TreeSearchSolver LANGUAGES CXX)

# Require C++11.
set(CMAKE_CXX_STANDARD 11)

# Enable output of compile commands during generation.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Add sub-directories.
add_subdirectory(extern)
add_subdirectory(src)
add_subdirectory(test)
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ Data can be downloaded from [fontanf/orproblems](https://github.com/fontanf/orpr

Compile:
```shell
bazel build -- //...
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --parallel
cmake --install build --config Release --prefix install
```

Download data:
Expand All @@ -66,7 +68,7 @@ python3 scripts/download_data.py

Then, examples can be executed as follows:
```shell
./bazel-bin/examples/sequential_ordering_main --verbosity-level 1 --input "./data/sequential_ordering/soplib/R.700.1000.60.sop" --format soplib --algorithm iterative-beam-search --certificate solution.txt
./instance/bin/treesearchsolver_sequential_ordering --verbosity-level 1 --input "./data/sequential_ordering/soplib/R.700.1000.60.sop" --format soplib --algorithm iterative-beam-search --certificate solution.txt
```
```
======================================
Expand Down
69 changes: 0 additions & 69 deletions WORKSPACE

This file was deleted.

98 changes: 0 additions & 98 deletions examples/BUILD

This file was deleted.

10 changes: 10 additions & 0 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Enable FetchContent.
include(FetchContent)

# Fetch fontanf/orproblems.
FetchContent_Declare(
orproblems
GIT_REPOSITORY https://github.com/fontanf/orproblems.git
GIT_TAG e9a58e010f7dc0ca7b5eea2358ed11d386f8622a)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../orproblems/")
FetchContent_MakeAvailable(orproblems)
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e9eccf2

Please sign in to comment.