諦めの記録
環境
$ sw_vers
ProductName: macOS
ProductVersion: 11.4
BuildVersion: 20F71
$ uname -a
Darwin MBA.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 arm64
$ python3 --version
Python 3.9.6
M1 MacBook Airです
エラー1
内容
dimod/binary/cybqm/cybqm_float32.cpp:648:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for dimod
Failed to build dimod
ERROR: Could not build wheels for dimod which use PEP 517 and cannot be installed directly
解決法
$ python3
Python 3.9.6 (default, Jun 28 2021, 19:24:41)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.get_include()
'/opt/homebrew/lib/python3.9/site-packages/numpy/core/include'
パスをコピペ
$ export CFLAGS="-I $(コピペしたpath) $CFLAGS"
エラー2
内容
# include <boost/graph/graph_traits.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
解決法
$ brew install boost
エラー3
内容
dimod/binary/cybqm/cybqm_float32.cpp:673:10: fatal error: 'dimod/quadratic_model.h' file not found
#include "dimod/quadratic_model.h"
^~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for dimod
解決法
$ git clone https://github.com/dwavesystems/dimod.git
$ cd dimod
$ export CFLAGS="-I ./dimod/include $CFLAGS"
エラー4
内容
Complete output (8 lines):
running install
running build
running build_py
running build_ext
building 'tabu._tabu_search' extension
swigging tabu/tabu_search.i to tabu/tabu_search_wrap.cpp
swig -python -c++ -threads -o tabu/tabu_search_wrap.cpp tabu/tabu_search.i
error: command 'swig' failed: No such file or directory
----------------------------------------
解決法
$ brew install swig
エラー4以降
内容
ERROR: Failed building wheel for numpy
Failed to build dwave-greedy dwave-preprocessing dwave-tabu pyqubo numpy
ERROR: Could not build wheels for dwave-preprocessing, numpy which use PEP 517 and cannot be installed directly
解決法
心が折れた
諦めた
あとがき
ARMとx64の切り替え,homebrewとPythonのごちゃごちゃ,M1の銅のこうのが原因のような
Dockerでどうにかしたほうがいい気がしてきた