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

Fix macos m1 arm wheel #306

Merged
merged 26 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions .github/workflows/wheel_macos_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
env:
CIBW_BUILD: 'cp37-* cp38-* cp39-* cp310-*'

ARCHS: 'arm64'

# MacOS specific build settings
CIBW_BEFORE_ALL_MACOS: |
brew uninstall --force oclint
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ doc/code/
*.so
cpptests
*.o

.DS_Store
.cache/*
.vscode/*
.ycm_extra_conf.py
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.24.0-dev15"
__version__ = "0.24.0-dev16"
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ def build_extension(self, ext: CMakeExtension):

# Add more platform dependent options
if platform.system() == "Darwin":
#To support ARM64
if os.getenv('ARCHS') == "arm64":
configure_args += ["-DCMAKE_CXX_FLAGS='-target arm64-apple-macos11'"]
else:
configure_args += []
# Disable OpenMP in M1 Macs
if os.environ.get("USE_OMP"):
configure_args += []
else:
configure_args += ["-DENABLE_OPENMP=OFF"]
configure_args += ["-DENABLE_OPENMP=OFF"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
configure_args += ["-DENABLE_OPENMP=OFF"]
configure_args += ["-DENABLE_OPENMP=OFF"]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mlxd , done!

elif platform.system() == "Linux":
if platform.machine() == "x86_64":
configure_args += ["-DENABLE_AVX=ON"] # Enable AVX if x64 on Linux
Expand Down