It takes so long to compile Bitcoin Core on my machine... I can't imagine trying to fix bugs like a missed semicolon and having to wait an hour for the compiler to finish before testing. Is this really what devs have to deal with? Or is there a way to just compile smaller units of the code and run it quickly over and over again until all the semi colons are fixed?

  • 1
    How long does it take to compile the second time you try? Commented May 24, 2016 at 23:31
  • 2
    If you modify a file and rerun make, it only compiles the section you touched. Also, you can run it as make -j 2 to get it to run on two cores at once.
    – Nick ODell
    Commented May 25, 2016 at 0:34

1 Answer 1


Initial compiling of bitcoin-core can take a couple of minutes. If you have a multicore processor, you can use make -j<cores+1> to speed up compiling (parallel compiling).

Once bitcoin-core is compiled, a single semicolon change does (mostly) not require to recompile everything. You only compile the affected files (.cpp) again and do do the linking.

On most machines, compiling a simple change requires mostly less then 10 seconds.

  • 4
    In addition, if you install ccache, Bitcoin Core's build process will make use of it, preventing recompilation even when going back to an earlier version of the file you've already compiled before. Commented May 25, 2016 at 10:57
  • @PieterWuille and then you wait for the client to verify chain and sync before trying out your new expirimental OP code, etc.?
    – pinhead
    Commented May 25, 2016 at 15:54
  • Verifying the chain is not nearly sufficient for a proposed consensus rule change (which a new opcode is). We usually demand extensive use cases, unit/RPC tests, many reviews, and IRC meeting/mailinglist discussion for something like that. For non-consensus changes, things are simpler. Commented May 25, 2016 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.