I can't speak about RE2, but whether the graphs are created when the program is compiled is an implementation issue. It's certainly true that NFA's generally aren't - probably because O(n) where n is the size of regexp so it's very cheap. But since DFA could be O(2^n) they often are created at compile time. For example LEX does that, IIRC a Rust RE library does, and DFA's created by LR parsers are invariably do.
Secondly I specifically said "compile time (of the regular expression)". It is true that may not happen when the program is complied. But there always is a compile time, the outcome of the compile depends only one source and not any time input inputs, and it is completely deterministic. If PHP re's were compiled to DFA's for instance and you did hit the rare exponential space case, you would find out the first time the program attempted to use the regexp, rather than some random user finding it by having the program fail some arbitrary time later.
Secondly I specifically said "compile time (of the regular expression)". It is true that may not happen when the program is complied. But there always is a compile time, the outcome of the compile depends only one source and not any time input inputs, and it is completely deterministic. If PHP re's were compiled to DFA's for instance and you did hit the rare exponential space case, you would find out the first time the program attempted to use the regexp, rather than some random user finding it by having the program fail some arbitrary time later.