Broken Command Line Tools on Sierra, can't install Node.js native packages, build Python etc
From your log, it looks like the build process expects ccache to be installed.  Depending on your preference, use either Homebrew or MacPorts to install ccache, and then try the build again.