Cannot pip3 install wmd on M1 mac

653 views Asked by At

I can't install wmd on my M1 mac, it works perfectly on my intel MacBook but I can't get it working on Apple silicon.

pip3 install wmd gives me the following error:

Collecting wmd
  Using cached wmd-1.3.2.tar.gz (104 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in ./miniforge3/lib/python3.9/site-packages (from wmd) (1.22.3)
Building wheels for collected packages: wmd
  Building wheel for wmd (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      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/wmd
      copying wmd/__init__.py -> build/lib.macosx-11.0-arm64-3.9/wmd
      running build_ext
      building 'libwmdrelax' extension
      creating build/temp.macosx-11.0-arm64-3.9
      creating build/temp.macosx-11.0-arm64-3.9/or-tools
      creating build/temp.macosx-11.0-arm64-3.9/or-tools/src
      creating build/temp.macosx-11.0-arm64-3.9/or-tools/src/base
      creating build/temp.macosx-11.0-arm64-3.9/or-tools/src/graph
      creating build/temp.macosx-11.0-arm64-3.9/or-tools/src/util
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/kallejanssen/miniforge3/include -arch arm64 -fPIC -O2 -isystem /Users/kallejanssen/miniforge3/include -arch arm64 -I/Users/kallejanssen/miniforge3/lib/python3.9/site-packages/numpy/core/include -Ior-tools/src -I/Users/kallejanssen/miniforge3/include/python3.9 -c or-tools/src/base/logging.cc -o build/temp.macosx-11.0-arm64-3.9/or-tools/src/base/logging.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 '/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 wmd
  Running setup.py clean for wmd
Failed to build wmd
Installing collected packages: wmd
  Running setup.py install for wmd ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for wmd did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running install
      /Users/kallejanssen/miniforge3/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      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/wmd
      copying wmd/__init__.py -> build/lib.macosx-11.0-arm64-3.9/wmd
      running build_ext
      building 'libwmdrelax' extension
      creating build/temp.macosx-11.0-arm64-3.9
      creating build/temp.macosx-11.0-arm64-3.9/or-tools
      creating build/temp.macosx-11.0-arm64-3.9/or-tools/src
      creating build/temp.macosx-11.0-arm64-3.9/or-tools/src/base
      creating build/temp.macosx-11.0-arm64-3.9/or-tools/src/graph
      creating build/temp.macosx-11.0-arm64-3.9/or-tools/src/util
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/kallejanssen/miniforge3/include -arch arm64 -fPIC -O2 -isystem /Users/kallejanssen/miniforge3/include -arch arm64 -I/Users/kallejanssen/miniforge3/lib/python3.9/site-packages/numpy/core/include -Ior-tools/src -I/Users/kallejanssen/miniforge3/include/python3.9 -c or-tools/src/base/logging.cc -o build/temp.macosx-11.0-arm64-3.9/or-tools/src/base/logging.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 '/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: legacy-install-failure

× Encountered error while trying to install package.
╰─> wmd

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I've tried building it from source using cmake per https://github.com/src-d/wmd-relax but then I get this error:

[ 25%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/base/sysinfo.cc.o
[ 37%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/base/stringprintf.cc.o
[ 50%] Building CXX object CMakeFiles/wmdrelax.dir/python.cc.o
[ 50%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/graph/min_cost_flow.cc.o
[ 75%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/base/logging.cc.o
[ 75%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/graph/max_flow.cc.o
[ 87%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/util/stats.cc.o
error: unknown target CPU 'vortex'
error: unknown target CPU 'vortex'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
error: unknown target CPU 'vortex'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
error: error: unknown target CPU 'vortex'unknown target CPU 'vortex'

notenote: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4: 
valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4error
: unknown target CPU 'vortex'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
error: unknown target CPU 'vortex'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
make[2]: *** [CMakeFiles/wmdrelax.dir/or-tools/src/base/logging.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/wmdrelax.dir/or-tools/src/graph/min_cost_flow.cc.o] Error 1
make[2]: *** [CMakeFiles/wmdrelax.dir/or-tools/src/util/stats.cc.o] Error 1
make[2]: *** [CMakeFiles/wmdrelax.dir/python.cc.o] Error 1
make[2]: *** [CMakeFiles/wmdrelax.dir/or-tools/src/base/sysinfo.cc.o] Error 1
make[2]: *** [CMakeFiles/wmdrelax.dir/or-tools/src/base/stringprintf.cc.o] Error 1
make[2]: *** [CMakeFiles/wmdrelax.dir/or-tools/src/graph/max_flow.cc.o] Error 1
make[1]: *** [CMakeFiles/wmdrelax.dir/all] Error 2
make: *** [all] Error 2

Any advice? I'd like to use this specific package as I've already developed the code on my other machine and am now finding out it does not work on my M1 mac. It does work in an anaconda virtual environment but then other parts of my code break.

Thanks in advance.

0

There are 0 answers