Yale-LILY / SummerTime

An open-source text summarization toolkit for non-experts. EMNLP'2021 Demo
https://arxiv.org/abs/2108.12738
Apache License 2.0
269 stars 30 forks source link

Error during installation - clang: error: the clang compiler does not support '-march=native' #116

Closed lewismc closed 2 years ago

lewismc commented 2 years ago

Hi Folks, this looks like a REALLY useful toolkit. Kudos. I will most likely start on a text summarization interface for Apache Tika and SummerTime looks like it could be a great implementation. I tried to install on macOS Catalina 10.15.7

% pip3 install pyrouge@git+https://github.com/bheinzerling/pyrouge.git
% pip3 install en_core_web_sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0-py3-none-any.whl
% pip3 install summertime
...
Building wheels for collected packages: pyemd, wmd
  Building wheel for pyemd (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/pyemd_ad43b78cfae24d44a96e3465d0e1c40e/setup.py'"'"'; __file__='"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/pyemd_ad43b78cfae24d44a96e3465d0e1c40e/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/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-wheel-kwtyvmij
       cwd: /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/pyemd_ad43b78cfae24d44a96e3465d0e1c40e/
  Complete output (118 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14.6-x86_64-3.8
  creating build/lib.macosx-10.14.6-x86_64-3.8/pyemd
  copying pyemd/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/pyemd
  copying pyemd/__about__.py -> build/lib.macosx-10.14.6-x86_64-3.8/pyemd
  running build_ext
  building 'pyemd.emd' extension
  creating build/temp.macosx-10.14.6-x86_64-3.8
  creating build/temp.macosx-10.14.6-x86_64-3.8/pyemd
  clang -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/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -I/Users/lmcgibbn/Library/Python/3.8/lib/python/site-packages/numpy/core/include -c pyemd/emd.cpp -o build/temp.macosx-10.14.6-x86_64-3.8/pyemd/emd.o
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits.h:57:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:63:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
  #error Unsupported architecture
   ^
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits.h:57:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:64:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_dev_t;         /* dev_t */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
  typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
  typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
  typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
          ^
  note: '__uint128_t' declared here
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_wctype_t;
          ^
  note: '__uint128_t' declared here
  In file included from pyemd/emd.cpp:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:75:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_va_list.h:31:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  #error architecture not supported
   ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyemd
  Running setup.py clean for pyemd
  Building wheel for wmd (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/setup.py'"'"'; __file__='"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/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/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-wheel-slon_mgf
       cwd: /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/
  Complete output (18 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14.6-x86_64-3.8
  creating build/lib.macosx-10.14.6-x86_64-3.8/wmd
  copying wmd/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/wmd
  running build_ext
  building 'libwmdrelax' extension
  creating build/temp.macosx-10.14.6-x86_64-3.8
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/graph
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/base
  creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/util
  clang -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/Users/lmcgibbn/Library/Python/3.8/lib/python/site-packages/numpy/core/include -Ior-tools/src -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c python.cc -o build/temp.macosx-10.14.6-x86_64-3.8/python.o -std=c++11 -march=native -ftree-vectorize -DNDEBUG -Wno-sign-compare -fPIC -flto
  clang: error: the clang compiler does not support '-march=native'
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for wmd
  Running setup.py clean for wmd
Failed to build pyemd wmd
Installing collected packages: wmd, werkzeug, urlextract, texttable, tensorboard-plugin-wit, stanza, spacy, sklearn, sacrebleu, qtconsole, pyzstd, pytorch-pretrained-bert, pyppmd, pyflakes, pyemd, pycryptodomex, pycodestyle, pybcj, pyarrow, psutil, platformdirs, pathspec, path.py, mypy-extensions, multivolumefile, multiprocess, moverscore, mccabe, markdown, jupyter-console, ipywidgets, icecream, huggingface-hub, grpcio, graphviz, google-auth-oauthlib, gin-config, fsspec, brotli, blanc, bert-score, beautifulsoup4, absl-py, tensorboard, summ-eval, sentencepiece, pytextrank, py7zr, progressbar, prettytable, lexrank, jupyter, gensim, gdown, flake8, datasets, cython, black, summertime
    Running setup.py install for wmd ... error
    ERROR: Command errored out with exit status 1:
     command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/setup.py'"'"'; __file__='"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/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/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-record-rsxxqcdw/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/lmcgibbn/Library/Python/3.8/include/python3.8/wmd
         cwd: /private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/
    Complete output (18 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14.6-x86_64-3.8
    creating build/lib.macosx-10.14.6-x86_64-3.8/wmd
    copying wmd/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/wmd
    running build_ext
    building 'libwmdrelax' extension
    creating build/temp.macosx-10.14.6-x86_64-3.8
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/graph
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/base
    creating build/temp.macosx-10.14.6-x86_64-3.8/or-tools/src/util
    clang -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/Users/lmcgibbn/Library/Python/3.8/lib/python/site-packages/numpy/core/include -Ior-tools/src -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c python.cc -o build/temp.macosx-10.14.6-x86_64-3.8/python.o -std=c++11 -march=native -ftree-vectorize -DNDEBUG -Wno-sign-compare -fPIC -flto
    clang: error: the clang compiler does not support '-march=native'
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/setup.py'"'"'; __file__='"'"'/private/var/folders/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-install-rx5dmeye/wmd_57e02a8ba0d84ea9b543b6f6ea8afeab/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/3p/t0shq8j10q56q45ntm0skn00fv8362/T/pip-record-rsxxqcdw/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/lmcgibbn/Library/Python/3.8/include/python3.8/wmd Check the logs for full command output.

I searched the project issues and could not find any related issue so decided to open this one. Is there a recommended way for me to build the project? Thank you

lewismc commented 2 years ago

Interesting. I was able to get a stable install chain by explicitly defining the architecture

% ARCHFLAGS="-arch x86_64" pip3 install summertime
lewismc commented 2 years ago

... but alas that did not fix the issue. It turns out that the version of Python which shipped with XCode was being used on the $PATH. Something like

export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH

Once I removed that and installed the homebrew Python package ensuring it was on my $PATH then the installation worked just fine.