solidityをbrewで入れるとコンパイルエラーになった

book.ethereum-jp.net の手順通り brew install solidityすると以下のコンパイルエラーで怒られた

Last 15 lines from /Users/hp29/Library/Logs/Homebrew/solidity/02.make:
      dev::solidity::CommandLineInterface::handleAst(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in CommandLineInterface.cpp.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for langutil::SourceReferenceFormatter", referenced from:
      dev::solidity::CommandLineInterface::processInput() in CommandLineInterface.cpp.o
      dev::solidity::CommandLineInterface::assemble(yul::AssemblyStack::Language, yul::AssemblyStack::Machine, bool) in CommandLineInterface.cpp.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for langutil::SourceReferenceFormatterHuman", referenced from:
      dev::solidity::CommandLineInterface::processInput() in CommandLineInterface.cpp.o
      dev::solidity::CommandLineInterface::assemble(yul::AssemblyStack::Language, yul::AssemblyStack::Machine, bool) in CommandLineInterface.cpp.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [solc/solc] Error 1
make[1]: *** [solc/CMakeFiles/solc.dir/all] Error 2
make: *** [all] Error 2

ここを参考に

git clone --recursive https://github.com/ethereum/solidity.git
cd solidity
mkdir build
cd build
cmake .. && make
make install

するとうまく行った。