split out compile.cpp