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

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

<p>On most machines, compiling a simple change requires mostly less then 10 seconds.</p>

CC BY-SA 3.0
2016-05-25T10:57:14.873Z
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.
Pieter Wuille
CC BY-SA 3.0
2016-05-25T15:54:26.617Z
@PieterWuille and then you wait for the client to verify chain and sync before trying out your new expirimental OP code, etc.?
pinhead
CC BY-SA 3.0
2016-05-25T16:16:19.613Z
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.
Pieter Wuille
CC BY-SA 3.0
2016-05-25T07:20:19.727Z
2016-05-25T07:20:19.727Z
Jonas Schnelli
<p>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?</p>

CC BY-SA 3.0
2016-05-24T23:31:11.363Z
How long does it take to compile the *second* time you try?
Greg Hewgill
CC BY-SA 3.0
2016-05-25T00:34:46.097Z
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
<compiling>
How do developers fix bugs when compiling takes so long?
pinhead
# How do developers fix bugs when compiling takes so long?

(Asked by: username_0 on 2016-05-24)

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?

**Tags:** compiling

> **Comments:**
> **username_1**: How long does it take to compile the *second* time you try?  
> **username_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.  

---

## 1 answers

### Answer by username_3 on 2016-05-25. Score: 4

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.

> **Comments:**
> **username_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.  
> **username_0**: @username_4 and then you wait for the client to verify chain and sync before trying out your new expirimental OP code, etc.?  
> **username_4**: 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.  

---

