WojciechMula / pyahocorasick

Python module (C extension and plain python) implementing Aho-Corasick algorithm
BSD 3-Clause "New" or "Revised" License
914 stars 122 forks source link

Fail install Mac OX 10.15.7 Python 3.8.2; why -arch arm64? #141

Closed gitclem closed 2 years ago

gitclem commented 3 years ago

(I'm not sure how I did this, but I'm using pyenv and at one point it was 3.7 and but now it is 3.8.2, so the directory name is misleading.)

gcc version 10.2.0 Mac OX 10.15.7 Python 3.8.2

MacBook Pro 2.6 GHz 6 -core Intel Core i7

I am puzzled why the command line arguments to gcc contains:

-arch arm64 -arch x86_64

when I'm using a Intel-based Mac

pip install pyahocorasick
Collecting pyahocorasick
  Downloading pyahocorasick-1.4.1.tar.gz (321 kB)
     |████████████████████████████████| 321 kB 2.5 MB/s 
Building wheels for collected packages: pyahocorasick
  Building wheel for pyahocorasick (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/cwang/3.7/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-install-6tlpai5v/pyahocorasick_d0e273a6e91747908c55f074ece196da/setup.py'"'"'; __file__='"'"'/private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-install-6tlpai5v/pyahocorasick_d0e273a6e91747908c55f074ece196da/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-wheel-9bf47m_3
       cwd: /private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-install-6tlpai5v/pyahocorasick_d0e273a6e91747908c55f074ece196da/
  Complete output (11 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'ahocorasick' extension
  creating build
  creating build/temp.macosx-10.14.6-x86_64-3.8
  /opt/local/bin/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/usr/local/opt/libomp/include -Xpreprocessor -fopenmp -DAHOCORASICK_UNICODE= -I/Users/cwang/3.7/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c pyahocorasick.c -o build/temp.macosx-10.14.6-x86_64-3.8/pyahocorasick.o
  gcc: error: this compiler does not support arm64
  gcc: error: unrecognized command-line option '-iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders'
  gcc: error: unrecognized command-line option '-iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers'
  error: command '/opt/local/bin/gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyahocorasick
  Running setup.py clean for pyahocorasick
Failed to build pyahocorasick
Installing collected packages: pyahocorasick
    Running setup.py install for pyahocorasick ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/cwang/3.7/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-install-6tlpai5v/pyahocorasick_d0e273a6e91747908c55f074ece196da/setup.py'"'"'; __file__='"'"'/private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-install-6tlpai5v/pyahocorasick_d0e273a6e91747908c55f074ece196da/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-record-7t03hu_2/install-record.txt --single-version-externally-managed --compile --install-headers /Users/cwang/3.7/include/site/python3.8/pyahocorasick
         cwd: /private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-install-6tlpai5v/pyahocorasick_d0e273a6e91747908c55f074ece196da/
    Complete output (11 lines):
    running install
    running build
    running build_ext
    building 'ahocorasick' extension
    creating build
    creating build/temp.macosx-10.14.6-x86_64-3.8
    /opt/local/bin/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/usr/local/opt/libomp/include -Xpreprocessor -fopenmp -DAHOCORASICK_UNICODE= -I/Users/cwang/3.7/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c pyahocorasick.c -o build/temp.macosx-10.14.6-x86_64-3.8/pyahocorasick.o
    gcc: error: this compiler does not support arm64
    gcc: error: unrecognized command-line option '-iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders'
    gcc: error: unrecognized command-line option '-iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers'
    error: command '/opt/local/bin/gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/cwang/3.7/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-install-6tlpai5v/pyahocorasick_d0e273a6e91747908c55f074ece196da/setup.py'"'"'; __file__='"'"'/private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-install-6tlpai5v/pyahocorasick_d0e273a6e91747908c55f074ece196da/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/k_/blmzttsn5m35fd86smzys36h0000gp/T/pip-record-7t03hu_2/install-record.txt --single-version-externally-managed --compile --install-headers /Users/cwang/3.7/include/site/python3.8/pyahocorasick Check the logs for full command output.

and more info on gcc:

/opt/local/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/opt/local/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/10.2.0_2/libexec/gcc/x86_64-apple-darwin19/10.2.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: ../configure --build=x86_64-apple-darwin19 --prefix=/usr/local/Cellar/gcc/10.2.0_2 --libdir=/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-10 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 10.2.0_2' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk SED=/usr/bin/sed
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (Homebrew GCC 10.2.0_2) 
pombredanne commented 2 years ago

@gitclem we now build wheels for macOS and they will be published in the upcoming 1.4.3 release. See https://github.com/WojciechMula/pyahocorasick/actions/runs/1871803220#artifacts for now. Closing and thanks again for the report!