Skip to content

Commit

Permalink
Transition to modern cmake (#199)
Browse files Browse the repository at this point in the history
Transition to modern cmake and remove git submodules. Should make the build system more stable, adds support for static linking, improves and extends the installation targets, allows direct integration of the C library via cmake via find_package/FetchContent.

Note: removes the option for disabling boost.
Because loading a preset also requires boost since #196, we can't
do anything meaningful when boost is disabled. Thus we might as well
remove the option.
  • Loading branch information
N-Maas authored Dec 9, 2024
1 parent 0545c1a commit c6ba03c
Show file tree
Hide file tree
Showing 159 changed files with 1,871 additions and 10,588 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ignore:
- "tools/*"
- "python/**/*"
- "mt-kahypar/definitions.h"
- "mt-kahypar/application/kahypar.cc"
- "mt-kahypar/application/mt_kahypar.cc"
- "mt-kahypar/io/command_line_options.h"
- "mt-kahypar/io/command_line_options.cpp"
- "mt-kahypar/io/partitioning_output.h"
Expand Down
52 changes: 20 additions & 32 deletions .github/workflows/branch_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,116 +11,104 @@ jobs:
strategy:
matrix:
compiler: [ { os: ubuntu-22.04, cpp: g++-11, cc: gcc-11, install_cmd: g++-11 gcc-11 },
{ os: ubuntu-24.04, cpp: g++-14, cc: gcc-14, install_cmd: g++-14 gcc-14 },
{ os: ubuntu-22.04, cpp: clang++, cc: clang, install_cmd: clang } ]

runs-on: ${{ matrix.compiler.os }}
env:
BOOST_ROOT : "/usr/local/share/boost/1.72.0"
CI_ACTIVE : 1

steps:
- name: Checkout HEAD
uses: actions/checkout@v3
with:
fetch-depth: 1
uses: actions/checkout@v4

- name: Install Dependencies
run: |
sudo apt-get install libtbb-dev libboost-program-options-dev libhwloc-dev lcov gcovr ${{ matrix.compiler.install_cmd }}
- name: Install Mt-KaHyPar Test Suite
- name: Install Mt-KaHyPar
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cpp }}
run: |
git submodule update --init --recursive
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DKAHYPAR_CI_BUILD=ON -DKAHYPAR_ENABLE_SOED_METRIC=OFF -DKAHYPAR_ENABLE_STEINER_TREE_METRIC=OFF -DKAHYPAR_ENABLE_GRAPH_PARTITIONING_FEATURES=OFF -DKAHYPAR_ENABLE_HIGHEST_QUALITY_FEATURES=OFF -DKAHYPAR_ENABLE_LARGE_K_PARTITIONING_FEATURES=OFF
cmake .. --preset=minimal-dev -DKAHYPAR_CI_BUILD=ON
make -j2 MtKaHyPar
mt_kahypar_test_suite:
name: Test Suite
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
env:
BOOST_ROOT : "/usr/local/share/boost/1.72.0"
CI_ACTIVE : 1

steps:
- name: Checkout HEAD
uses: actions/checkout@v3
with:
fetch-depth: 1
uses: actions/checkout@v4

- name: Install Dependencies
run: |
sudo apt-get install libtbb-dev libhwloc-dev libboost-program-options-dev lcov gcovr
sudo apt-get install libtbb-dev libhwloc-dev libboost-program-options-dev lcov gcovr g++-14 gcc-14
- name: Install Mt-KaHyPar Test Suite
env:
CC: gcc-14
CXX: g++-14
run: |
git submodule update --init --recursive
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DKAHYPAR_USE_GCOV=ON -DKAHYPAR_CI_BUILD=ON -DKAHYPAR_ENABLE_SOED_METRIC=OFF -DKAHYPAR_ENABLE_STEINER_TREE_METRIC=OFF -DKAHYPAR_ENABLE_GRAPH_PARTITIONING_FEATURES=OFF -DKAHYPAR_ENABLE_HIGHEST_QUALITY_FEATURES=OFF -DKAHYPAR_ENABLE_LARGE_K_PARTITIONING_FEATURES=OFF
make -j2 mt_kahypar_tests;
cmake .. --preset=minimal-dev -DKAHYPAR_USE_GCOV=ON -DKAHYPAR_CI_BUILD=ON
make -j2 mtkahypar_tests
- name: Run Mt-KaHyPar Tests
run: |
cd build
./tests/mt_kahypar_tests
./tests/mtkahypar_tests
mt_kahypar_c_interface_tests:
name: C Interface Tests
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
env:
BOOST_ROOT : "/usr/local/share/boost/1.72.0"
CI_ACTIVE : 1

steps:
- name: Checkout HEAD
uses: actions/checkout@v3
with:
fetch-depth: 1
uses: actions/checkout@v4

- name: Install Dependencies
run: |
sudo apt-get install libtbb-dev libhwloc-dev libboost-program-options-dev lcov gcovr
- name: Run Mt-KaHyPar C Library Interface Tests
run: |
git submodule update --init --recursive
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DKAHYPAR_CI_BUILD=ON
make -j2 interface_test
cmake .. --preset=dev -DKAHYPAR_CI_BUILD=ON
make -j2 mtkahypar_interface_test
mt_kahypar_python_interface_tests:
name: Python Interface Tests
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
env:
BOOST_ROOT : "/usr/local/share/boost/1.72.0"
CI_ACTIVE : 1

steps:
- name: Checkout HEAD
uses: actions/checkout@v3
with:
fetch-depth: 1
uses: actions/checkout@v4

- name: Install Dependencies
run: |
sudo apt-get install libtbb-dev libhwloc-dev libboost-program-options-dev lcov gcovr
- name: Build Mt-KaHyPar Python Interface
run: |
git submodule update --init --recursive
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DKAHYPAR_CI_BUILD=ON
cmake .. --preset=python -DKAHYPAR_CI_BUILD=ON
make mtkahypar_python -j2
- name: Run Mt-KaHyPar Python Interface Tests
Expand Down
Loading

0 comments on commit c6ba03c

Please sign in to comment.