0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

M1でdwave-ocean-sdkを使いたい~Docker編~

Last updated at Posted at 2021-08-18

#悲しい現実
dwave-ocean-sdkはまだARMには対応していません
つまり自力で依存パッケージを含めビルドしてあげる必要があります
というわけでビルドとセットアップをやってくれるDockerfileを書きました

##issue
といっても実際には,Dockerにしちゃえばpipのインストール中にこけるのは依存パッケージの中でも一つだけ(dwave-tabu)でした

Install via pip fails on Debian / Ubuntu · Issue #77 · dwavesystems/dwave-tabu

##Dockerfile

取り急ぎで作ったので各自修正してご利用ください

FROM python:3.9
USER root

RUN apt-get update
RUN apt-get -y install locales && \
    localedef -f UTF-8 -i ja_JP ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV TZ JST-9
ENV TERM xterm

RUN apt-get install -y vim less libboost-dev swig build-essential cmake git
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install scikit-build matplotlib scipy numpy cython ninja

RUN git clone https://github.com/dwavesystems/dwave-preprocessing.git
WORKDIR /dwave-preprocessing
RUN pip install -r requirements.txt
RUN python setup.py build_ext --inplace
RUN python setup.py install
WORKDIR /

RUN git clone https://github.com/dwavesystems/dwave-ocean-sdk.git
WORKDIR /dwave-ocean-sdk
RUN python3 setup.py build
RUN python3 setup.py install

RUN echo \
    ""$CONFIGURATION_FILE_PATH"$'\n'\
    "y"$'\n'\
    "$PROFILE_NAME"$'\n'\
    "$ENDPOINT"$'\n'\
    "$TOKEN"$'\n'\
    "$DEFEAULT_CLIENT_CLASS"$'\n'\
    "$DEFEAULT_SOLVER"$'\n'"\
    | dwave setup --install-all

##更新情報

  • 2021/9/16

dwave-ocean-sdkが3.5.0になったら動かなくなったので更新しました

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?