macOS High Sierra 10.13.6 + homebrew で leveldb をインストール
セミナー用のガイダンス
leveldb
leveldb のためのformulaがあるか検索
$ brew search leveldb
==> Formulae
leveldb redis-leveldb
存在したので更にoption をチェックする
$ brew options leveldb
--with-test
Verify the build with make check
leveldbのインストール
ということなので、--with-test
オプションを指定してインストール
$ brew install leveldb --with-test
==> Installing dependencies for leveldb: gperftools, snappy
==> Installing leveldb dependency: gperftools
==> Downloading https://homebrew.bintray.com/bottles/gperftools-2.7.high_sierra.
######################################################################## 100.0%
==> Pouring gperftools-2.7.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/gperftools/2.7: 103 files, 4.3MB
==> Installing leveldb dependency: snappy
==> Downloading https://homebrew.bintray.com/bottles/snappy-1.1.7_1.high_sierra.
######################################################################## 100.0%
==> Pouring snappy-1.1.7_1.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/snappy/1.1.7_1: 18 files, 118KB
==> Installing leveldb --with-test
==> Downloading https://github.com/google/leveldb/archive/v1.20.tar.gz
==> Downloading from https://codeload.github.com/google/leveldb/tar.gz/v1.20
######################################################################## 100.0%
==> make
Last 15 lines from /Users/percipere/Library/Logs/Homebrew/leveldb/01.make:
2018-07-21 19:39:28 +0900
make
mkdir out-shared
clang++ -I. -I./include -std=c++0x -DOS_MACOSX -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT -DSNAPPY -O2 -DNDEBUG -fPIC -c db/db_bench.cc -o out-shared/db/db_bench.o
error: unable to open output file 'out-shared/db/db_bench.o': 'No such file or directory'
1 error generated.
make: *** [out-shared/db/db_bench.o] Error 1
make: *** Waiting for unfinished jobs....
READ THIS: https://docs.brew.sh/Troubleshooting
エラー対応
db_bench.o
が無いというエラーが発生
ファイル名からは大きな影響が無いかもしれないので、とりあえず再度実行してみる
$ brew install leveldb --with-test
==> Downloading https://github.com/google/leveldb/archive/v1.20.tar.gz
Already downloaded: /Users/percipere/Library/Caches/Homebrew/leveldb-1.20.tar.gz
==> make
==> make check
🍺 /usr/local/Cellar/leveldb/1.20_2: 26 files, 1.2MB, built in 2 minutes 13 seconds
完了