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

Support for Apple Silicon M1 #153

Open
stephangreene opened this issue Dec 9, 2021 · 5 comments
Open

Support for Apple Silicon M1 #153

stephangreene opened this issue Dec 9, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@stephangreene
Copy link

Is support for the M1 on the roadmap?

I get the following when trying to install on M1:

$ pip install tomotopy
Collecting tomotopy
Using cached tomotopy-0.12.2.tar.gz (1.1 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.11.0 in /Users/sgreene/miniforge3/lib/python3.9/site-packages (from tomotopy) (1.21.1)
Building wheels for collected packages: tomotopy
Building wheel for tomotopy (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/sgreene/miniforge3/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-install-zbbc7pzy/tomotopy_f5103692bba0430b98d4e4f5cb2eacdf/setup.py'"'"'; file='"'"'/private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-install-zbbc7pzy/tomotopy_f5103692bba0430b98d4e4f5cb2eacdf/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-wheel-txzeomxe
cwd: /private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-install-zbbc7pzy/tomotopy_f5103692bba0430b98d4e4f5cb2eacdf/
Complete output (64 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-11.0-arm64-3.9
creating build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/_version.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/coherence.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/init.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/_summary.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/utils.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/label.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
running egg_info
writing tomotopy.egg-info/PKG-INFO
writing dependency_links to tomotopy.egg-info/dependency_links.txt
writing requirements to tomotopy.egg-info/requires.txt
writing top-level names to tomotopy.egg-info/top_level.txt
reading manifest file 'tomotopy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'LICENSE.txt'
writing manifest file 'tomotopy.egg-info/SOURCES.txt'
copying tomotopy/auto_labeling_code.rst -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/auto_labeling_code_with_porter.rst -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/documentation.kr.rst -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/documentation.rst -> build/lib.macosx-11.0-arm64-3.9/tomotopy
running build_ext
building '_tomotopy' extension
creating build/temp.macosx-11.0-arm64-3.9
creating build/temp.macosx-11.0-arm64-3.9/src
creating build/temp.macosx-11.0-arm64-3.9/src/python
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/sgreene/miniforge3/include -arch arm64 -fPIC -O2 -isystem /Users/sgreene/miniforge3/include -arch arm64 -Iinclude -I/Users/sgreene/miniforge3/lib/python3.9/site-packages/numpy/core/include -I/Users/sgreene/miniforge3/include/python3.9 -c src/python/py_rt.cpp -o build/temp.macosx-11.0-arm64-3.9/src/python/py_rt.o -std=c++1y -O3 -fpermissive -stdlib=libc++ -Wno-unused-variable -Wno-switch
In file included from src/python/py_rt.cpp:25:
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:14:2: error: this header is for x86 only
#error this header is for x86 only
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:286:5: error: invalid output constraint '=a' in asm
__cpuid(__leaf, __eax, __ebx, __ecx, __edx);
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:251:11: note: expanded from macro '__cpuid'
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx)
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:301:5: error: invalid output constraint '=a' in asm
__cpuid(__leaf, *__eax, *__ebx, *__ecx, *__edx);
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:251:11: note: expanded from macro '__cpuid'
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx)
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:315:5: error: invalid output constraint '=a' in asm
__cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:258:11: note: expanded from macro '__cpuid_count'
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx)
^
src/python/py_rt.cpp:30:34: error: invalid output constraint '=a' in asm
asm volatile("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
^
src/python/py_rt.cpp:38:2: error: invalid output constraint '=a' in asm
__cpuid_count(InfoType, 0, info[0], info[1], info[2], info[3]);
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:258:11: note: expanded from macro '__cpuid_count'
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx)
^
6 errors generated.
error: command '/usr/bin/clang' failed with exit code 1

ERROR: Failed building wheel for tomotopy
Running setup.py clean for tomotopy
Failed to build tomotopy
Installing collected packages: tomotopy
Running setup.py install for tomotopy ... error
ERROR: Command errored out with exit status 1:
command: /Users/sgreene/miniforge3/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-install-zbbc7pzy/tomotopy_f5103692bba0430b98d4e4f5cb2eacdf/setup.py'"'"'; file='"'"'/private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-install-zbbc7pzy/tomotopy_f5103692bba0430b98d4e4f5cb2eacdf/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-record-1njwyoak/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sgreene/miniforge3/include/python3.9/tomotopy
cwd: /private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-install-zbbc7pzy/tomotopy_f5103692bba0430b98d4e4f5cb2eacdf/
Complete output (64 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-11.0-arm64-3.9
creating build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/_version.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/coherence.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/init.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/_summary.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/utils.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/label.py -> build/lib.macosx-11.0-arm64-3.9/tomotopy
running egg_info
writing tomotopy.egg-info/PKG-INFO
writing dependency_links to tomotopy.egg-info/dependency_links.txt
writing requirements to tomotopy.egg-info/requires.txt
writing top-level names to tomotopy.egg-info/top_level.txt
reading manifest file 'tomotopy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'LICENSE.txt'
writing manifest file 'tomotopy.egg-info/SOURCES.txt'
copying tomotopy/auto_labeling_code.rst -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/auto_labeling_code_with_porter.rst -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/documentation.kr.rst -> build/lib.macosx-11.0-arm64-3.9/tomotopy
copying tomotopy/documentation.rst -> build/lib.macosx-11.0-arm64-3.9/tomotopy
running build_ext
building '_tomotopy' extension
creating build/temp.macosx-11.0-arm64-3.9
creating build/temp.macosx-11.0-arm64-3.9/src
creating build/temp.macosx-11.0-arm64-3.9/src/python
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/sgreene/miniforge3/include -arch arm64 -fPIC -O2 -isystem /Users/sgreene/miniforge3/include -arch arm64 -Iinclude -I/Users/sgreene/miniforge3/lib/python3.9/site-packages/numpy/core/include -I/Users/sgreene/miniforge3/include/python3.9 -c src/python/py_rt.cpp -o build/temp.macosx-11.0-arm64-3.9/src/python/py_rt.o -std=c++1y -O3 -fpermissive -stdlib=libc++ -Wno-unused-variable -Wno-switch
In file included from src/python/py_rt.cpp:25:
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:14:2: error: this header is for x86 only
#error this header is for x86 only
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:286:5: error: invalid output constraint '=a' in asm
__cpuid(__leaf, __eax, __ebx, __ecx, __edx);
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:251:11: note: expanded from macro '__cpuid'
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx)
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:301:5: error: invalid output constraint '=a' in asm
__cpuid(__leaf, *__eax, *__ebx, *__ecx, *__edx);
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:251:11: note: expanded from macro '__cpuid'
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx)
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:315:5: error: invalid output constraint '=a' in asm
__cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:258:11: note: expanded from macro '__cpuid_count'
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx)
^
src/python/py_rt.cpp:30:34: error: invalid output constraint '=a' in asm
asm volatile("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
^
src/python/py_rt.cpp:38:2: error: invalid output constraint '=a' in asm
__cpuid_count(InfoType, 0, info[0], info[1], info[2], info[3]);
^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/cpuid.h:258:11: note: expanded from macro '__cpuid_count'
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx)
^
6 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/sgreene/miniforge3/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-install-zbbc7pzy/tomotopy_f5103692bba0430b98d4e4f5cb2eacdf/setup.py'"'"'; file='"'"'/private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-install-zbbc7pzy/tomotopy_f5103692bba0430b98d4e4f5cb2eacdf/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/11/29tzm_tx4cd3p3rprtfq9kmc0000gn/T/pip-record-1njwyoak/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sgreene/miniforge3/include/python3.9/tomotopy Check the logs for full command output.

@bab2min
Copy link
Owner

bab2min commented Dec 10, 2021

Hi @stephangreene ,
Currently, tomotopy don't support Apple Silicon M1.
I am working on M1 support, but this may takes some time.
Please use Rosetta until M1 is fully supported.

@stephangreene
Copy link
Author

stephangreene commented Dec 15, 2021

Thanks @bab2min I appreciate the effort on this. Look forward to trying it out when ready.

@bab2min bab2min added the enhancement New feature or request label Mar 21, 2022
@jsigman
Copy link

jsigman commented Oct 20, 2022

Same here, thanks @bab2min

@soonernotfaster
Copy link

@bab2min, how can I help add M1 support?

bab2min added a commit that referenced this issue Jan 21, 2023
Support for macOS ARM64 arch (#153)
@bab2min
Copy link
Owner

bab2min commented Jan 22, 2023

@stephangreene @steven-solomon @jsigman
Finally, I got a new mac with M1 chip and fixed the error. You can install tomotopy v0.12.4 at macOS with Apple Silicon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants