LoginSignup
0
0

More than 5 years have passed since last update.

〜備忘録〜 SCIP scipoptsuite-4.0.0をMacにインストール

Last updated at Posted at 2017-11-06

SCIP4.0.0ダウンロード

SCIPの公式サイトに飛んでSCIP Optimization Suiteを選択。scipoptsuite-4.0.0.tgzをダウンロード。

コンパイル

tar fzxv scipoptsuite-4.0.0.tgz #ダウンロードしたversionに合わせて書き直す
cd scipoptsuite-4.0.0
make

ここでエラー発生
fatal error: 'gmp.h' file not found
#include "gmp.h"
^~~~~~~
1 error generated.
make[3]: ** [obj/O.darwin.x86_64.gnu.opt/lib/changesoplex.o] Error 1
make[2]: ** [makelibfile] Error 2*
make[1]: ** [/Users/t_taka/Downloads/scipoptsuite-4.0.0/soplex-3.0.0/lib/libsoplex.darwin.x86_64.gnu.opt.a] Error 2
make: ** [scipbinary] Error 2

gmp.hファイルが見つからないというエラー。

ここで次の方法を試した。

「fatal error: 'gmp.h' file not found」への対処

cd /usr/local/include/
ls

を実行してgmpがないことを確認。gmpをインストールする。

brew install gmp

※homebrewは

wikipedia<「Mac OS Xオペレーティングシステム上でソフトウェアの導入を単純化するパッケージ管理システムのひとつである」

実行ファイルや設定ファイル、ライブラリetcを一つのファイルとしてまとめているものをパッケージと呼びます。
パッケージ管理システムとはこのパッケージのインストール(アンインストール)作業を一元的管理するものです。パッケージやライブラリの依存関係などが管理できます。
ちなみにパッケージ管理には、

バイナリを取得するもの
ソースコードを取得してビルドするもの
のパターンがあるみたいです。
1バイナリとはソースコードを予めビルドした成果物を配布していることを指すようです。
なので1バイナリは2ビルドよりも早くインストールできる特徴を持っているようです。
それに対して2ビルドは、自分のmacでビルドするので自分のmacに最適化出来る特徴を持っているようです。

しかしまた以下のエラーが発生する

Homebrew must be run under Ruby 2.3! You're running 2.0.0. (RuntimeError)

ここで適当にRubyのバージョンが古いと出ているがとりあえず以下のコマンドでhomebrewをアップデート

brew update

再び

brew install gmp

を実行すると

user:include t_taka$ brew install gmp
==> Downloading https://homebrew.bintray.com/bottles/gmp-6.1.2_1.sierra.bottle.t
######################################################################## 100.0%
==> Pouring gmp-6.1.2_1.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/gmp/6.1.2_1: 18 files, 3.1MB

ここでscipoptsuite-4.0.0の再びディレクトリに移動

cd scipoptsuite-4.0.0

make

コンパイルをすると

〜〜〜略

** Build complete.*
** Find your SCIP binary in "/Users/user_name/Downloads/scipoptsuite-4.0.0/scip-4.0.0/bin".
** Enter "make test" to solve a number of easy instances in order to verify that SCIP runs correctly.

と表示されてビルドが成功する。

以下を実行してテストを実行。

make test

正常に動作終了。

ここで/usr/local/にインストールする

cd scip-4.0.0
make install INSTALLDIR=/usr/local/

これでscipというコマンドをターミナル上で入力することによって、scipが動作するようになる。

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