Skip to content

Commit

Permalink
linux arm fix
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Maas committed Nov 29, 2024
1 parent 486c8c5 commit 1474216
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 53 deletions.
96 changes: 48 additions & 48 deletions .github/workflows/python_build_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,10 @@ on:
- master

jobs:
# package_linux:
# name: Python Package Linux
package_linux:
name: Python Package Linux

# runs-on: ubuntu-24.04
# env:
# CI_ACTIVE : 1
# TBB_INSTALL_DIR: /tmp/tbb_build

# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# with:
# platforms: all

# - name: Install Dependencies
# run: |
# sudo apt-get install libtbb-dev libhwloc-dev libboost-program-options-dev
# python3 -m pip install cibuildwheel>=2.22.0

# - name: Build Python Wheels
# env:
# CIBW_ARCHS_LINUX: x86_64 aarch64
# CIBW_BUILD: cp3*-manylinux*
# run: |
# # run cmake to create pyproject.toml from pyproject.toml.in
# cmake -B configure_python --preset=minimal -DKAHYPAR_SETUP_PYTHON=On -DKAHYPAR_TBB_DIR=$TBB_INSTALL_DIR
# rm -rf configure_python
# python3 -m cibuildwheel --output-dir wheels

# - uses: actions/upload-artifact@v4
# with:
# name: cibw-wheels-ubuntu-24.04
# path: ./wheels/*.whl


package_macos:
name: Python Package MacOS

runs-on: macos-latest
runs-on: ubuntu-24.04
env:
CI_ACTIVE : 1
TBB_INSTALL_DIR: /tmp/tbb_build
Expand All @@ -56,23 +18,61 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Install Dependencies
run: |
brew install tbb boost hwloc pipx
sudo apt-get install libtbb-dev libhwloc-dev libboost-program-options-dev
python3 -m pip install cibuildwheel>=2.22.0
- name: Build Python Wheels
env:
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BUILD: cp3*-macos*
# TBB doesn't compile on older MacOS than 10.13
MACOSX_DEPLOYMENT_TARGET: 10.13
CIBW_ARCHS_LINUX: aarch64
CIBW_BUILD: cp3*-manylinux*
run: |
# run cmake to create pyproject.toml from pyproject.toml.in
cmake -B configure_python --preset=minimal -DKAHYPAR_SETUP_PYTHON=On -DKAHYPAR_TBB_DIR=$TBB_INSTALL_DIR
rm -rf configure_python
pipx run cibuildwheel --output-dir wheels
python3 -m cibuildwheel --output-dir wheels
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-macos
name: cibw-wheels-ubuntu-24.04
path: ./wheels/*.whl


# package_macos:
# name: Python Package MacOS

# runs-on: macos-latest
# env:
# CI_ACTIVE : 1
# TBB_INSTALL_DIR: /tmp/tbb_build

# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5

# - name: Install Dependencies
# run: |
# brew install tbb boost hwloc pipx

# - name: Build Python Wheels
# env:
# CIBW_ARCHS_MACOS: x86_64 arm64
# CIBW_BUILD: cp3*-macos*
# # TBB doesn't compile on older MacOS than 10.13
# MACOSX_DEPLOYMENT_TARGET: 10.13
# run: |
# # run cmake to create pyproject.toml from pyproject.toml.in
# cmake -B configure_python --preset=minimal -DKAHYPAR_SETUP_PYTHON=On -DKAHYPAR_TBB_DIR=$TBB_INSTALL_DIR
# rm -rf configure_python
# pipx run cibuildwheel --output-dir wheels

# - uses: actions/upload-artifact@v4
# with:
# name: cibw-wheels-macos
# path: ./wheels/*.whl
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,18 +414,16 @@ if(UNIX AND NOT WIN32)
target_link_options(MtKaHyPar-BuildFlags INTERFACE $<$<CONFIG:DEBUG>:-fsanitize=undefined>)
endif()

if (KAHYPAR_ENABLE_EXTENDED_INSTRUCTIONS)
if (KAHYPAR_X86 AND KAHYPAR_ENABLE_EXTENDED_INSTRUCTIONS)
include(CheckCXXCompilerFlag)
include(CheckSSE4_2)
block()
set(CMAKE_REQUIRED_QUIET TRUE)
check_cxx_compiler_flag(-mcrc32 KAHYPAR_HAS_CRC32)
endblock()

if(KAHYPAR_X86)
target_compile_options(MtKaHyPar-BuildFlags INTERFACE -mcx16)
endif()
if(KAHYPAR_HAS_CRC32 AND KAHYPAR_X86)
target_compile_options(MtKaHyPar-BuildFlags INTERFACE -mcx16)
if(KAHYPAR_HAS_CRC32)
target_compile_options(MtKaHyPar-BuildFlags INTERFACE -mcrc32)
endif()
if(BUILTIN_POPCNT)
Expand Down

0 comments on commit 1474216

Please sign in to comment.