Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

update setup.py to allow "wheel" construction on mac#1088

Merged
andy-neuma merged 2 commits into
mainfrom
mac-deepsparse
Jun 21, 2023
Merged

update setup.py to allow "wheel" construction on mac#1088
andy-neuma merged 2 commits into
mainfrom
mac-deepsparse

Conversation

@andy-neuma

@andy-neuma andy-neuma commented Jun 21, 2023

Copy link
Copy Markdown
Member

SUMMARY:
allows "wheel" generation on macOS. reuses the ENV, NM_ALLOW_DARWIN.

TEST:
checks after the updating the condition.

❯ export NM_ALLOW_DARWIN=0
❯ python3 setup.py sdist bdist_wheel
Loaded version 1.6.0 from /Users/andy/sidelot/wand/deepsparse/src/deepsparse/generated_version.py
Traceback (most recent call last):
  File "/Users/andy/sidelot/wand/deepsparse/setup.py", line 223, in <module>
    _check_supported_system()
  File "/Users/andy/sidelot/wand/deepsparse/setup.py", line 188, in _check_supported_system
    raise OSError(
OSError: Native Mac is currently unsupported for DeepSparse. Please run on a Linux system or within a Linux container on Mac. More info can be found in our docs here: https://docs.neuralmagic.com/deepsparse/source/hardware.html

and enabling it

❯ export NM_ALLOW_DARWIN=1
❯ python3 setup.py sdist bdist_wheel
Loaded version 1.6.0 from /Users/andy/sidelot/wand/deepsparse/src/deepsparse/generated_version.py
Checking to see if /Users/andy/sidelot/wand/deepsparse/src/deepsparse/arch.bin exists.. True
running sdist
running egg_info
...
adding 'deepsparse_nightly-1.6.0.dist-info/top_level.txt'
adding 'deepsparse_nightly-1.6.0.dist-info/RECORD'
removing build/bdist.macosx-10.9-universal2/wheel

bnellnm
bnellnm previously approved these changes Jun 21, 2023
Comment thread setup.py Outdated

@bfineran bfineran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM pending @dbarbuzzi's comment

@bfineran bfineran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me, we should probably just add a helper across our repos to evaluate truthy values from environment variables

@andy-neuma andy-neuma merged commit ac4062c into main Jun 21, 2023
@andy-neuma andy-neuma deleted the mac-deepsparse branch June 21, 2023 21:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants