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

Added ARM64 support; Added build config with environment variables #116

Merged
merged 6 commits into from
May 27, 2021
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
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,18 @@ jobs:
pip install --upgrade h5py==${{ matrix.H5PY_OLDER_VERSION }}
pip list
python test/test.py

build_wheels_macos:
name: Build ARM64 wheels on macos-10.15
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: joerick/cibuildwheel@v1.11.0
env:
CIBW_BUILD: cp39-macosx_*
CIBW_ARCHS_MACOS: arm64
HDF5PLUGIN_SSE2: False
HDF5PLUGIN_AVX2: False
HDF5PLUGIN_NATIVE: False
25 changes: 17 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def get_cpu_sse2_avx2():
:returns: (is SSE2 available, is AVX2 available)
:rtype: List(bool)
"""
if platform.machine() == "arm64":
return False, False
if platform.machine() == "ppc64le":
return True, False
try:
Expand Down Expand Up @@ -138,12 +140,15 @@ class Build(build):

def initialize_options(self):
build.initialize_options(self)
self.hdf5 = None
self.openmp = not sys.platform.startswith('darwin')
self.native = True
self.sse2 = True
self.avx2 = True
self.cpp11 = True
self.hdf5 = os.environ.get("HDF5PLUGIN_HDF5_DIR", None)
self.openmp = os.environ.get(
"HDF5PLUGIN_OPENMP",
"False" if sys.platform.startswith('darwin') else "True"
) == "True"
self.native = os.environ.get("HDF5PLUGIN_NATIVE", "True") == "True"
self.sse2 = os.environ.get("HDF5PLUGIN_SSE2", "True") == "True"
self.avx2 = os.environ.get("HDF5PLUGIN_AVX2", "True") == "True"
self.cpp11 = os.environ.get("HDF5PLUGIN_CPP11", "True") == "True"

def finalize_options(self):
build.finalize_options(self)
Expand All @@ -162,7 +167,9 @@ def finalize_options(self):
logger.warning("C++11 disabled: not available")

if self.sse2:
if (compiler.compiler_type == 'msvc' or
if platform.machine() == 'arm64':
self.sse2 = False
elif (compiler.compiler_type == 'msvc' or
platform.machine() == 'ppc64le'):
self.sse2 = True
else:
Expand All @@ -171,7 +178,9 @@ def finalize_options(self):
logger.warning("SSE2 disabled: not available")

if self.avx2:
if compiler.compiler_type == 'msvc':
if platform.machine() == 'arm64':
self.avx2 = False
elif compiler.compiler_type == 'msvc':
self.avx2 = sys.version_info[:2] >= (3, 5)
elif platform.machine() == 'ppc64le':
self.avx2 = False
Expand Down