In general: you don't compile required files if they are header-only. However, you must compile them if they have also source files.
echoprint-codegen only uses boost headers for some numeric operations, so you don't need to compile boost (source)
The libraries used by echoprint-codegen
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking (source).
However, there are other Boost libraries (like Boost.Filesystem) that must by compiled.