Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update cmake files #2

Merged
merged 4 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
python-version: ["3.8"]

env:
Expand All @@ -27,6 +27,11 @@ jobs:
- name: Install nauty
run: sudo apt-get install -y libnauty2-dev
if: matrix.os == 'ubuntu-latest'
- name: Install CLP (MacOS)
run: |
brew install clp
brew install cbc
if: ${{ (matrix.os == 'macos-13') || (matrix.os == 'macos-latest') }}
- name: Download data
run: |
python3 -m pip install gdown
Expand All @@ -36,17 +41,6 @@ jobs:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --parallel
cmake --install build --config Release --prefix install
- name: Copy CLP libraries (Darwin)
run: |
mkdir -p "/Users/runner/work/Osi/Osi/dist/lib"
cp -rf "${GITHUB_WORKSPACE}/build/_deps/mathoptsolverscmake-build/extern/Osi-prefix/src/Osi/lib/" "/Users/runner/work/Osi/Osi/dist/lib"
mkdir -p "/Users/runner/work/CoinUtils/CoinUtils/dist/lib"
cp -rf "${GITHUB_WORKSPACE}/build/_deps/mathoptsolverscmake-build/extern/CoinUtils-prefix/src/CoinUtils/lib/" "/Users/runner/work/CoinUtils/CoinUtils/dist/lib"
mkdir -p "/Users/runner/work/Clp/Clp/dist/lib"
cp -rf "${GITHUB_WORKSPACE}/build/_deps/mathoptsolverscmake-build/extern/Clp-prefix/src/Clp/lib/" "/Users/runner/work/Clp/Clp/dist/lib"
mkdir -p "/Users/runner/work/Cbc/Cbc/dist/lib"
cp -rf "${GITHUB_WORKSPACE}/build/_deps/mathoptsolverscmake-build/extern/Cbc-prefix/src/Cbc/lib/" "/Users/runner/work/Cbc/Cbc/dist/lib"
if: matrix.os == 'macos-latest'
- name: Run tests
run: python3 -u scripts/run_tests.py test_results
- name: Checkout main branch
Expand All @@ -59,17 +53,6 @@ jobs:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --parallel
cmake --install build --config Release --prefix install
- name: Copy CLP libraries (Darwin)
run: |
mkdir -p "/Users/runner/work/Osi/Osi/dist/lib"
cp -rf "${GITHUB_WORKSPACE}/build/_deps/mathoptsolverscmake-build/extern/Osi-prefix/src/Osi/lib/" "/Users/runner/work/Osi/Osi/dist/lib"
mkdir -p "/Users/runner/work/CoinUtils/CoinUtils/dist/lib"
cp -rf "${GITHUB_WORKSPACE}/build/_deps/mathoptsolverscmake-build/extern/CoinUtils-prefix/src/CoinUtils/lib/" "/Users/runner/work/CoinUtils/CoinUtils/dist/lib"
mkdir -p "/Users/runner/work/Clp/Clp/dist/lib"
cp -rf "${GITHUB_WORKSPACE}/build/_deps/mathoptsolverscmake-build/extern/Clp-prefix/src/Clp/lib/" "/Users/runner/work/Clp/Clp/dist/lib"
mkdir -p "/Users/runner/work/Cbc/Cbc/dist/lib"
cp -rf "${GITHUB_WORKSPACE}/build/_deps/mathoptsolverscmake-build/extern/Cbc-prefix/src/Cbc/lib/" "/Users/runner/work/Cbc/Cbc/dist/lib"
if: matrix.os == 'macos-latest'
- name: Run tests
run: python3 -u scripts/run_tests.py test_results_ref
- name: Process tests
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ project(StableSolver LANGUAGES CXX)
option(STABLESOLVER_USE_CBC "Use CPLEX" ON)
option(STABLESOLVER_USE_CPLEX "Use CPLEX" OFF)

# Avoid FetchContent warning.
cmake_policy(SET CMP0135 NEW)

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

Expand Down
25 changes: 13 additions & 12 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
include(FetchContent)

# Fetch boost.
set(BOOST_INCLUDE_LIBRARIES thread filesystem system program_options)
set(BOOST_INCLUDE_LIBRARIES thread filesystem system program_options dynamic_bitset)
set(BOOST_ENABLE_CMAKE ON)
include(FetchContent)
FetchContent_Declare(
Boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-1.84.0
GIT_SHALLOW TRUE
)
Boost
URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.xz
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(Boost)

# Fetch fontanf/optimizationtools.
FetchContent_Declare(
optimizationtools
GIT_REPOSITORY https://github.com/fontanf/optimizationtools.git
GIT_TAG 33a3966ece149d390ec7ce08699669b5267e64aa)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../optimizationtools/")
GIT_TAG a0973a7dfa64b9d305f75879c80d252e714ce2cf
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../optimizationtools/"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(optimizationtools)

# Fetch fontanf/localsearchsolver.
FetchContent_Declare(
localsearchsolver
GIT_REPOSITORY https://github.com/fontanf/localsearchsolver.git
GIT_TAG ecb15ef667d107f25ea51d056368f9c4e15545e2)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../localsearchsolver/")
GIT_TAG f7110fdd15fa1b9001006bfbf7a8ab53f925016d
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../localsearchsolver/"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(localsearchsolver)

# Fetch fontanf/mathoptsolverscmake.
Expand All @@ -39,6 +39,7 @@ endif()
FetchContent_Declare(
mathoptsolverscmake
GIT_REPOSITORY https://github.com/fontanf/mathoptsolverscmake.git
GIT_TAG 56190725f424249a3acd8fce3ff50e08fe675cc6)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../mathoptsolverscmake/")
GIT_TAG 80cd13a843e2c10684abbfe76cf9aae0d71ff79d
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../mathoptsolverscmake/"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(mathoptsolverscmake)
Loading