I want to know if there is a way to compile the code via terminal after modify one line in the code' but without the need to compile all the code (now I compile with 'make release').


1 Answer 1


If you just need one particular program, you can build just that one, eg:

make -C build/release daemon
make -C build/release simplewallet


If the line you changed is in a header file, then a lot will be recompiled, but if in a cpp file, only that one will be rebuilt (plus libs/binaries).

If you change a line in a header file, then ccache might help. If the line change ends up such that some preprocessed translation units end up identical, then ccache will avoid rebuilding those.

Another way is to use precompiled headers. There was a short lived PR adding those to Monero, but is was apparently saving not very much, and actually making things slower in other cases, so it was closed. Maybe this is something that can be looked at again.

Other possible ways: remove optimization flags such as -O2, ensure lots of RAM is available for caching headers/libs, move the tree and headers to a SSD, use -jN if you have the RAM and CPU.

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.