Version | Bench Depth | Nodes Per Second | Time to completion (ms)
GCC 4.8 16 3,593,517 19807
GCC 5.4 16 3,354,796 21217
GCC 6.4 16 3,290,804 21629
GCC 7.2 16 3,239,579 21971
CLANG 16 2,921,272 24365
So whats the deal here? Am I missing compile flags? I tried march=native, mtune=native and got the same results as well...
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra "Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
Reading the release information about gcc 5 and above, optimization enhancement mostly concerns inter-procedural optimization and linker optimizations. You probably need to use the -flto flag and profile guided optimization to see some enhancements.
Also note that gcc changes it version numbering. The version 4.x were release about once a year with x incremented and now they increment the main version number once a year. So there are much more changes between say gcc 4.2 and gcc 4.8 than between gcc 5 and gcc 7.
Version | Bench Depth | Nodes Per Second | Time to completion (ms)
GCC 4.8 16 3,593,517 19807
GCC 5.4 16 3,354,796 21217
GCC 6.4 16 3,290,804 21629
GCC 7.2 16 3,239,579 21971
CLANG 16 2,921,272 24365
So whats the deal here? Am I missing compile flags? I tried march=native, mtune=native and got the same results as well...
Have you tried g++ instead of gcc? Or at least "-std=c11" instead of "-std=c99"? It might require some code changes but I think the Gnu compiler might be able to create faster code when using the newer language standards.
AndrewGrant wrote:So whats the deal here? Am I missing compile flags? I tried march=native, mtune=native and got the same results as well...
Hi,
Which optimization flags did you use ?
With higher optimization, you can get a faster engine, but at times, a minor bug could cause your program, even to crash.
He posted a link to the Makefile (he compiles with -O3).
That higher optimisation levels can turn "minor bugs" into crashes is not a reason not to use optimisation. Such "minor bugs" simply need to be fixed. If use of an uninitialised variable does not crash the program, it will likely make it produce incorrect results (which can be almost impossible to notice in a chess engine, except for a measurable decrease in playing strength).
syzygy wrote:That higher optimisation levels can turn "minor bugs" into crashes is not a reason not to use optimisation. Such "minor bugs" simply need to be fixed. If use of an uninitialised variable does not crash the program, it will likely make it produce incorrect results (which can be almost impossible to notice in a chess engine, except for a measurable decrease in playing strength).
The gcc <variable> "may be used uninitialized" gives unpredictable bogus results. I visually inspect each element and then ignore the warnings if there is nothing wrong. Of course, something else may be triggering the warning.
Just tried using -std=c11. Results are about the same.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra "Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
AndrewGrant wrote:Just tried using -std=c11. Results are about the same.
What if you add -flto to CFLAGS?
(It does not do any miracles for me, and I just noticed that even regular Stockfish is faster on my PC if I disable link-time optimisation, but still it is worth a try.)