LoginSignup
2
2

More than 1 year has passed since last update.

M1 mac にQulacsをインストールする方法

Last updated at Posted at 2022-04-25

2022年11月更新

M1 mac にQulacsをインストールしたいです。
M1 macの場合、公式的にサポートされていないのかもしれません。
上手く行った手順は以下の通りでした。

  1. mac にHomebrewをインストールします。
    Homebrewのインストール方法は、ネットで検索したらすぐに見つかるため、省略します。

  2. cmakeをインストールします。
    Qulacsのインストールにはcmakeを使います。事前にcmakeをインストールしておきましょう。
    brew install cmake

  3. gccをインストールします。
    Qulacsはg++を使うので、事前にインストールしておきます
    brew install gcc

  4. gitをインストールします。
    gitを使って、gitリポジトリからqulacsを取得するためです。
    brew install git

  5. 以下のコマンドを実行します。
    git clone https://github.com/qulacs/qulacs.git
    cd qulacs
    export C_COMPILER=gcc-12
    export CXX_COMPILER=g++-12
    ./script/build_gcc.sh
    ここまでは上手く行ったでしょうか?

  6. 最後に以下のコマンドを実行します。
    pip install .

以上で完了です。

上手くいかない時は?

以下を試してみてください。もしかすると上手くいくかもしれません

  • 仮想環境のリセットと再作成(condaを利用している場合)
    • conda remove -n <仮想環境の名前> --all
    • conda create -n <仮想環境の名前>
  • gcc, cmakeの再インストール
    • brew uninstall gcc
    • brew uninstall cmake
    • brew install cmake
    • brew install gcc
  • condaを使わずにpipを使って環境構築する
2
2
2

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
2
2