The current IDE I'm using right now is Code Blocks 8.02 bundled with GCC 4.2.1. My OS is Windows XP SP2.
I can't find any documentation of the GCC compiler on Code Blocks so I decided to post here so that one of the experts on the matter might give some useful advise.
Does the GCC compiler support PGO? If so, what are the things I need to do to enable it?
My engine Twisted Logic is a bitboard engine and it will surely benefit from a 64 bit compile. Does anyone know how to achieve this using GCC?
I also have plans of adding SMP to my engine and I want to know if GCC supports multi-threading. Do I need to download some special libraries and where can I find them?
GCC Compiling
Moderator: Ras
-
- Posts: 803
- Joined: Mon Jul 17, 2006 5:53 am
- Full name: Edsel Apostol
GCC Compiling
Edsel Apostol
https://github.com/ed-apostol/InvictusChess
https://github.com/ed-apostol/InvictusChess
-
- Posts: 2146
- Joined: Fri Jul 14, 2006 7:56 am
- Location: London, England
- Full name: Jim Ablett
Re: GCC Compiling
Hello Edsel,Edsel Apostol wrote:The current IDE I'm using right now is Code Blocks 8.02 bundled with GCC 4.2.1. My OS is Windows XP SP2.
I can't find any documentation of the GCC compiler on Code Blocks so I decided to post here so that one of the experts on the matter might give some useful advise.
Does the GCC compiler support PGO? If so, what are the things I need to do to enable it?
My engine Twisted Logic is a bitboard engine and it will surely benefit from a 64 bit compile. Does anyone know how to achieve this using GCC?
I also have plans of adding SMP to my engine and I want to know if GCC supports multi-threading. Do I need to download some special libraries and where can I find them?
For profile guided optimization use
Code: Select all
-fprofile-generate
Code: Select all
-fprofile-use
http://sourceforge.net/projects/mingw-w64/
For threading you could use with mingw - win32 pthreads library
http://sourceware.org/pthreads-win32/
or with gcc-cygwin using built-in linux pthreads support
regards,
Jim.
-
- Posts: 257
- Joined: Sat Mar 11, 2006 8:31 am
- Location: Malmö, Sweden
- Full name: Bo Persson
Re: GCC Compiling
Why not try this:Edsel Apostol wrote:The current IDE I'm using right now is Code Blocks 8.02 bundled with GCC 4.2.1. My OS is Windows XP SP2.
I can't find any documentation of the GCC compiler on Code Blocks so I decided to post here so that one of the experts on the matter might give some useful advise.
http://gcc.gnu.org/onlinedocs/
-
- Posts: 803
- Joined: Mon Jul 17, 2006 5:53 am
- Full name: Edsel Apostol
Re: GCC Compiling
Thanks Jim!
That's all the answer I need.
That's all the answer I need.
Edsel Apostol
https://github.com/ed-apostol/InvictusChess
https://github.com/ed-apostol/InvictusChess
-
- Posts: 803
- Joined: Mon Jul 17, 2006 5:53 am
- Full name: Edsel Apostol
-
- Posts: 2146
- Joined: Fri Jul 14, 2006 7:56 am
- Location: London, England
- Full name: Jim Ablett
Re: GCC Compiling
You can also get 64-bit pthread libraries as part of the Mozilla-64 build tools.
http://www.mozilla-x86-64.com/download.html
Jim.
http://www.mozilla-x86-64.com/download.html
Jim.
-
- Posts: 415
- Joined: Fri Dec 15, 2006 9:46 pm
- Location: Philippines
Re: GCC Compiling
Ed,
I already included what everybody here suggested in the package I will send to you. Jim has been very helpful when it comes to compiling, so I got everything I need. I owe it to him.
Since you're just a few miles away from me, why not send you a CD to avoid the hassle of downloading kabayan! Siyempre may kasamang bonus pa!
We are hoping for a faster TwistedLogic anytime soon.
Denis
I already included what everybody here suggested in the package I will send to you. Jim has been very helpful when it comes to compiling, so I got everything I need. I owe it to him.
Since you're just a few miles away from me, why not send you a CD to avoid the hassle of downloading kabayan! Siyempre may kasamang bonus pa!
We are hoping for a faster TwistedLogic anytime soon.
Denis
e-mail: computer.chess@hotmail.com
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: GCC Compiling
Yes. compile with the option -fprofile-arcs, then run some representative test cases, then re-compile with the option -fbranch-probabilities and you are done.Edsel Apostol wrote:The current IDE I'm using right now is Code Blocks 8.02 bundled with GCC 4.2.1. My OS is Windows XP SP2.
I can't find any documentation of the GCC compiler on Code Blocks so I decided to post here so that one of the experts on the matter might give some useful advise.
Does the GCC compiler support PGO? If so, what are the things I need to do to enable it?
You need to run a 64 bit operating system. If you do, then the compiler should produce 64 bit code by default... without a 64 bit O/S, you can't run 64 bit applications.
My engine Twisted Logic is a bitboard engine and it will surely benefit from a 64 bit compile. Does anyone know how to achieve this using GCC?
[/quote]
I also have plans of adding SMP to my engine and I want to know if GCC supports multi-threading. Do I need to download some special libraries and where can I find them?
SMP is a function of your operating system. Standard libraries provide you with facilities to create new processes, etc... So you should be good to go there with any compiler and no add-ons needed.
-
- Posts: 803
- Joined: Mon Jul 17, 2006 5:53 am
- Full name: Edsel Apostol
Re: GCC Compiling
Thanks Kuya.
I have learned a lot in my three years of computer programming experience and I could already write efficient code. One can see that the latest version now is almost twice as fast as the version I have last year. A better compiler would even make it faster.
My goal is to try to reach or surpass the Strelka NPS. It is 50 to 75 percent faster than my engine right now in 32 bit. Every 2 percent of speed-up is worth 1 elo.
I have learned a lot in my three years of computer programming experience and I could already write efficient code. One can see that the latest version now is almost twice as fast as the version I have last year. A better compiler would even make it faster.
My goal is to try to reach or surpass the Strelka NPS. It is 50 to 75 percent faster than my engine right now in 32 bit. Every 2 percent of speed-up is worth 1 elo.

Edsel Apostol
https://github.com/ed-apostol/InvictusChess
https://github.com/ed-apostol/InvictusChess
-
- Posts: 2146
- Joined: Fri Jul 14, 2006 7:56 am
- Location: London, England
- Full name: Jim Ablett
Re: GCC Compiling
Just using msvc in instead of gcc could give you an extra 30% maybe more.Edsel Apostol wrote:Thanks Kuya.
I have learned a lot in my three years of computer programming experience and I could already write efficient code. One can see that the latest version now is almost twice as fast as the version I have last year. A better compiler would even make it faster.
My goal is to try to reach or surpass the Strelka NPS. It is 50 to 75 percent faster than my engine right now in 32 bit. Every 2 percent of speed-up is worth 1 elo.
Jim.