fairseq
fairseq copied to clipboard
pip install --editable ./ on M1 Chip
🐛 Bug
To Reproduce
Steps to reproduce the behavior (always include the command you ran):
- Run cmd 'pip install --editable ./'
- See error
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/miniconda3/envs/ajax/include -arch arm64 -fPIC -O2 -isystem /opt/miniconda3/envs/ajax/include -arch arm64 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/miniconda3/envs/ajax/include -D_FORTIFY_SOURCE=2 -isystem /opt/miniconda3/envs/ajax/include -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/opt/miniconda3/envs/ajax/include/python3.9 -c src/lxml/etree.c -o build/temp.macosx-11.0-arm64-cpython-39/src/lxml/etree.o -w -flat_namespace
clang: error: unsupported argument 'core2' to option '-march='
Compile failed: command '/usr/bin/clang' failed with exit code 1
creating var
creating var/folders
creating var/folders/x5
creating var/folders/x5/66_wxv1n6b5833m4cd9jbmq40000gn
creating var/folders/x5/66_wxv1n6b5833m4cd9jbmq40000gn/T
cc -I/usr/include/libxml2 -c /var/folders/x5/66_wxv1n6b5833m4cd9jbmq40000gn/T/xmlXPathInit32ta3m80.c -o var/folders/x5/66_wxv1n6b5833m4cd9jbmq40000gn/T/xmlXPathInit32ta3m80.o
cc var/folders/x5/66_wxv1n6b5833m4cd9jbmq40000gn/T/xmlXPathInit32ta3m80.o -lxml2 -o a.out
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build fairseq lxml
ERROR: Could not build wheels for fairseq, lxml, which is required to install pyproject.toml-based projects
Environment
- fairseq Version (e.g., 1.0 or main): 0.12.2
- PyTorch Version (e.g., 1.0) 3.9
- OS (e.g., Linux): MacOS
- How you installed fairseq (
pip
, source): pip - Build command you used (if compiling from source): pip install --editable ./
- Python version: 3.9
- CUDA/cuDNN version:N/A
- GPU models and configuration:N/A
- Any other relevant information:N/A
it says in the README to run this on MacOS:
CFLAGS="-stdlib=libc++" pip install --editable ./
and it worked for me on M1 chip.