• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compilation time windows/linux

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,967
Solutions
99
Reaction score
3,383
Location
Poland
GitHub
gesior
OTClient rebuilds 3 minutes 28 seconds in CodeBlocks.

1. Is it faster in VisualStudio? (multicore compilation like TFS 1.1)
2. Is there a way to compile it on all cores in CodeBlocks?
3. Is there a way to compile it on all cores on linux? (when I compile on virtual machine it uses one core same as in codeblocks)

If it's faster in VisualStudio, where can I get libraries to VS2013 for OTClient? (like I can get them for TFS from github link)
 
1.how one core can be faster than multi (same clock)
2.no
3.compile in console using: make -j$(nproc) for Ubuntu
 
1.how one core can be faster than multi (same clock)
2.no
3.compile in console using: make -j$(nproc) for Ubuntu
2. YES!
Found it:
1. Close Code blocks
2. Open project file (.cbp) in Notepad++ (or any other text editor with 'replace all' option)
3. Replace all 'VERBOSE=1' with 'VERBOSE=1 -j 7' (7 is number of cores, it will use to compile, recommended 1 less then your CPU cores number)
4. Open project in code blocks, Rebuild, it go super faaast :)
 
Last edited:
You can speed up compilation on Linux using ninja instead of make. Install (it is named ninja-build for me) ninja and, when issuing cmake, use:
Code:
cmake -GNinja
Followed by the same parameters you use to generate makefile, then run ninja.

Ninja was build by the Google team that develops Chromium/Chrome, so it is built to compile large projects (OTClient applies), thus speeding up the compilation. It parallelizes extremely well.
 
@Gesior.pl My Master
Please test VERBOSE=1 -j$(nproc) for me seems that works
yea better way to use 1 core less but i cant get smt like this
VERBOSE=1 -j$(nproc) -1 or VERBOSE=1 -j$((nproc)-1)
 
@Gesior.pl
The MSVC compiles faster but occasionally generates worse output code, though on Windows I'd probably just use Visual Studio, the tooling (IntelliSense + debugger support) is one of the best available for C++.
 
Back
Top